asf_queue.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. * Copyright (c) 1991, 1993
  3. * The Regents of the University of California. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 4. Neither the name of the University nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. *
  29. * @(#)queue.h 8.5 (Berkeley) 8/20/94
  30. * $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $
  31. * $Id: //depot/sw/branches/fusion_usb/target_firmware/magpie_fw_dev/asf/include/asf_queue.h#1 $
  32. */
  33. #ifndef _ASF_QUEUE_H_
  34. #define _ASF_QUEUE_H_
  35. /**
  36. * General purpose routines
  37. */
  38. #define asf_offsetof(type, member) ((adf_os_size_t) &((type *)0)->member)
  39. #define asf_containerof(ptr, type, member) ({ \
  40. const typeof( ((type *)0)->member ) *__lptr = (ptr); \
  41. (type *)( (char *)__mptr - asf_offsetof(type,member) );})
  42. /*
  43. * This file defines four types of data structures: singly-linked lists,
  44. * singly-linked tail queues, lists and tail queues.
  45. *
  46. * A singly-linked list is headed by a single forward pointer. The elements
  47. * are singly linked for minimum space and pointer manipulation overhead at
  48. * the expense of O(n) removal for arbitrary elements. New elements can be
  49. * added to the list after an existing element or at the head of the list.
  50. * Elements being removed from the head of the list should use the explicit
  51. * macro for this purpose for optimum efficiency. A singly-linked list may
  52. * only be traversed in the forward direction. Singly-linked lists are ideal
  53. * for applications with large datasets and few or no removals or for
  54. * implementing a LIFO queue.
  55. *
  56. * A singly-linked tail queue is headed by a pair of pointers, one to the
  57. * head of the list and the other to the tail of the list. The elements are
  58. * singly linked for minimum space and pointer manipulation overhead at the
  59. * expense of O(n) removal for arbitrary elements. New elements can be added
  60. * to the list after an existing element, at the head of the list, or at the
  61. * end of the list. Elements being removed from the head of the tail queue
  62. * should use the explicit macro for this purpose for optimum efficiency.
  63. * A singly-linked tail queue may only be traversed in the forward direction.
  64. * Singly-linked tail queues are ideal for applications with large datasets
  65. * and few or no removals or for implementing a FIFO queue.
  66. *
  67. * A list is headed by a single forward pointer (or an array of forward
  68. * pointers for a hash table header). The elements are doubly linked
  69. * so that an arbitrary element can be removed without a need to
  70. * traverse the list. New elements can be added to the list before
  71. * or after an existing element or at the head of the list. A list
  72. * may only be traversed in the forward direction.
  73. *
  74. * A tail queue is headed by a pair of pointers, one to the head of the
  75. * list and the other to the tail of the list. The elements are doubly
  76. * linked so that an arbitrary element can be removed without a need to
  77. * traverse the list. New elements can be added to the list before or
  78. * after an existing element, at the head of the list, or at the end of
  79. * the list. A tail queue may be traversed in either direction.
  80. *
  81. * For details on the use of these macros, see the queue(3) manual page.
  82. *
  83. *
  84. * asf_slist asf_list asf_stailq asf_tailq
  85. * _head + + + +
  86. * _head_initializer + + + +
  87. * _entry + + + +
  88. * _init + + + +
  89. * _empty + + + +
  90. * _first + + + +
  91. * _next + + + +
  92. * _prev - - - +
  93. * _last - - + +
  94. * _foreach + + + +
  95. * _foreach_safe + + + +
  96. * _foreach_reverse - - - +
  97. * _foreach_reverse_safe - - - +
  98. * _insert_head + + + +
  99. * _insert_before - + - +
  100. * _insert_after + + + +
  101. * _insert_tail - - + +
  102. * _concat - - + +
  103. * _remove_head + - + -
  104. * _remove + + + +
  105. *
  106. */
  107. #define QUEUE_MACRO_DEBUG 0
  108. #if QUEUE_MACRO_DEBUG
  109. /* Store the last 2 places the queue element or head was altered */
  110. struct asf_qm_trace {
  111. char * lastfile;
  112. int lastline;
  113. char * prevfile;
  114. int prevline;
  115. };
  116. #define TRACEBUF struct asf_qm_trace trace
  117. #define trashit(x) do {(x) = (void *)-1;} while (0)
  118. #define qmd_trace_head(head) do { \
  119. (head)->trace.prevline = (head)->trace.lastline; \
  120. (head)->trace.prevfile = (head)->trace.lastfile; \
  121. (head)->trace.lastline = __LINE__; \
  122. (head)->trace.lastfile = __FILE__; \
  123. } while (0)
  124. #define qmd_trace_elem(elem) do { \
  125. (elem)->trace.prevline = (elem)->trace.lastline; \
  126. (elem)->trace.prevfile = (elem)->trace.lastfile; \
  127. (elem)->trace.lastline = __LINE__; \
  128. (elem)->trace.lastfile = __FILE__; \
  129. } while (0)
  130. #else
  131. #define qmd_trace_elem(elem)
  132. #define qmd_trace_head(head)
  133. #define TRACEBUF
  134. #define trashit(x)
  135. #endif /* QUEUE_MACRO_DEBUG */
  136. /*
  137. * Singly-linked List declarations.
  138. */
  139. #define asf_slist_head(name, type) \
  140. struct name { \
  141. struct type *slh_first; /* first element */ \
  142. }
  143. #define asf_slist_head_initializer(head) \
  144. { NULL }
  145. #define asf_slist_entry(type) \
  146. struct { \
  147. struct type *sle_next; /* next element */ \
  148. }
  149. /*
  150. * Singly-linked List functions.
  151. */
  152. #define asf_slist_empty(head) ((head)->slh_first == NULL)
  153. #define asf_slist_first(head) ((head)->slh_first)
  154. #define asf_slist_foreach(var, head, field) \
  155. for ((var) = asf_slist_first((head)); \
  156. (var); \
  157. (var) = asf_slist_next((var), field))
  158. #define asf_slist_foreach_safe(var, head, field, tvar) \
  159. for ((var) = asf_slist_first((head)); \
  160. (var) && ((tvar) = asf_slist_next((var), field), 1); \
  161. (var) = (tvar))
  162. #define asf_slist_foreach_prevptr(var, varp, head, field) \
  163. for ((varp) = &asf_slist_first((head)); \
  164. ((var) = *(varp)) != NULL; \
  165. (varp) = &asf_slist_next((var), field))
  166. #define asf_slist_init(head) do { \
  167. asf_slist_first((head)) = NULL; \
  168. } while (0)
  169. #define asf_slist_insert_after(slistelm, elm, field) do { \
  170. asf_slist_next((elm), field) = asf_slist_next((slistelm), field); \
  171. asf_slist_next((slistelm), field) = (elm); \
  172. } while (0)
  173. #define asf_slist_insert_head(head, elm, field) do { \
  174. asf_slist_next((elm), field) = asf_slist_first((head)); \
  175. asf_slist_first((head)) = (elm); \
  176. } while (0)
  177. #define asf_slist_next(elm, field) ((elm)->field.sle_next)
  178. #define asf_slist_remove(head, elm, type, field) do { \
  179. if (asf_slist_first((head)) == (elm)) { \
  180. asf_slist_remove_head((head), field); \
  181. } \
  182. else { \
  183. struct type *curelm = asf_slist_first((head)); \
  184. while (asf_slist_next(curelm, field) != (elm)) \
  185. curelm = asf_slist_next(curelm, field); \
  186. asf_slist_next(curelm, field) = \
  187. asf_slist_next(asf_slist_next(curelm, field), field); \
  188. } \
  189. } while (0)
  190. #define asf_slist_remove_head(head, field) do { \
  191. asf_slist_first((head)) = asf_slist_next(asf_slist_first((head)), field); \
  192. } while (0)
  193. /*
  194. * Singly-linked Tail queue declarations.
  195. */
  196. #define asf_stailq_head(name, type) \
  197. struct name { \
  198. struct type *stqh_first;/* first element */ \
  199. struct type **stqh_last;/* addr of last next element */ \
  200. }
  201. #define asf_stailq_head_initializer(head) \
  202. { NULL, &(head).stqh_first }
  203. #define asf_stailq_entry(type) \
  204. struct { \
  205. struct type *stqe_next; /* next element */ \
  206. }
  207. /*
  208. * Singly-linked Tail queue functions.
  209. */
  210. #define asf_stailq_concat(head1, head2) do { \
  211. if (!asf_stailq_empty((head2))) { \
  212. *(head1)->stqh_last = (head2)->stqh_first; \
  213. (head1)->stqh_last = (head2)->stqh_last; \
  214. asf_stailq_init((head2)); \
  215. } \
  216. } while (0)
  217. #define asf_stailq_empty(head) ((head)->stqh_first == NULL)
  218. #define asf_stailq_first(head) ((head)->stqh_first)
  219. #define asf_stailq_foreach(var, head, field) \
  220. for((var) = asf_stailq_first((head)); \
  221. (var); \
  222. (var) = asf_stailq_next((var), field))
  223. #define asf_stailq_foreach_safe(var, head, field, tvar) \
  224. for ((var) = asf_stailq_first((head)); \
  225. (var) && ((tvar) = asf_stailq_next((var), field), 1); \
  226. (var) = (tvar))
  227. #define asf_stailq_init(head) do { \
  228. asf_stailq_first((head)) = NULL; \
  229. (head)->stqh_last = &asf_stailq_first((head)); \
  230. } while (0)
  231. #define asf_stailq_insert_after(head, tqelm, elm, field) do { \
  232. if ((asf_stailq_next((elm), field) = asf_stailq_next((tqelm), field)) == NULL)\
  233. (head)->stqh_last = &asf_stailq_next((elm), field); \
  234. asf_stailq_next((tqelm), field) = (elm); \
  235. } while (0)
  236. #define asf_stailq_insert_head(head, elm, field) do { \
  237. if ((asf_stailq_next((elm), field) = asf_stailq_first((head))) == NULL) \
  238. (head)->stqh_last = &asf_stailq_next((elm), field); \
  239. asf_stailq_first((head)) = (elm); \
  240. } while (0)
  241. #define asf_stailq_insert_tail(head, elm, field) do { \
  242. asf_stailq_next((elm), field) = NULL; \
  243. *(head)->stqh_last = (elm); \
  244. (head)->stqh_last = &asf_stailq_next((elm), field); \
  245. } while (0)
  246. #define asf_stailq_last(head, type, field) \
  247. (asf_stailq_empty((head)) ? \
  248. NULL : \
  249. ((struct type *) \
  250. ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
  251. #define asf_stailq_next(elm, field) ((elm)->field.stqe_next)
  252. #define asf_stailq_remove(head, elm, type, field) do { \
  253. if (asf_stailq_first((head)) == (elm)) { \
  254. asf_stailq_remove_head((head), field); \
  255. } \
  256. else { \
  257. struct type *curelm = asf_stailq_first((head)); \
  258. while (asf_stailq_next(curelm, field) != (elm)) \
  259. curelm = asf_stailq_next(curelm, field); \
  260. if ((asf_stailq_next(curelm, field) = \
  261. asf_stailq_next(asf_stailq_next(curelm, field), field)) == NULL)\
  262. (head)->stqh_last = &asf_stailq_next((curelm), field);\
  263. } \
  264. } while (0)
  265. #define asf_stailq_remove_after(head, elm, field) do { \
  266. if (asf_stailq_next(elm, field)) { \
  267. if ((asf_stailq_next(elm, field) = \
  268. asf_stailq_next(asf_stailq_next(elm, field), field)) == NULL)\
  269. (head)->stqh_last = &asf_stailq_next((elm), field); \
  270. } \
  271. } while (0)
  272. #define asf_stailq_remove_head(head, field) do { \
  273. if ((asf_stailq_first((head)) = \
  274. asf_stailq_next(asf_stailq_first((head)), field)) == NULL) \
  275. (head)->stqh_last = &asf_stailq_first((head)); \
  276. } while (0)
  277. #define asf_stailq_remove_head_until(head, elm, field) do { \
  278. if ((asf_stailq_first((head)) = asf_stailq_next((elm), field)) == NULL) \
  279. (head)->stqh_last = &asf_stailq_first((head)); \
  280. } while (0)
  281. /*
  282. * List declarations.
  283. */
  284. #define asf_list_head(name, type) \
  285. struct name { \
  286. struct type *lh_first; /* first element */ \
  287. }
  288. #define asf_list_head_initializer(head) \
  289. { NULL }
  290. #define asf_list_entry(type) \
  291. struct { \
  292. struct type *le_next; /* next element */ \
  293. struct type **le_prev; /* address of previous next element */ \
  294. }
  295. /*
  296. * List functions.
  297. */
  298. #define asf_list_empty(head) ((head)->lh_first == NULL)
  299. #define asf_list_first(head) ((head)->lh_first)
  300. #define asf_list_foreach(var, head, field) \
  301. for ((var) = asf_list_first((head)); \
  302. (var); \
  303. (var) = asf_list_next((var), field))
  304. #define asf_list_foreach_safe(var, head, field, tvar) \
  305. for ((var) = asf_list_first((head)); \
  306. (var) && ((tvar) = asf_list_next((var), field), 1); \
  307. (var) = (tvar))
  308. #define asf_list_init(head) do { \
  309. asf_list_first((head)) = NULL; \
  310. } while (0)
  311. #define asf_list_insert_after(listelm, elm, field) do { \
  312. if ((asf_list_next((elm), field) = asf_list_next((listelm), field)) != NULL)\
  313. asf_list_next((listelm), field)->field.le_prev = \
  314. &asf_list_next((elm), field); \
  315. asf_list_next((listelm), field) = (elm); \
  316. (elm)->field.le_prev = &asf_list_next((listelm), field); \
  317. } while (0)
  318. #define asf_list_insert_before(listelm, elm, field) do { \
  319. (elm)->field.le_prev = (listelm)->field.le_prev; \
  320. asf_list_next((elm), field) = (listelm); \
  321. *(listelm)->field.le_prev = (elm); \
  322. (listelm)->field.le_prev = &asf_list_next((elm), field); \
  323. } while (0)
  324. #define asf_list_insert_head(head, elm, field) do { \
  325. if ((asf_list_next((elm), field) = asf_list_first((head))) != NULL) \
  326. asf_list_first((head))->field.le_prev = &asf_list_next((elm), field);\
  327. asf_list_first((head)) = (elm); \
  328. (elm)->field.le_prev = &asf_list_first((head)); \
  329. } while (0)
  330. #define asf_list_next(elm, field) ((elm)->field.le_next)
  331. #define asf_list_remove(elm, field) do { \
  332. if (asf_list_next((elm), field) != NULL) \
  333. asf_list_next((elm), field)->field.le_prev = \
  334. (elm)->field.le_prev; \
  335. *(elm)->field.le_prev = asf_list_next((elm), field); \
  336. } while (0)
  337. /*
  338. * Tail queue declarations.
  339. */
  340. #define asf_tailq_head(name, type) \
  341. struct name { \
  342. struct type *tqh_first; /* first element */ \
  343. struct type **tqh_last; /* addr of last next element */ \
  344. TRACEBUF; \
  345. }
  346. #define asf_tailq_head_initializer(head) \
  347. { NULL, &(head).tqh_first }
  348. #define asf_tailq_entry(type) \
  349. struct { \
  350. struct type *tqe_next; /* next element */ \
  351. struct type **tqe_prev; /* address of previous next element */ \
  352. TRACEBUF; \
  353. }
  354. /*
  355. * Tail queue functions.
  356. */
  357. #define asf_tailq_concat(head1, head2, field) do { \
  358. if (!asf_tailq_empty(head2)) { \
  359. *(head1)->tqh_last = (head2)->tqh_first; \
  360. (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
  361. (head1)->tqh_last = (head2)->tqh_last; \
  362. asf_tailq_init((head2)); \
  363. qmd_trace_head(head); \
  364. qmd_trace_head(head2); \
  365. } \
  366. } while (0)
  367. #define asf_tailq_empty(head) ((head)->tqh_first == NULL)
  368. #define asf_tailq_first(head) ((head)->tqh_first)
  369. #define asf_tailq_foreach(var, head, field) \
  370. for ((var) = asf_tailq_first((head)); \
  371. (var); \
  372. (var) = asf_tailq_next((var), field))
  373. #define asf_tailq_foreach_safe(var, head, field, tvar) \
  374. for ((var) = asf_tailq_first((head)); \
  375. (var) && ((tvar) = asf_tailq_next((var), field), 1); \
  376. (var) = (tvar))
  377. #define asf_tailq_foreach_reverse(var, head, headname, field) \
  378. for ((var) = asf_tailq_last((head), headname); \
  379. (var); \
  380. (var) = asf_tailq_prev((var), headname, field))
  381. #define asf_tailq_foreach_reverse_safe(var, head, headname, field, tvar) \
  382. for ((var) = asf_tailq_last((head), headname); \
  383. (var) && ((tvar) = asf_tailq_prev((var), headname, field), 1); \
  384. (var) = (tvar))
  385. #define asf_tailq_init(head) do { \
  386. asf_tailq_first((head)) = NULL; \
  387. (head)->tqh_last = &asf_tailq_first((head)); \
  388. qmd_trace_head(head); \
  389. } while (0)
  390. #define asf_tailq_insert_after(head, listelm, elm, field) do { \
  391. if ((asf_tailq_next((elm), field) = asf_tailq_next((listelm), field)) != NULL)\
  392. asf_tailq_next((elm), field)->field.tqe_prev = \
  393. &asf_tailq_next((elm), field); \
  394. else { \
  395. (head)->tqh_last = &asf_tailq_next((elm), field); \
  396. qmd_trace_head(head); \
  397. } \
  398. asf_tailq_next((listelm), field) = (elm); \
  399. (elm)->field.tqe_prev = &asf_tailq_next((listelm), field); \
  400. qmd_trace_elem(&(elm)->field); \
  401. qmd_trace_elem(&listelm->field); \
  402. } while (0)
  403. #define asf_tailq_insert_before(listelm, elm, field) do { \
  404. (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
  405. asf_tailq_next((elm), field) = (listelm); \
  406. *(listelm)->field.tqe_prev = (elm); \
  407. (listelm)->field.tqe_prev = &asf_tailq_next((elm), field); \
  408. qmd_trace_elem(&(elm)->field); \
  409. qmd_trace_elem(&listelm->field); \
  410. } while (0)
  411. #define asf_tailq_insert_head(head, elm, field) do { \
  412. if ((asf_tailq_next((elm), field) = asf_tailq_first((head))) != NULL) \
  413. asf_tailq_first((head))->field.tqe_prev = \
  414. &asf_tailq_next((elm), field); \
  415. else \
  416. (head)->tqh_last = &asf_tailq_next((elm), field); \
  417. asf_tailq_first((head)) = (elm); \
  418. (elm)->field.tqe_prev = &asf_tailq_first((head)); \
  419. qmd_trace_head(head); \
  420. qmd_trace_elem(&(elm)->field); \
  421. } while (0)
  422. #define asf_tailq_insert_tail(head, elm, field) do { \
  423. asf_tailq_next((elm), field) = NULL; \
  424. (elm)->field.tqe_prev = (head)->tqh_last; \
  425. *(head)->tqh_last = (elm); \
  426. (head)->tqh_last = &asf_tailq_next((elm), field); \
  427. qmd_trace_head(head); \
  428. qmd_trace_elem(&(elm)->field); \
  429. } while (0)
  430. #define asf_tailq_last(head, headname) \
  431. (*(((struct headname *)((head)->tqh_last))->tqh_last))
  432. #define asf_tailq_next(elm, field) ((elm)->field.tqe_next)
  433. #define asf_tailq_prev(elm, headname, field) \
  434. (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
  435. #define asf_tailq_remove(head, elm, field) do { \
  436. if ((asf_tailq_next((elm), field)) != NULL) \
  437. asf_tailq_next((elm), field)->field.tqe_prev = \
  438. (elm)->field.tqe_prev; \
  439. else { \
  440. (head)->tqh_last = (elm)->field.tqe_prev; \
  441. qmd_trace_head(head); \
  442. } \
  443. *(elm)->field.tqe_prev = asf_tailq_next((elm), field); \
  444. trashit((elm)->field.tqe_next); \
  445. trashit((elm)->field.tqe_prev); \
  446. qmd_trace_elem(&(elm)->field); \
  447. } while (0)
  448. #ifdef _KERNEL
  449. /*
  450. * XXX asf_insque() and remque() are an old way of handling certain queues.
  451. * They bogusly assumes that all queue heads look alike.
  452. */
  453. struct asf_qhead {
  454. struct asf_qhead *qh_link;
  455. struct asf_qhead *qh_rlink;
  456. };
  457. #if defined(__GNUC__) || defined(__INTEL_COMPILER)
  458. static __inline void
  459. asf_insque(void *a, void *b)
  460. {
  461. struct asf_qhead *element = (struct asf_qhead *)a,
  462. *head = (struct asf_qhead *)b;
  463. element->qh_link = head->qh_link;
  464. element->qh_rlink = head;
  465. head->qh_link = element;
  466. element->qh_link->qh_rlink = element;
  467. }
  468. static __inline void
  469. asf_remque(void *a)
  470. {
  471. struct asf_qhead *element = (struct asf_qhead *)a;
  472. element->qh_link->qh_rlink = element->qh_rlink;
  473. element->qh_rlink->qh_link = element->qh_link;
  474. element->qh_rlink = 0;
  475. }
  476. #else /* !(__GNUC__ || __INTEL_COMPILER) */
  477. void asf_insque(void *a, void *b);
  478. void asf_remque(void *a);
  479. #endif /* __GNUC__ || __INTEL_COMPILER */
  480. #endif /* _KERNEL */
  481. #endif /* !_ASF_QUEUE_H_ */