12 #ifndef REMOTEPROC_VIRTIO_H
13 #define REMOTEPROC_VIRTIO_H
16 #include <metal/list.h>
18 #include <metal/cache.h>
20 #if defined __cplusplus
25 #define RPROC_MAX_VRING_DESC USHRT_MAX
28 #if defined(VIRTIO_USE_DCACHE)
29 #define RSC_TABLE_FLUSH(x, s) metal_cache_flush(x, s)
30 #define RSC_TABLE_INVALIDATE(x, s) metal_cache_invalidate(x, s)
32 #define RSC_TABLE_FLUSH(x, s) do { } while (0)
33 #define RSC_TABLE_INVALIDATE(x, s) do { } while (0)
57 struct metal_list
node;
76 void *rsc,
struct metal_io_region *rsc_io,
103 struct metal_io_region *io,
104 unsigned int num_descs,
unsigned int align);
124 #if defined __cplusplus
int rproc_virtio_init_vring(struct virtio_device *vdev, unsigned int index, unsigned int notifyid, void *va, struct metal_io_region *io, unsigned int num_descs, unsigned int align)
Initialize rproc virtio vring.
Definition: remoteproc_virtio.c:356
struct virtio_device * rproc_virtio_create_vdev(unsigned int role, unsigned int notifyid, void *rsc, struct metal_io_region *rsc_io, void *priv, rpvdev_notify_func notify, virtio_dev_reset_cb rst_cb)
Create rproc virtio vdev.
Definition: remoteproc_virtio.c:290
void rproc_virtio_wait_remote_ready(struct virtio_device *vdev)
Blocking function, waiting for the remote core is ready to start communications.
Definition: remoteproc_virtio.c:400
int(* rpvdev_notify_func)(void *priv, uint32_t id)
Definition: remoteproc_virtio.h:37
void rproc_virtio_remove_vdev(struct virtio_device *vdev)
Remove rproc virtio vdev.
Definition: remoteproc_virtio.c:344
int rproc_virtio_notified(struct virtio_device *vdev, uint32_t notifyid)
remoteproc virtio is got notified
Definition: remoteproc_virtio.c:377
Virtio structure for remoteproc instance.
Definition: remoteproc_virtio.h:40
struct metal_list node
List node.
Definition: remoteproc_virtio.h:57
rpvdev_notify_func notify
Notification function.
Definition: remoteproc_virtio.h:51
void * vdev_rsc
Address of vdev resource.
Definition: remoteproc_virtio.h:45
struct virtio_device vdev
Virtio device.
Definition: remoteproc_virtio.h:54
struct metal_io_region * vdev_rsc_io
Metal I/O region of vdev_info, can be NULL.
Definition: remoteproc_virtio.h:48
void * priv
Pointer to private data.
Definition: remoteproc_virtio.h:42
Structure definition for virtio devices for use by the applications/drivers.
Definition: virtio.h:188
unsigned int role
If it is virtio backend or front end.
Definition: virtio.h:199
void * priv
Private data.
Definition: virtio.h:211
uint32_t notifyid
Unique position on the virtio bus.
Definition: virtio.h:190
void(* virtio_dev_reset_cb)(struct virtio_device *vdev)
Definition: virtio.h:158