ThirdParty/sw_services/openamp/src/open-amp/lib/rpmsg/rpmsg_virtio.c
static int rpmsg_virtio_wait_remote_ready(struct rpmsg_virtio_device *rvdev)
{
	uint8_t status;

	while (1) {
		status = rpmsg_virtio_get_status(rvdev);
		/* Busy wait until the remote is ready */
		if (status & VIRTIO_CONFIG_STATUS_NEEDS_RESET) {
			rpmsg_virtio_set_status(rvdev, 0);
			/* TODO notify remote processor */
		} else if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) {
			return true;
		}
		/* TODO: clarify metal_cpu_yield usage*/
		metal_cpu_yield();
	}

	return false;
}
/**
 * check if the remote is ready to start RPMsg communication
 */
check if the remote is ready to start RPMsg communication
check if the remote is ready to start RPMsg communication
static int rpmsg_virtio_wait_remote_ready(struct rpmsg_virtio_device *rvdev)
{
	uint8_t status;
	while (1) {
		status = rpmsg_virtio_get_status(rvdev);
		if (status & VIRTIO_CONFIG_STATUS_NEEDS_RESET) {
			rpmsg_virtio_set_status(rvdev, 0);
		} else if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) {
			return true;
		}
		metal_cpu_yield();
	}
	return false;
}
static int rpmsg_virtio_wait_remote_ready ( struct rpmsg_virtio_device * rvdev ) { uint8_t status ; while ( 1 ) { status = rpmsg_virtio_get_status ( rvdev ) ; if ( status & VIRTIO_CONFIG_STATUS_NEEDS_RESET ) { rpmsg_virtio_set_status ( rvdev , 0 ) ; } else if ( status & VIRTIO_CONFIG_STATUS_DRIVER_OK ) { return true ; } metal_cpu_yield ( ) ; } return false ; }
check if the remote is ready to start RPMsg communication
check if the remote is ready to start RPMsg communication
/* Busy wait until the remote is ready */ /* TODO notify remote processor */ /* TODO: clarify metal_cpu_yield usage*/