Index: sys/sys/_callout.h =================================================================== --- sys/sys/_callout.h +++ sys/sys/_callout.h @@ -42,10 +42,6 @@ struct lock_object; -LIST_HEAD(callout_list, callout); -SLIST_HEAD(callout_slist, callout); -TAILQ_HEAD(callout_tailq, callout); - struct callout { union { LIST_ENTRY(callout) le; @@ -62,4 +58,8 @@ volatile int c_cpu; /* CPU we're scheduled on */ }; +LIST_HEAD(callout_list, callout); +SLIST_HEAD(callout_slist, callout); +TAILQ_HEAD(callout_tailq, callout); + #endif Index: sys/sys/proc.h =================================================================== --- sys/sys/proc.h +++ sys/sys/proc.h @@ -164,6 +164,7 @@ struct kaudit_record; struct kdtrace_proc; struct kdtrace_thread; +struct ktr_request; struct mqueue_notifier; struct nlminfo; struct p_sched; Index: sys/sys/queue.h =================================================================== --- sys/sys/queue.h +++ sys/sys/queue.h @@ -143,12 +143,18 @@ #define TRASHIT(x) #endif /* QUEUE_MACRO_DEBUG */ +#ifdef __cplusplus +#define __sys_queue_struct +#else +#define __sys_queue_struct struct +#endif + /* * Singly-linked List declarations. */ #define SLIST_HEAD(name, type) \ struct name { \ - struct type *slh_first; /* first element */ \ + __sys_queue_struct type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ @@ -156,7 +162,7 @@ #define SLIST_ENTRY(type) \ struct { \ - struct type *sle_next; /* next element */ \ + __sys_queue_struct type *sle_next; /* next element */ \ } /* @@ -213,7 +219,7 @@ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ - struct type *curelm = SLIST_FIRST((head)); \ + __sys_queue_struct type *curelm = SLIST_FIRST((head)); \ while (SLIST_NEXT(curelm, field) != (elm)) \ curelm = SLIST_NEXT(curelm, field); \ SLIST_REMOVE_AFTER(curelm, field); \ @@ -231,7 +237,7 @@ } while (0) #define SLIST_SWAP(head1, head2, type) do { \ - struct type *swap_first = SLIST_FIRST(head1); \ + __sys_queue_struct type *swap_first = SLIST_FIRST(head1); \ SLIST_FIRST(head1) = SLIST_FIRST(head2); \ SLIST_FIRST(head2) = swap_first; \ } while (0) @@ -241,8 +247,8 @@ */ #define STAILQ_HEAD(name, type) \ struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ + __sys_queue_struct type *stqh_first;/* first element */ \ + __sys_queue_struct type **stqh_last;/* addr of last next element */ \ } #define STAILQ_HEAD_INITIALIZER(head) \ @@ -250,7 +256,7 @@ #define STAILQ_ENTRY(type) \ struct { \ - struct type *stqe_next; /* next element */ \ + __sys_queue_struct type *stqe_next; /* next element */ \ } /* @@ -313,7 +319,8 @@ #define STAILQ_LAST(head, type, field) \ (STAILQ_EMPTY((head)) ? NULL : \ - __containerof((head)->stqh_last, struct type, field.stqe_next)) + __containerof((head)->stqh_last, __sys_queue_struct type, \ + field.stqe_next)) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) @@ -323,7 +330,7 @@ STAILQ_REMOVE_HEAD((head), field); \ } \ else { \ - struct type *curelm = STAILQ_FIRST((head)); \ + __sys_queue_struct type *curelm = STAILQ_FIRST((head)); \ while (STAILQ_NEXT(curelm, field) != (elm)) \ curelm = STAILQ_NEXT(curelm, field); \ STAILQ_REMOVE_AFTER(head, curelm, field); \ @@ -344,8 +351,8 @@ } while (0) #define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ + __sys_queue_struct type *swap_first = STAILQ_FIRST(head1); \ + __sys_queue_struct type **swap_last = (head1)->stqh_last; \ STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_FIRST(head2) = swap_first; \ @@ -362,7 +369,7 @@ */ #define LIST_HEAD(name, type) \ struct name { \ - struct type *lh_first; /* first element */ \ + __sys_queue_struct type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ @@ -370,8 +377,9 @@ #define LIST_ENTRY(type) \ struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ + __sys_queue_struct type *le_next; /* next element */ \ + __sys_queue_struct type **le_prev; /* address of previous \ + * next element */ \ } /* @@ -460,7 +468,8 @@ #define LIST_PREV(elm, head, type, field) \ ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ - __containerof((elm)->field.le_prev, struct type, field.le_next)) + __containerof((elm)->field.le_prev, __sys_queue_struct type,\ + field.le_next)) #define LIST_REMOVE(elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.le_next); \ @@ -476,7 +485,7 @@ } while (0) #define LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = LIST_FIRST((head1)); \ + __sys_queue_struct type *swap_tmp = LIST_FIRST((head1)); \ LIST_FIRST((head1)) = LIST_FIRST((head2)); \ LIST_FIRST((head2)) = swap_tmp; \ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ @@ -490,8 +499,9 @@ */ #define TAILQ_HEAD(name, type) \ struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ + __sys_queue_struct type *tqh_first; /* first element */ \ + __sys_queue_struct type **tqh_last; /* addr of last \ + * next element */ \ TRACEBUF \ } @@ -500,8 +510,9 @@ #define TAILQ_ENTRY(type) \ struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ + __sys_queue_struct type *tqe_next; /* next element */ \ + __sys_queue_struct type **tqe_prev; /* address of previous \ + * next element */ \ TRACEBUF \ } @@ -675,8 +686,8 @@ } while (0) #define TAILQ_SWAP(head1, head2, type, field) do { \ - struct type *swap_first = (head1)->tqh_first; \ - struct type **swap_last = (head1)->tqh_last; \ + __sys_queue_struct type *swap_first = (head1)->tqh_first; \ + __sys_queue_struct type **swap_last = (head1)->tqh_last; \ (head1)->tqh_first = (head2)->tqh_first; \ (head1)->tqh_last = (head2)->tqh_last; \ (head2)->tqh_first = swap_first; \ @@ -691,4 +702,6 @@ (head2)->tqh_last = &(head2)->tqh_first; \ } while (0) +#undef __sys_queue_struct + #endif /* !_SYS_QUEUE_H_ */ Index: sys/sys/socketvar.h =================================================================== --- sys/sys/socketvar.h +++ sys/sys/socketvar.h @@ -58,6 +58,7 @@ typedef u_quad_t so_gen_t; struct socket; +struct aiocblist; /*- * Locking key to struct socket: