37#define VRING_DESC_F_NEXT 1
39#define VRING_DESC_F_WRITE 2
41#define VRING_DESC_F_INDIRECT 4
46#define VRING_USED_F_NO_NOTIFY 1
50#define VRING_AVAIL_F_NO_INTERRUPT 1
53#define VIRTIO_RING_F_INDIRECT_DESC 28
59#define VIRTIO_RING_F_EVENT_IDX 29
134#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
135#define vring_avail_event(vr) (*(uint16_t *)&(vr)->used->ring[(vr)->num])
144 + align-1) & ~(align - 1));
147static inline unsigned vring_size(
unsigned int num,
unsigned long align)
149 return ((
sizeof(
struct vring_desc) * num +
sizeof(uint16_t) * (3 + num)
150 + align - 1) & ~(align - 1))
165 return (uint16_t)(new_idx - event_idx - 1) < (uint16_t)(new_idx - old);
struct vring_used_elem ring[]
struct vring_avail * avail
static int vring_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old)
static unsigned vring_size(unsigned int num, unsigned long align)
static void vring_init(struct vring *vr, unsigned int num, void *p, unsigned long align)