Lines Matching refs:cq
903 static inline void __cq_init(struct circular_queue *cq) in __cq_init() argument
905 cq->front = cq->rear = 0; in __cq_init()
909 static inline int __cq_empty(struct circular_queue *cq) in __cq_empty() argument
911 return (cq->front == cq->rear); in __cq_empty()
914 static inline int __cq_full(struct circular_queue *cq) in __cq_full() argument
916 return ((cq->rear + 1) & CQ_MASK) == cq->front; in __cq_full()
919 static inline int __cq_enqueue(struct circular_queue *cq, unsigned long elem) in __cq_enqueue() argument
921 if (__cq_full(cq)) in __cq_enqueue()
924 cq->element[cq->rear] = elem; in __cq_enqueue()
925 cq->rear = (cq->rear + 1) & CQ_MASK; in __cq_enqueue()
929 static inline int __cq_dequeue(struct circular_queue *cq, unsigned long *elem) in __cq_dequeue() argument
931 if (__cq_empty(cq)) in __cq_dequeue()
934 *elem = cq->element[cq->front]; in __cq_dequeue()
935 cq->front = (cq->front + 1) & CQ_MASK; in __cq_dequeue()
939 static inline unsigned int __cq_get_elem_count(struct circular_queue *cq) in __cq_get_elem_count() argument
941 return (cq->rear - cq->front) & CQ_MASK; in __cq_get_elem_count()
989 struct circular_queue *cq = &lock_cq; in __bfs() local
1006 __cq_init(cq); in __bfs()
1007 __cq_enqueue(cq, (unsigned long)source_entry); in __bfs()
1009 while (!__cq_empty(cq)) { in __bfs()
1012 __cq_dequeue(cq, (unsigned long *)&lock); in __bfs()
1034 if (__cq_enqueue(cq, (unsigned long)entry)) { in __bfs()
1038 cq_depth = __cq_get_elem_count(cq); in __bfs()