1*7c478bd9Sstevel@tonic-gate /* BSDI $Id: queue.h,v 2.4 1996/07/02 13:22:11 bostic Exp $ */ 2*7c478bd9Sstevel@tonic-gate 3*7c478bd9Sstevel@tonic-gate /* 4*7c478bd9Sstevel@tonic-gate * Copyright (c) 1991, 1993 5*7c478bd9Sstevel@tonic-gate * The Regents of the University of California. All rights reserved. 6*7c478bd9Sstevel@tonic-gate * 7*7c478bd9Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without 8*7c478bd9Sstevel@tonic-gate * modification, are permitted provided that the following conditions 9*7c478bd9Sstevel@tonic-gate * are met: 10*7c478bd9Sstevel@tonic-gate * 1. Redistributions of source code must retain the above copyright 11*7c478bd9Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer. 12*7c478bd9Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright 13*7c478bd9Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in the 14*7c478bd9Sstevel@tonic-gate * documentation and/or other materials provided with the distribution. 15*7c478bd9Sstevel@tonic-gate * 3. All advertising materials mentioning features or use of this software 16*7c478bd9Sstevel@tonic-gate * must display the following acknowledgement: 17*7c478bd9Sstevel@tonic-gate * This product includes software developed by the University of 18*7c478bd9Sstevel@tonic-gate * California, Berkeley and its contributors. 19*7c478bd9Sstevel@tonic-gate * 4. Neither the name of the University nor the names of its contributors 20*7c478bd9Sstevel@tonic-gate * may be used to endorse or promote products derived from this software 21*7c478bd9Sstevel@tonic-gate * without specific prior written permission. 22*7c478bd9Sstevel@tonic-gate * 23*7c478bd9Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24*7c478bd9Sstevel@tonic-gate * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25*7c478bd9Sstevel@tonic-gate * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26*7c478bd9Sstevel@tonic-gate * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27*7c478bd9Sstevel@tonic-gate * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28*7c478bd9Sstevel@tonic-gate * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29*7c478bd9Sstevel@tonic-gate * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30*7c478bd9Sstevel@tonic-gate * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31*7c478bd9Sstevel@tonic-gate * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32*7c478bd9Sstevel@tonic-gate * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33*7c478bd9Sstevel@tonic-gate * SUCH DAMAGE. 34*7c478bd9Sstevel@tonic-gate * 35*7c478bd9Sstevel@tonic-gate * @(#)queue.h 8.5 (Berkeley) 8/20/94 36*7c478bd9Sstevel@tonic-gate * %W% (Sun) %G% 37*7c478bd9Sstevel@tonic-gate */ 38*7c478bd9Sstevel@tonic-gate /* 39*7c478bd9Sstevel@tonic-gate * Copyright (c) 1998 by Sun Microsystems, Inc. 40*7c478bd9Sstevel@tonic-gate * All rights reserved. 41*7c478bd9Sstevel@tonic-gate */ 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate #ifndef _SYS_QUEUE_H_ 44*7c478bd9Sstevel@tonic-gate #define _SYS_QUEUE_H_ 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate /* 47*7c478bd9Sstevel@tonic-gate * This file defines three types of data structures: lists, tail queues, 48*7c478bd9Sstevel@tonic-gate * and circular queues. 49*7c478bd9Sstevel@tonic-gate * 50*7c478bd9Sstevel@tonic-gate * A list is headed by a single forward pointer (or an array of forward 51*7c478bd9Sstevel@tonic-gate * pointers for a hash table header). The elements are doubly linked 52*7c478bd9Sstevel@tonic-gate * so that an arbitrary element can be removed without a need to 53*7c478bd9Sstevel@tonic-gate * traverse the list. New elements can be added to the list before 54*7c478bd9Sstevel@tonic-gate * or after an existing element or at the head of the list. A list 55*7c478bd9Sstevel@tonic-gate * may only be traversed in the forward direction. 56*7c478bd9Sstevel@tonic-gate * 57*7c478bd9Sstevel@tonic-gate * A tail queue is headed by a pair of pointers, one to the head of the 58*7c478bd9Sstevel@tonic-gate * list and the other to the tail of the list. The elements are doubly 59*7c478bd9Sstevel@tonic-gate * linked so that an arbitrary element can be removed without a need to 60*7c478bd9Sstevel@tonic-gate * traverse the list. New elements can be added to the list before or 61*7c478bd9Sstevel@tonic-gate * after an existing element, at the head of the list, or at the end of 62*7c478bd9Sstevel@tonic-gate * the list. A tail queue may only be traversed in the forward direction. 63*7c478bd9Sstevel@tonic-gate * 64*7c478bd9Sstevel@tonic-gate * A circle queue is headed by a pair of pointers, one to the head of the 65*7c478bd9Sstevel@tonic-gate * list and the other to the tail of the list. The elements are doubly 66*7c478bd9Sstevel@tonic-gate * linked so that an arbitrary element can be removed without a need to 67*7c478bd9Sstevel@tonic-gate * traverse the list. New elements can be added to the list before or after 68*7c478bd9Sstevel@tonic-gate * an existing element, at the head of the list, or at the end of the list. 69*7c478bd9Sstevel@tonic-gate * A circle queue may be traversed in either direction, but has a more 70*7c478bd9Sstevel@tonic-gate * complex end of list detection. 71*7c478bd9Sstevel@tonic-gate * 72*7c478bd9Sstevel@tonic-gate * For details on the use of these macros, see the queue(3) manual page. 73*7c478bd9Sstevel@tonic-gate */ 74*7c478bd9Sstevel@tonic-gate 75*7c478bd9Sstevel@tonic-gate /* 76*7c478bd9Sstevel@tonic-gate * List definitions. 77*7c478bd9Sstevel@tonic-gate */ 78*7c478bd9Sstevel@tonic-gate #define LIST_HEAD(name, type) \ 79*7c478bd9Sstevel@tonic-gate struct name { \ 80*7c478bd9Sstevel@tonic-gate struct type *lh_first; /* first element */ \ 81*7c478bd9Sstevel@tonic-gate } 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate #define LIST_ENTRY(type) \ 84*7c478bd9Sstevel@tonic-gate struct { \ 85*7c478bd9Sstevel@tonic-gate struct type *le_next; /* next element */ \ 86*7c478bd9Sstevel@tonic-gate struct type **le_prev; /* address of previous next element */ \ 87*7c478bd9Sstevel@tonic-gate } 88*7c478bd9Sstevel@tonic-gate 89*7c478bd9Sstevel@tonic-gate #define LIST_FIRST(head) ((head)->lh_first) 90*7c478bd9Sstevel@tonic-gate #define LIST_NEXT(elm, field) ((elm)->field.le_next) 91*7c478bd9Sstevel@tonic-gate #define LIST_END(head) NULL 92*7c478bd9Sstevel@tonic-gate 93*7c478bd9Sstevel@tonic-gate /* 94*7c478bd9Sstevel@tonic-gate * List functions. 95*7c478bd9Sstevel@tonic-gate */ 96*7c478bd9Sstevel@tonic-gate #define LIST_INIT(head) { \ 97*7c478bd9Sstevel@tonic-gate (head)->lh_first = NULL; \ 98*7c478bd9Sstevel@tonic-gate } 99*7c478bd9Sstevel@tonic-gate 100*7c478bd9Sstevel@tonic-gate #define LIST_INSERT_AFTER(listelm, elm, field) do { \ 101*7c478bd9Sstevel@tonic-gate if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ 102*7c478bd9Sstevel@tonic-gate (listelm)->field.le_next->field.le_prev = \ 103*7c478bd9Sstevel@tonic-gate &(elm)->field.le_next; \ 104*7c478bd9Sstevel@tonic-gate (listelm)->field.le_next = (elm); \ 105*7c478bd9Sstevel@tonic-gate (elm)->field.le_prev = &(listelm)->field.le_next; \ 106*7c478bd9Sstevel@tonic-gate } while (0) 107*7c478bd9Sstevel@tonic-gate 108*7c478bd9Sstevel@tonic-gate #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ 109*7c478bd9Sstevel@tonic-gate (elm)->field.le_prev = (listelm)->field.le_prev; \ 110*7c478bd9Sstevel@tonic-gate (elm)->field.le_next = (listelm); \ 111*7c478bd9Sstevel@tonic-gate *(listelm)->field.le_prev = (elm); \ 112*7c478bd9Sstevel@tonic-gate (listelm)->field.le_prev = &(elm)->field.le_next; \ 113*7c478bd9Sstevel@tonic-gate } while (0) 114*7c478bd9Sstevel@tonic-gate 115*7c478bd9Sstevel@tonic-gate #define LIST_INSERT_HEAD(head, elm, field) do { \ 116*7c478bd9Sstevel@tonic-gate if (((elm)->field.le_next = (head)->lh_first) != NULL) \ 117*7c478bd9Sstevel@tonic-gate (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ 118*7c478bd9Sstevel@tonic-gate (head)->lh_first = (elm); \ 119*7c478bd9Sstevel@tonic-gate (elm)->field.le_prev = &(head)->lh_first; \ 120*7c478bd9Sstevel@tonic-gate } while (0) 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate #define LIST_REMOVE(elm, field) do { \ 123*7c478bd9Sstevel@tonic-gate if ((elm)->field.le_next != NULL) \ 124*7c478bd9Sstevel@tonic-gate (elm)->field.le_next->field.le_prev = \ 125*7c478bd9Sstevel@tonic-gate (elm)->field.le_prev; \ 126*7c478bd9Sstevel@tonic-gate *(elm)->field.le_prev = (elm)->field.le_next; \ 127*7c478bd9Sstevel@tonic-gate } while (0) 128*7c478bd9Sstevel@tonic-gate 129*7c478bd9Sstevel@tonic-gate /* 130*7c478bd9Sstevel@tonic-gate * Tail queue definitions. 131*7c478bd9Sstevel@tonic-gate */ 132*7c478bd9Sstevel@tonic-gate #define TAILQ_HEAD(name, type) \ 133*7c478bd9Sstevel@tonic-gate struct name { \ 134*7c478bd9Sstevel@tonic-gate struct type *tqh_first; /* first element */ \ 135*7c478bd9Sstevel@tonic-gate struct type **tqh_last; /* addr of last next element */ \ 136*7c478bd9Sstevel@tonic-gate } 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate #define TAILQ_ENTRY(type) \ 139*7c478bd9Sstevel@tonic-gate struct { \ 140*7c478bd9Sstevel@tonic-gate struct type *tqe_next; /* next element */ \ 141*7c478bd9Sstevel@tonic-gate struct type **tqe_prev; /* address of previous next element */ \ 142*7c478bd9Sstevel@tonic-gate } 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gate #define TAILQ_FIRST(head) ((head)->tqh_first) 145*7c478bd9Sstevel@tonic-gate #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) 146*7c478bd9Sstevel@tonic-gate #define TAILQ_END(head) NULL 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate /* 149*7c478bd9Sstevel@tonic-gate * Tail queue functions. 150*7c478bd9Sstevel@tonic-gate */ 151*7c478bd9Sstevel@tonic-gate #define TAILQ_INIT(head) do { \ 152*7c478bd9Sstevel@tonic-gate (head)->tqh_first = NULL; \ 153*7c478bd9Sstevel@tonic-gate (head)->tqh_last = &(head)->tqh_first; \ 154*7c478bd9Sstevel@tonic-gate } while (0) 155*7c478bd9Sstevel@tonic-gate 156*7c478bd9Sstevel@tonic-gate #define TAILQ_INSERT_HEAD(head, elm, field) do { \ 157*7c478bd9Sstevel@tonic-gate if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ 158*7c478bd9Sstevel@tonic-gate (head)->tqh_first->field.tqe_prev = \ 159*7c478bd9Sstevel@tonic-gate &(elm)->field.tqe_next; \ 160*7c478bd9Sstevel@tonic-gate else \ 161*7c478bd9Sstevel@tonic-gate (head)->tqh_last = &(elm)->field.tqe_next; \ 162*7c478bd9Sstevel@tonic-gate (head)->tqh_first = (elm); \ 163*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_prev = &(head)->tqh_first; \ 164*7c478bd9Sstevel@tonic-gate } while (0) 165*7c478bd9Sstevel@tonic-gate 166*7c478bd9Sstevel@tonic-gate #define TAILQ_INSERT_TAIL(head, elm, field) do { \ 167*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_next = NULL; \ 168*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_prev = (head)->tqh_last; \ 169*7c478bd9Sstevel@tonic-gate *(head)->tqh_last = (elm); \ 170*7c478bd9Sstevel@tonic-gate (head)->tqh_last = &(elm)->field.tqe_next; \ 171*7c478bd9Sstevel@tonic-gate } while (0) 172*7c478bd9Sstevel@tonic-gate 173*7c478bd9Sstevel@tonic-gate #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ 174*7c478bd9Sstevel@tonic-gate if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ 175*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_next->field.tqe_prev = \ 176*7c478bd9Sstevel@tonic-gate &(elm)->field.tqe_next; \ 177*7c478bd9Sstevel@tonic-gate else \ 178*7c478bd9Sstevel@tonic-gate (head)->tqh_last = &(elm)->field.tqe_next; \ 179*7c478bd9Sstevel@tonic-gate (listelm)->field.tqe_next = (elm); \ 180*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ 181*7c478bd9Sstevel@tonic-gate } while (0) 182*7c478bd9Sstevel@tonic-gate 183*7c478bd9Sstevel@tonic-gate #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ 184*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ 185*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_next = (listelm); \ 186*7c478bd9Sstevel@tonic-gate *(listelm)->field.tqe_prev = (elm); \ 187*7c478bd9Sstevel@tonic-gate (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ 188*7c478bd9Sstevel@tonic-gate } while (0) 189*7c478bd9Sstevel@tonic-gate 190*7c478bd9Sstevel@tonic-gate #define TAILQ_REMOVE(head, elm, field) do { \ 191*7c478bd9Sstevel@tonic-gate if (((elm)->field.tqe_next) != NULL) \ 192*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_next->field.tqe_prev = \ 193*7c478bd9Sstevel@tonic-gate (elm)->field.tqe_prev; \ 194*7c478bd9Sstevel@tonic-gate else \ 195*7c478bd9Sstevel@tonic-gate (head)->tqh_last = (elm)->field.tqe_prev; \ 196*7c478bd9Sstevel@tonic-gate *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ 197*7c478bd9Sstevel@tonic-gate } while (0) 198*7c478bd9Sstevel@tonic-gate 199*7c478bd9Sstevel@tonic-gate /* 200*7c478bd9Sstevel@tonic-gate * Circular queue definitions. 201*7c478bd9Sstevel@tonic-gate */ 202*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_HEAD(name, type) \ 203*7c478bd9Sstevel@tonic-gate struct name { \ 204*7c478bd9Sstevel@tonic-gate struct type *cqh_first; /* first element */ \ 205*7c478bd9Sstevel@tonic-gate struct type *cqh_last; /* last element */ \ 206*7c478bd9Sstevel@tonic-gate } 207*7c478bd9Sstevel@tonic-gate 208*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_ENTRY(type) \ 209*7c478bd9Sstevel@tonic-gate struct { \ 210*7c478bd9Sstevel@tonic-gate struct type *cqe_next; /* next element */ \ 211*7c478bd9Sstevel@tonic-gate struct type *cqe_prev; /* previous element */ \ 212*7c478bd9Sstevel@tonic-gate } 213*7c478bd9Sstevel@tonic-gate 214*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_FIRST(head) ((head)->cqh_first) 215*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_LAST(head) ((head)->cqh_last) 216*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_END(head) ((void *)(head)) 217*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) 218*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate /* 221*7c478bd9Sstevel@tonic-gate * Circular queue functions. 222*7c478bd9Sstevel@tonic-gate */ 223*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_INIT(head) do { \ 224*7c478bd9Sstevel@tonic-gate (head)->cqh_first = (void *)(head); \ 225*7c478bd9Sstevel@tonic-gate (head)->cqh_last = (void *)(head); \ 226*7c478bd9Sstevel@tonic-gate } while (0) 227*7c478bd9Sstevel@tonic-gate 228*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ 229*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_next = (listelm)->field.cqe_next; \ 230*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_prev = (listelm); \ 231*7c478bd9Sstevel@tonic-gate if ((listelm)->field.cqe_next == (void *)(head)) \ 232*7c478bd9Sstevel@tonic-gate (head)->cqh_last = (elm); \ 233*7c478bd9Sstevel@tonic-gate else \ 234*7c478bd9Sstevel@tonic-gate (listelm)->field.cqe_next->field.cqe_prev = (elm); \ 235*7c478bd9Sstevel@tonic-gate (listelm)->field.cqe_next = (elm); \ 236*7c478bd9Sstevel@tonic-gate } while (0) 237*7c478bd9Sstevel@tonic-gate 238*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ 239*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_next = (listelm); \ 240*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ 241*7c478bd9Sstevel@tonic-gate if ((listelm)->field.cqe_prev == (void *)(head)) \ 242*7c478bd9Sstevel@tonic-gate (head)->cqh_first = (elm); \ 243*7c478bd9Sstevel@tonic-gate else \ 244*7c478bd9Sstevel@tonic-gate (listelm)->field.cqe_prev->field.cqe_next = (elm); \ 245*7c478bd9Sstevel@tonic-gate (listelm)->field.cqe_prev = (elm); \ 246*7c478bd9Sstevel@tonic-gate } while (0) 247*7c478bd9Sstevel@tonic-gate 248*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ 249*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_next = (head)->cqh_first; \ 250*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_prev = (void *)(head); \ 251*7c478bd9Sstevel@tonic-gate if ((head)->cqh_last == (void *)(head)) \ 252*7c478bd9Sstevel@tonic-gate (head)->cqh_last = (elm); \ 253*7c478bd9Sstevel@tonic-gate else \ 254*7c478bd9Sstevel@tonic-gate (head)->cqh_first->field.cqe_prev = (elm); \ 255*7c478bd9Sstevel@tonic-gate (head)->cqh_first = (elm); \ 256*7c478bd9Sstevel@tonic-gate } while (0) 257*7c478bd9Sstevel@tonic-gate 258*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ 259*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_next = (void *)(head); \ 260*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_prev = (head)->cqh_last; \ 261*7c478bd9Sstevel@tonic-gate if ((head)->cqh_first == (void *)(head)) \ 262*7c478bd9Sstevel@tonic-gate (head)->cqh_first = (elm); \ 263*7c478bd9Sstevel@tonic-gate else \ 264*7c478bd9Sstevel@tonic-gate (head)->cqh_last->field.cqe_next = (elm); \ 265*7c478bd9Sstevel@tonic-gate (head)->cqh_last = (elm); \ 266*7c478bd9Sstevel@tonic-gate } while (0) 267*7c478bd9Sstevel@tonic-gate 268*7c478bd9Sstevel@tonic-gate #define CIRCLEQ_REMOVE(head, elm, field) do { \ 269*7c478bd9Sstevel@tonic-gate if ((elm)->field.cqe_next == (void *)(head)) \ 270*7c478bd9Sstevel@tonic-gate (head)->cqh_last = (elm)->field.cqe_prev; \ 271*7c478bd9Sstevel@tonic-gate else \ 272*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_next->field.cqe_prev = \ 273*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_prev; \ 274*7c478bd9Sstevel@tonic-gate if ((elm)->field.cqe_prev == (void *)(head)) \ 275*7c478bd9Sstevel@tonic-gate (head)->cqh_first = (elm)->field.cqe_next; \ 276*7c478bd9Sstevel@tonic-gate else \ 277*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_prev->field.cqe_next = \ 278*7c478bd9Sstevel@tonic-gate (elm)->field.cqe_next; \ 279*7c478bd9Sstevel@tonic-gate } while (0) 280*7c478bd9Sstevel@tonic-gate #endif /* !_SYS_QUEUE_H_ */ 281