OpenAMP Library  353
virtio_ring.h File Reference
#include <metal/compiler.h>

Go to the source code of this file.

Data Structures

struct  vring_desc
 VirtIO ring descriptors. More...
 
struct  vring_avail
 Used to offer buffers to the device. More...
 
struct  vring_used_elem
 
struct  vring_used
 The device returns buffers to this structure when done with them. More...
 
struct  vring
 The virtqueue layout structure. More...
 

Macros

#define VRING_DESC_F_NEXT   1
 
#define VRING_DESC_F_WRITE   2
 
#define VRING_DESC_F_INDIRECT   4
 
#define VRING_USED_F_NO_NOTIFY   1
 
#define VRING_AVAIL_F_NO_INTERRUPT   1
 
#define vring_used_event(vr)   ((vr)->avail->ring[(vr)->num])
 
#define vring_avail_event(vr)   ((vr)->used->ring[(vr)->num].event)
 

Functions

static int vring_size (unsigned int num, unsigned long align)
 
static void vring_init (struct vring *vr, unsigned int num, uint8_t *p, unsigned long align)
 
static int vring_need_event (uint16_t event_idx, uint16_t new_idx, uint16_t old)
 

Variables

METAL_PACKED_BEGIN struct vring_desc METAL_PACKED_END
 

Macro Definition Documentation

◆ vring_avail_event

#define vring_avail_event (   vr)    ((vr)->used->ring[(vr)->num].event)

◆ VRING_AVAIL_F_NO_INTERRUPT

#define VRING_AVAIL_F_NO_INTERRUPT   1

◆ VRING_DESC_F_INDIRECT

#define VRING_DESC_F_INDIRECT   4

◆ VRING_DESC_F_NEXT

#define VRING_DESC_F_NEXT   1

◆ VRING_DESC_F_WRITE

#define VRING_DESC_F_WRITE   2

◆ vring_used_event

#define vring_used_event (   vr)    ((vr)->avail->ring[(vr)->num])

◆ VRING_USED_F_NO_NOTIFY

#define VRING_USED_F_NO_NOTIFY   1

Function Documentation

◆ vring_init()

static void vring_init ( struct vring vr,
unsigned int  num,
uint8_t *  p,
unsigned long  align 
)
inlinestatic

◆ vring_need_event()

static int vring_need_event ( uint16_t  event_idx,
uint16_t  new_idx,
uint16_t  old 
)
inlinestatic

◆ vring_size()

static int vring_size ( unsigned int  num,
unsigned long  align 
)
inlinestatic

Variable Documentation

◆ METAL_PACKED_END

METAL_PACKED_BEGIN struct vring_used METAL_PACKED_END