Lines Matching refs:q
86 void rxe_queue_reset(struct rxe_queue *q);
92 int rxe_queue_resize(struct rxe_queue *q,
104 static inline int next_index(struct rxe_queue *q, int index) in next_index() argument
106 return (index + 1) & q->buf->index_mask; in next_index()
109 static inline int queue_empty(struct rxe_queue *q) in queue_empty() argument
111 return ((q->buf->producer_index - q->buf->consumer_index) in queue_empty()
112 & q->index_mask) == 0; in queue_empty()
115 static inline int queue_full(struct rxe_queue *q) in queue_full() argument
117 return ((q->buf->producer_index + 1 - q->buf->consumer_index) in queue_full()
118 & q->index_mask) == 0; in queue_full()
121 static inline void advance_producer(struct rxe_queue *q) in advance_producer() argument
123 q->buf->producer_index = (q->buf->producer_index + 1) in advance_producer()
124 & q->index_mask; in advance_producer()
127 static inline void advance_consumer(struct rxe_queue *q) in advance_consumer() argument
129 q->buf->consumer_index = (q->buf->consumer_index + 1) in advance_consumer()
130 & q->index_mask; in advance_consumer()
133 static inline void *producer_addr(struct rxe_queue *q) in producer_addr() argument
135 return q->buf->data + ((q->buf->producer_index & q->index_mask) in producer_addr()
136 << q->log2_elem_size); in producer_addr()
139 static inline void *consumer_addr(struct rxe_queue *q) in consumer_addr() argument
141 return q->buf->data + ((q->buf->consumer_index & q->index_mask) in consumer_addr()
142 << q->log2_elem_size); in consumer_addr()
145 static inline unsigned int producer_index(struct rxe_queue *q) in producer_index() argument
147 return q->buf->producer_index; in producer_index()
150 static inline unsigned int consumer_index(struct rxe_queue *q) in consumer_index() argument
152 return q->buf->consumer_index; in consumer_index()
155 static inline void *addr_from_index(struct rxe_queue *q, unsigned int index) in addr_from_index() argument
157 return q->buf->data + ((index & q->index_mask) in addr_from_index()
158 << q->buf->log2_elem_size); in addr_from_index()
161 static inline unsigned int index_from_addr(const struct rxe_queue *q, in index_from_addr() argument
164 return (((u8 *)addr - q->buf->data) >> q->log2_elem_size) in index_from_addr()
165 & q->index_mask; in index_from_addr()
168 static inline unsigned int queue_count(const struct rxe_queue *q) in queue_count() argument
170 return (q->buf->producer_index - q->buf->consumer_index) in queue_count()
171 & q->index_mask; in queue_count()
174 static inline void *queue_head(struct rxe_queue *q) in queue_head() argument
176 return queue_empty(q) ? NULL : consumer_addr(q); in queue_head()