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
129 #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
130 #define vring_avail_event(vr) (*(uint16_t *)&(vr)->used->ring[(vr)->num])
139 + align-1) & ~(align - 1));
142 static inline unsigned vring_size(
unsigned int num,
unsigned long align)
144 return ((
sizeof(
struct vring_desc) * num +
sizeof(uint16_t) * (3 + num)
145 + align - 1) & ~(align - 1))
160 return (uint16_t)(new_idx - event_idx - 1) < (uint16_t)(new_idx - old);
static int vring_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old)
struct vring_avail * avail
struct vring_used_elem ring[]
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)