Lines Matching refs:elm

114 #define	QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)			\
118 #define QUEUEDEBUG_LIST_OP(elm, field) \
119 if ((elm)->field.le_next && \
120 (elm)->field.le_next->field.le_prev != \
121 &(elm)->field.le_next) \
122 panic("LIST_* forw %p %s:%d", (elm), __FILE__, __LINE__);\
123 if (*(elm)->field.le_prev != (elm)) \
124 panic("LIST_* back %p %s:%d", (elm), __FILE__, __LINE__);
125 #define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \
126 (elm)->field.le_next = (void *)1L; \
127 (elm)->field.le_prev = (void *)1L;
129 #define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)
130 #define QUEUEDEBUG_LIST_OP(elm, field)
131 #define QUEUEDEBUG_LIST_POSTREMOVE(elm, field)
139 #define LIST_INSERT_AFTER(listelm, elm, field) do { \
141 if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
143 &(elm)->field.le_next; \
144 (listelm)->field.le_next = (elm); \
145 (elm)->field.le_prev = &(listelm)->field.le_next; \
149 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \
151 (elm)->field.le_prev = (listelm)->field.le_prev; \
152 (elm)->field.le_next = (listelm); \
153 *(listelm)->field.le_prev = (elm); \
154 (listelm)->field.le_prev = &(elm)->field.le_next; \
158 #define LIST_INSERT_HEAD(head, elm, field) do { \
159 QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \
160 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
161 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
162 (head)->lh_first = (elm); \
163 (elm)->field.le_prev = &(head)->lh_first; \
167 #define LIST_REMOVE(elm, field) do { \
168 QUEUEDEBUG_LIST_OP((elm), field) \
169 if ((elm)->field.le_next != NULL) \
170 (elm)->field.le_next->field.le_prev = \
171 (elm)->field.le_prev; \
172 *(elm)->field.le_prev = (elm)->field.le_next; \
173 QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
187 #define LIST_NEXT(elm, field) ((elm)->field.le_next)
214 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
215 (elm)->field.sle_next = (slistelm)->field.sle_next; \
216 (slistelm)->field.sle_next = (elm); \
220 #define SLIST_INSERT_HEAD(head, elm, field) do { \
221 (elm)->field.sle_next = (head)->slh_first; \
222 (head)->slh_first = (elm); \
231 #define SLIST_REMOVE(head, elm, type, field) do { \
232 if ((head)->slh_first == (elm)) { \
237 while (curelm->field.sle_next != (elm)) \
253 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
282 #define STAILQ_INSERT_HEAD(head, elm, field) do { \
283 if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
284 (head)->stqh_last = &(elm)->field.stqe_next; \
285 (head)->stqh_first = (elm); \
289 #define STAILQ_INSERT_TAIL(head, elm, field) do { \
290 (elm)->field.stqe_next = NULL; \
291 *(head)->stqh_last = (elm); \
292 (head)->stqh_last = &(elm)->field.stqe_next; \
296 #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
297 if (((elm)->field.stqe_next = (listelm)->field.stqe_next) \
299 (head)->stqh_last = &(elm)->field.stqe_next; \
300 (listelm)->field.stqe_next = (elm); \
311 #define STAILQ_REMOVE(head, elm, type, field) do { \
312 if ((head)->stqh_first == (elm)) { \
316 while (curelm->field.stqe_next != (elm)) \
335 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
364 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
365 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
366 (head)->sqh_last = &(elm)->field.sqe_next; \
367 (head)->sqh_first = (elm); \
371 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
372 (elm)->field.sqe_next = NULL; \
373 *(head)->sqh_last = (elm); \
374 (head)->sqh_last = &(elm)->field.sqe_next; \
378 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
379 if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
380 (head)->sqh_last = &(elm)->field.sqe_next; \
381 (listelm)->field.sqe_next = (elm); \
391 #define SIMPLEQ_REMOVE(head, elm, type, field) do { \
392 if ((head)->sqh_first == (elm)) { \
396 while (curelm->field.sqe_next != (elm)) \
415 #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
442 #define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \
447 #define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \
451 #define QUEUEDEBUG_TAILQ_OP(elm, field) \
452 if ((elm)->field.tqe_next && \
453 (elm)->field.tqe_next->field.tqe_prev != \
454 &(elm)->field.tqe_next) \
455 panic("TAILQ_* forw %p %s:%d", (void *)(elm), \
457 if (*(elm)->field.tqe_prev != (elm)) \
458 panic("TAILQ_* back %p %s:%d", (void *)(elm), \
460 #define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
461 if ((elm)->field.tqe_next == NULL && \
462 (head)->tqh_last != &(elm)->field.tqe_next) \
463 panic("TAILQ_PREREMOVE head %p elm %p %s:%d", \
464 (void *)(head), (void *)(elm), __FILE__, __LINE__);
465 #define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
466 (elm)->field.tqe_next = (void *)1L; \
467 (elm)->field.tqe_prev = (void *)1L;
469 #define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
470 #define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
471 #define QUEUEDEBUG_TAILQ_OP(elm, field)
472 #define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
473 #define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
482 #define TAILQ_INSERT_HEAD(head, elm, field) do { \
483 QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \
484 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
486 &(elm)->field.tqe_next; \
488 (head)->tqh_last = &(elm)->field.tqe_next; \
489 (head)->tqh_first = (elm); \
490 (elm)->field.tqe_prev = &(head)->tqh_first; \
494 #define TAILQ_INSERT_TAIL(head, elm, field) do { \
495 QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \
496 (elm)->field.tqe_next = NULL; \
497 (elm)->field.tqe_prev = (head)->tqh_last; \
498 *(head)->tqh_last = (elm); \
499 (head)->tqh_last = &(elm)->field.tqe_next; \
503 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
505 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
506 (elm)->field.tqe_next->field.tqe_prev = \
507 &(elm)->field.tqe_next; \
509 (head)->tqh_last = &(elm)->field.tqe_next; \
510 (listelm)->field.tqe_next = (elm); \
511 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
515 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
517 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
518 (elm)->field.tqe_next = (listelm); \
519 *(listelm)->field.tqe_prev = (elm); \
520 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
524 #define TAILQ_REMOVE(head, elm, field) do { \
525 QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
526 QUEUEDEBUG_TAILQ_OP((elm), field) \
527 if (((elm)->field.tqe_next) != NULL) \
528 (elm)->field.tqe_next->field.tqe_prev = \
529 (elm)->field.tqe_prev; \
531 (head)->tqh_last = (elm)->field.tqe_prev; \
532 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
533 QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
553 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
557 #define TAILQ_PREV(elm, headname, field) \
558 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
588 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
589 (elm)->field.cqe_next = (listelm)->field.cqe_next; \
590 (elm)->field.cqe_prev = (listelm); \
592 (head)->cqh_last = (elm); \
594 (listelm)->field.cqe_next->field.cqe_prev = (elm); \
595 (listelm)->field.cqe_next = (elm); \
599 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
600 (elm)->field.cqe_next = (listelm); \
601 (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
603 (head)->cqh_first = (elm); \
605 (listelm)->field.cqe_prev->field.cqe_next = (elm); \
606 (listelm)->field.cqe_prev = (elm); \
610 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
611 (elm)->field.cqe_next = (head)->cqh_first; \
612 (elm)->field.cqe_prev = (void *)(head); \
614 (head)->cqh_last = (elm); \
616 (head)->cqh_first->field.cqe_prev = (elm); \
617 (head)->cqh_first = (elm); \
621 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
622 (elm)->field.cqe_next = (void *)(head); \
623 (elm)->field.cqe_prev = (head)->cqh_last; \
625 (head)->cqh_first = (elm); \
627 (head)->cqh_last->field.cqe_next = (elm); \
628 (head)->cqh_last = (elm); \
632 #define CIRCLEQ_REMOVE(head, elm, field) do { \
633 if ((elm)->field.cqe_next == (void *)(head)) \
634 (head)->cqh_last = (elm)->field.cqe_prev; \
636 (elm)->field.cqe_next->field.cqe_prev = \
637 (elm)->field.cqe_prev; \
638 if ((elm)->field.cqe_prev == (void *)(head)) \
639 (head)->cqh_first = (elm)->field.cqe_next; \
641 (elm)->field.cqe_prev->field.cqe_next = \
642 (elm)->field.cqe_next; \
662 #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
663 #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
665 #define CIRCLEQ_LOOP_NEXT(head, elm, field) \
666 (((elm)->field.cqe_next == (void *)(head)) \
668 : (elm->field.cqe_next))
669 #define CIRCLEQ_LOOP_PREV(head, elm, field) \
670 (((elm)->field.cqe_prev == (void *)(head)) \
672 : (elm->field.cqe_prev))