Lines Matching refs:head
101 unsigned head; in add_inbuf() local
111 head = (ring_size - 1) & (guest.avail_idx++); in add_inbuf()
113 head = guest.free_head; in add_inbuf()
118 desc[head].flags = VRING_DESC_F_NEXT; in add_inbuf()
119 desc[head].addr = (unsigned long)(void *)buf; in add_inbuf()
120 desc[head].len = len; in add_inbuf()
125 desc[head].flags &= ~VRING_DESC_F_NEXT; in add_inbuf()
127 guest.free_head = desc[head].next; in add_inbuf()
130 data[head].data = datap; in add_inbuf()
137 (head | (avail & ~(ring_size - 1))) ^ 0x8000; in add_inbuf()
143 ring.avail->ring[avail] = head; in add_inbuf()
154 unsigned head; in get_buf() local
159 head = (ring_size - 1) & guest.last_used_idx; in get_buf()
160 index = ring.used->ring[head].id; in get_buf()
172 head = (ring_size - 1) & guest.last_used_idx; in get_buf()
173 index = head; in get_buf()
175 head = (ring_size - 1) & guest.last_used_idx; in get_buf()
176 index = ring.used->ring[head].id; in get_buf()
183 *lenp = ring.used->ring[head].len; in get_buf()
201 unsigned short head = last_used_idx & (ring_size - 1); in used_empty() local
202 unsigned index = ring.used->ring[head].id; in used_empty()
260 unsigned head = host.used_idx; in avail_empty() local
262 unsigned index = ring.avail->ring[head & (ring_size - 1)]; in avail_empty()
264 return ((index ^ head ^ 0x8000) & ~(ring_size - 1)); in avail_empty()
266 return head == ring.avail->idx; in avail_empty()
274 unsigned head; in use_buf() local
277 head = ring.avail->ring[used_idx & (ring_size - 1)]; in use_buf()
278 if ((used_idx ^ head ^ 0x8000) & ~(ring_size - 1)) in use_buf()
284 desc = &ring.desc[head & (ring_size - 1)]; in use_buf()
294 head = used_idx; in use_buf()
296 head = ring.avail->ring[used_idx]; in use_buf()
298 desc = &ring.desc[head]; in use_buf()
308 ring.used->ring[used_idx].id = head; in use_buf()