• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/osfmk/kern/

Lines Matching defs:head

120 /* Enqueue element to head of queue */
130 /* Dequeue element from head of queue */
335 #define queue_enter(head, elt, type, field) \
339 __prev = (head)->prev; \
340 if ((head) == __prev) { \
341 (head)->next = (queue_entry_t) (elt); \
347 (elt)->field.next = head; \
348 (head)->prev = (queue_entry_t) elt; \
354 * Insert a new element at the head of the queue.
362 #define queue_enter_first(head, elt, type, field) \
366 __next = (head)->next; \
367 if ((head) == __next) { \
368 (head)->prev = (queue_entry_t) (elt); \
374 (elt)->field.prev = head; \
375 (head)->next = (queue_entry_t) elt; \
390 #define queue_insert_before(head, elt, cur, type, field) \
394 if ((head) == (queue_entry_t)(cur)) { \
395 (elt)->field.next = (head); \
396 if ((head)->next == (head)) { /* only element */ \
397 (elt)->field.prev = (head); \
398 (head)->next = (queue_entry_t)(elt); \
400 __prev = (elt)->field.prev = (head)->prev; \
403 (head)->prev = (queue_entry_t)(elt); \
406 if ((head)->next == (queue_entry_t)(cur)) { \
408 (elt)->field.prev = (head); \
409 (head)->next = (queue_entry_t)(elt); \
430 #define queue_insert_after(head, elt, cur, type, field) \
434 if ((head) == (queue_entry_t)(cur)) { \
435 (elt)->field.prev = (head); \
436 if ((head)->next == (head)) { /* only element */ \
437 (elt)->field.next = (head); \
438 (head)->prev = (queue_entry_t)(elt); \
440 __next = (elt)->field.next = (head)->next; \
443 (head)->next = (queue_entry_t)(elt); \
446 if ((head)->prev == (queue_entry_t)(cur)) { \
448 (elt)->field.next = (head); \
449 (head)->prev = (queue_entry_t)(elt); \
462 * given element (thing) in the given queue (head)
464 #define queue_field(head, thing, type, field) \
465 (((head) == (thing)) ? (head) : &((type)(thing))->field)
475 #define queue_remove(head, elt, type, field) \
482 if ((head) == __next) \
483 (head)->prev = __prev; \
487 if ((head) == __prev) \
488 (head)->next = __next; \
499 * Remove and return the entry at the head of
502 * queue_remove_first(head, entry, type, field)
505 #define queue_remove_first(head, entry, type, field) \
509 (entry) = (type) ((head)->next); \
512 if ((head) == __next) \
513 (head)->prev = (head); \
515 ((type)(__next))->field.prev = (head); \
516 (head)->next = __next; \
528 * queue_remove_last(head, entry, type, field)
531 #define queue_remove_last(head, entry, type, field) \
535 (entry) = (type) ((head)->prev); \
538 if ((head) == __prev) \
539 (head)->next = (head); \
541 ((type)(__prev))->field.next = (head); \
542 (head)->prev = __prev; \
561 * rebase old queue to new queue head
593 #define queue_iterate(head, elt, type, field) \
594 for ((elt) = (type) queue_first(head); \
595 !queue_end((head), (queue_entry_t)(elt)); \
607 struct queue_entry head; /* header for queue */
617 queue_init(&(q)->head); \
624 enqueue_tail(&(q)->head, elt); \
631 if (queue_empty(&(q)->head)) \
634 *(elt) = dequeue_head(&(q)->head); \