Lines Matching full:q

18  *   - The driver indices are always masked off to q->index_mask
26 * - By passing the type in the parameter list separate from q
76 void rxe_queue_reset(struct rxe_queue *q);
81 int rxe_queue_resize(struct rxe_queue *q, unsigned int *num_elem_p,
88 static inline u32 queue_next_index(struct rxe_queue *q, int index) in queue_next_index() argument
90 return (index + 1) & q->index_mask; in queue_next_index()
93 static inline u32 queue_get_producer(const struct rxe_queue *q, in queue_get_producer() argument
101 prod = smp_load_acquire(&q->buf->producer_index); in queue_get_producer()
104 prod = q->index; in queue_get_producer()
108 prod = smp_load_acquire(&q->buf->producer_index); in queue_get_producer()
111 prod = q->buf->producer_index; in queue_get_producer()
118 static inline u32 queue_get_consumer(const struct rxe_queue *q, in queue_get_consumer() argument
125 cons = q->index; in queue_get_consumer()
129 cons = smp_load_acquire(&q->buf->consumer_index); in queue_get_consumer()
132 cons = q->buf->consumer_index; in queue_get_consumer()
136 cons = smp_load_acquire(&q->buf->consumer_index); in queue_get_consumer()
143 static inline int queue_empty(struct rxe_queue *q, enum queue_type type) in queue_empty() argument
145 u32 prod = queue_get_producer(q, type); in queue_empty()
146 u32 cons = queue_get_consumer(q, type); in queue_empty()
148 return ((prod - cons) & q->index_mask) == 0; in queue_empty()
151 static inline int queue_full(struct rxe_queue *q, enum queue_type type) in queue_full() argument
153 u32 prod = queue_get_producer(q, type); in queue_full()
154 u32 cons = queue_get_consumer(q, type); in queue_full()
156 return ((prod + 1 - cons) & q->index_mask) == 0; in queue_full()
159 static inline u32 queue_count(const struct rxe_queue *q, in queue_count() argument
162 u32 prod = queue_get_producer(q, type); in queue_count()
163 u32 cons = queue_get_consumer(q, type); in queue_count()
165 return (prod - cons) & q->index_mask; in queue_count()
168 static inline void queue_advance_producer(struct rxe_queue *q, in queue_advance_producer() argument
179 prod = q->index; in queue_advance_producer()
180 prod = (prod + 1) & q->index_mask; in queue_advance_producer()
181 q->index = prod; in queue_advance_producer()
183 smp_store_release(&q->buf->producer_index, prod); in queue_advance_producer()
190 prod = q->buf->producer_index; in queue_advance_producer()
191 prod = (prod + 1) & q->index_mask; in queue_advance_producer()
192 q->buf->producer_index = prod; in queue_advance_producer()
197 static inline void queue_advance_consumer(struct rxe_queue *q, in queue_advance_consumer() argument
204 cons = q->index; in queue_advance_consumer()
205 cons = (cons + 1) & q->index_mask; in queue_advance_consumer()
206 q->index = cons; in queue_advance_consumer()
208 smp_store_release(&q->buf->consumer_index, cons); in queue_advance_consumer()
215 cons = q->buf->consumer_index; in queue_advance_consumer()
216 cons = (cons + 1) & q->index_mask; in queue_advance_consumer()
217 q->buf->consumer_index = cons; in queue_advance_consumer()
226 static inline void *queue_producer_addr(struct rxe_queue *q, in queue_producer_addr() argument
229 u32 prod = queue_get_producer(q, type); in queue_producer_addr()
231 return q->buf->data + (prod << q->log2_elem_size); in queue_producer_addr()
234 static inline void *queue_consumer_addr(struct rxe_queue *q, in queue_consumer_addr() argument
237 u32 cons = queue_get_consumer(q, type); in queue_consumer_addr()
239 return q->buf->data + (cons << q->log2_elem_size); in queue_consumer_addr()
242 static inline void *queue_addr_from_index(struct rxe_queue *q, u32 index) in queue_addr_from_index() argument
244 return q->buf->data + ((index & q->index_mask) in queue_addr_from_index()
245 << q->log2_elem_size); in queue_addr_from_index()
248 static inline u32 queue_index_from_addr(const struct rxe_queue *q, in queue_index_from_addr() argument
251 return (((u8 *)addr - q->buf->data) >> q->log2_elem_size) in queue_index_from_addr()
252 & q->index_mask; in queue_index_from_addr()
255 static inline void *queue_head(struct rxe_queue *q, enum queue_type type) in queue_head() argument
257 return queue_empty(q, type) ? NULL : queue_consumer_addr(q, type); in queue_head()