Lines Matching full:q
56 void rxe_queue_reset(struct rxe_queue *q);
62 int rxe_queue_resize(struct rxe_queue *q, unsigned int *num_elem_p,
72 static inline int next_index(struct rxe_queue *q, int index) in next_index() argument
74 return (index + 1) & q->buf->index_mask; in next_index()
77 static inline int queue_empty(struct rxe_queue *q) in queue_empty() argument
79 return ((q->buf->producer_index - q->buf->consumer_index) in queue_empty()
80 & q->index_mask) == 0; in queue_empty()
83 static inline int queue_full(struct rxe_queue *q) in queue_full() argument
85 return ((q->buf->producer_index + 1 - q->buf->consumer_index) in queue_full()
86 & q->index_mask) == 0; in queue_full()
89 static inline void advance_producer(struct rxe_queue *q) in advance_producer() argument
91 q->buf->producer_index = (q->buf->producer_index + 1) in advance_producer()
92 & q->index_mask; in advance_producer()
95 static inline void advance_consumer(struct rxe_queue *q) in advance_consumer() argument
97 q->buf->consumer_index = (q->buf->consumer_index + 1) in advance_consumer()
98 & q->index_mask; in advance_consumer()
101 static inline void *producer_addr(struct rxe_queue *q) in producer_addr() argument
103 return q->buf->data + ((q->buf->producer_index & q->index_mask) in producer_addr()
104 << q->log2_elem_size); in producer_addr()
107 static inline void *consumer_addr(struct rxe_queue *q) in consumer_addr() argument
109 return q->buf->data + ((q->buf->consumer_index & q->index_mask) in consumer_addr()
110 << q->log2_elem_size); in consumer_addr()
113 static inline unsigned int producer_index(struct rxe_queue *q) in producer_index() argument
115 return q->buf->producer_index; in producer_index()
118 static inline unsigned int consumer_index(struct rxe_queue *q) in consumer_index() argument
120 return q->buf->consumer_index; in consumer_index()
123 static inline void *addr_from_index(struct rxe_queue *q, unsigned int index) in addr_from_index() argument
125 return q->buf->data + ((index & q->index_mask) in addr_from_index()
126 << q->buf->log2_elem_size); in addr_from_index()
129 static inline unsigned int index_from_addr(const struct rxe_queue *q, in index_from_addr() argument
132 return (((u8 *)addr - q->buf->data) >> q->log2_elem_size) in index_from_addr()
133 & q->index_mask; in index_from_addr()
136 static inline unsigned int queue_count(const struct rxe_queue *q) in queue_count() argument
138 return (q->buf->producer_index - q->buf->consumer_index) in queue_count()
139 & q->index_mask; in queue_count()
142 static inline void *queue_head(struct rxe_queue *q) in queue_head() argument
144 return queue_empty(q) ? NULL : consumer_addr(q); in queue_head()