Lines Matching refs:head
105 f->head = 0; in msnd_fifo_alloc()
116 f->len = f->tail = f->head = 0; in msnd_fifo_make_empty()
127 if (f->head <= f->tail) { in msnd_fifo_write_io()
133 nwritten = f->head - f->tail; in msnd_fifo_write_io()
158 if (f->head <= f->tail) { in msnd_fifo_write()
164 nwritten = f->head - f->tail; in msnd_fifo_write()
189 if (f->tail <= f->head) { in msnd_fifo_read_io()
191 if (nread > f->n - f->head) in msnd_fifo_read_io()
192 nread = f->n - f->head; in msnd_fifo_read_io()
195 nread = f->tail - f->head; in msnd_fifo_read_io()
200 memcpy_toio(buf, f->data + f->head, nread); in msnd_fifo_read_io()
205 f->head += nread; in msnd_fifo_read_io()
206 f->head %= f->n; in msnd_fifo_read_io()
220 if (f->tail <= f->head) { in msnd_fifo_read()
222 if (nread > f->n - f->head) in msnd_fifo_read()
223 nread = f->n - f->head; in msnd_fifo_read()
226 nread = f->tail - f->head; in msnd_fifo_read()
231 memcpy(buf, f->data + f->head, nread); in msnd_fifo_read()
236 f->head += nread; in msnd_fifo_read()
237 f->head %= f->n; in msnd_fifo_read()