OpenAMP Library  353
remoteproc_virtio.h File Reference
#include <metal/io.h>
#include <metal/list.h>
#include <openamp/virtio.h>
#include <metal/cache.h>

Go to the source code of this file.

Data Structures

struct  remoteproc_virtio
 Virtio structure for remoteproc instance. More...
 

Macros

#define RPROC_MAX_VRING_DESC   USHRT_MAX
 
#define RSC_TABLE_FLUSH(x, s)   do { } while (0)
 
#define RSC_TABLE_INVALIDATE(x, s)   do { } while (0)
 

Typedefs

typedef int(* rpvdev_notify_func) (void *priv, uint32_t id)
 

Functions

struct virtio_devicerproc_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. More...
 
void rproc_virtio_remove_vdev (struct virtio_device *vdev)
 Remove rproc virtio vdev. More...
 
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. More...
 
int rproc_virtio_notified (struct virtio_device *vdev, uint32_t notifyid)
 remoteproc virtio is got notified More...
 
void rproc_virtio_wait_remote_ready (struct virtio_device *vdev)
 Blocking function, waiting for the remote core is ready to start communications. More...
 

Macro Definition Documentation

◆ RPROC_MAX_VRING_DESC

#define RPROC_MAX_VRING_DESC   USHRT_MAX

◆ RSC_TABLE_FLUSH

#define RSC_TABLE_FLUSH (   x,
 
)    do { } while (0)

◆ RSC_TABLE_INVALIDATE

#define RSC_TABLE_INVALIDATE (   x,
 
)    do { } while (0)

Typedef Documentation

◆ rpvdev_notify_func

typedef int(* rpvdev_notify_func) (void *priv, uint32_t id)

Function Documentation

◆ rproc_virtio_create_vdev()

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.

Parameters
roleVIRTIO_DEV_DRIVER or VIRTIO_DEV_DEVICE
notifyidVirtio device notification id
rscPointer to the virtio device resource
rsc_ioPointer to the virtio device resource I/O region
privPointer to the private data
notifyvdev and virtqueue notification function
rst_cbReset virtio device callback
Returns
pointer to the created virtio device for success, NULL for failure.

◆ rproc_virtio_init_vring()

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.

Parameters
vdevPointer to the virtio device
indexvring index in the virtio device
notifyidremoteproc vring notification id
vavring virtual address
ioPointer to vring I/O region
num_descsNumber of descriptors
alignvring alignment
Returns
0 for success, negative value for failure.

◆ rproc_virtio_notified()

int rproc_virtio_notified ( struct virtio_device vdev,
uint32_t  notifyid 
)

remoteproc virtio is got notified

Parameters
vdevPointer to the virtio device
notifyidNotify id
Returns
0 for successful, negative value for failure

◆ rproc_virtio_remove_vdev()

void rproc_virtio_remove_vdev ( struct virtio_device vdev)

Remove rproc virtio vdev.

Parameters
vdevPointer to the virtio device

◆ rproc_virtio_wait_remote_ready()

void rproc_virtio_wait_remote_ready ( struct virtio_device vdev)

Blocking function, waiting for the remote core is ready to start communications.

Parameters
vdevPointer to the virtio device