Lines Matching +full:num +full:- +full:guest +full:- +full:ids

42 /* This marks a buffer as write-only (otherwise read-only). */
54 /* The Host uses this in used->flags to advise the Guest: don't kick me when
55 * you add a buffer. It's unreliable, so it's simply an optimization. Guest
58 /* The Guest uses this in avail->flags to advise the Host: don't interrupt me
83 /* The Guest publishes the used index for which it expects an interrupt
84 * at the end of the avail ring. Host should ignore the avail->flags field. */
86 * at the end of the used ring. Guest should ignore the used->flags field. */
90 * When using pre-virtio 1.0 layout, these fall out naturally.
97 * struct vring_desc - Virtio ring descriptors,
100 * @addr: buffer address (guest-physical)
120 /* u32 is used here for ids for padding reasons. */
139 * alignments assumptions. Thus, we might need to decrease the compiler-selected
143 * https://gcc.gnu.org/onlinedocs//gcc/Common-Type-Attributes.html#Common-Type-Attributes
159 unsigned int num; member
171 * like this. We assume num is a power of 2.
176 * struct vring_desc desc[num];
178 * // A ring of available descriptor heads with free-running index.
181 * __virtio16 available[num];
187 * // A ring of used descriptor heads with free-running index.
190 * struct vring_used_elem used[num];
196 #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
197 #define vring_avail_event(vr) (*(__virtio16 *)&(vr)->used->ring[(vr)->num])
199 static inline void vring_init(struct vring *vr, unsigned int num, void *p, in vring_init() argument
202 vr->num = num; in vring_init()
203 vr->desc = p; in vring_init()
204 vr->avail = (struct vring_avail *)((char *)p + num * sizeof(struct vring_desc)); in vring_init()
205 vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio16) in vring_init()
206 + align-1) & ~(align - 1)); in vring_init()
209 static inline unsigned vring_size(unsigned int num, unsigned long align) in vring_size() argument
211 return ((sizeof(struct vring_desc) * num + sizeof(__virtio16) * (3 + num) in vring_size()
212 + align - 1) & ~(align - 1)) in vring_size()
213 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num; in vring_size()
224 /* Note: Xen has similar logic for notification hold-off in vring_need_event()
229 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old); in vring_need_event()