Lines Matching +full:num +full:- +full:addresses
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
58 /* The Guest uses this in avail->flags to advise the Host: don't interrupt me
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.
98 /* Address (guest-physical). */
132 * The ring element addresses are passed between components with different
133 * alignments assumptions. Thus, we might need to decrease the compiler-selected
137 * https://gcc.gnu.org/onlinedocs//gcc/Common-Type-Attributes.html#Common-Type-Attributes
153 unsigned int num; member
165 * like this. We assume num is a power of 2.
170 * struct vring_desc desc[num];
172 * // A ring of available descriptor heads with free-running index.
175 * __virtio16 available[num];
181 * // A ring of used descriptor heads with free-running index.
184 * struct vring_used_elem used[num];
190 #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
191 #define vring_avail_event(vr) (*(__virtio16 *)&(vr)->used->ring[(vr)->num])
193 static inline void vring_init(struct vring *vr, unsigned int num, void *p, in vring_init() argument
196 vr->num = num; in vring_init()
197 vr->desc = p; in vring_init()
198 vr->avail = (struct vring_avail *)((char *)p + num * sizeof(struct vring_desc)); in vring_init()
199 vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio16) in vring_init()
200 + align-1) & ~(align - 1)); in vring_init()
203 static inline unsigned vring_size(unsigned int num, unsigned long align) in vring_size() argument
205 return ((sizeof(struct vring_desc) * num + sizeof(__virtio16) * (3 + num) in vring_size()
206 + align - 1) & ~(align - 1)) in vring_size()
207 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num; in vring_size()
218 /* Note: Xen has similar logic for notification hold-off in vring_need_event()
223 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old); in vring_need_event()