summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/queue.addendum.h
blob: 9252342d797e67f350eab24d9327e6faceb32fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* These definitions are taken from the NetBSD /sys/sys/queue.h file
 * The copyright as in /sys/sys/queue.h from FreeBSD applies (they are the same)
 */

/* This was called SIMPLEQ
 */
#ifndef STAILQ_HEAD_INITIALIZER
#define STAILQ_HEAD_INITIALIZER(head)                                   \
        { NULL, &(head).stqh_first }
#endif

/* This one was called SIMPLEQ_REMOVE_HEAD but removes not only the
 * head element, but a whole queue of elements from the head.
 */
#ifndef STAILQ_REMOVE_HEAD_QUEUE
#define STAILQ_REMOVE_HEAD_QUEUE(head, elm, field) do {                      \
      if (((head)->stqh_first = (elm)->field.stqe_next) == NULL)      \
              (head)->stqh_last = &(head)->stqh_first;                \
} while (0)
#endif


/* This is called LIST and was called like that as well in the NetBSD version
 */
#ifndef LIST_HEAD_INITIALIZER
#define LIST_HEAD_INITIALIZER(head)                                   \
      { NULL }
#endif

OpenPOWER on IntegriCloud