Lines Matching refs:rb
33 static bool queue_is_empty(struct ring_buf *rb) in queue_is_empty() argument
39 if (rb->tail != rb->head) { in queue_is_empty()
53 static int queue_get(struct ring_buf *rb, void **mem_block, size_t *size) in queue_get() argument
59 if (queue_is_empty(rb) == true) { in queue_get()
64 *mem_block = rb->buf[rb->tail].mem_block; in queue_get()
65 *size = rb->buf[rb->tail].size; in queue_get()
66 MODULO_INC(rb->tail, rb->len); in queue_get()
76 static int queue_put(struct ring_buf *rb, void *mem_block, size_t size) in queue_put() argument
83 head_next = rb->head; in queue_put()
84 MODULO_INC(head_next, rb->len); in queue_put()
86 if (head_next == rb->tail) { in queue_put()
92 rb->buf[rb->head].mem_block = mem_block; in queue_put()
93 rb->buf[rb->head].size = size; in queue_put()
94 rb->head = head_next; in queue_put()