summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-10-22 19:43:01 +0000
committerphk <phk@FreeBSD.org>2000-10-22 19:43:01 +0000
commit7db5793b7f5fa7716616953eab087fd10f0a2fe4 (patch)
treeea076593557c7ae1c90684927d5629eb08323b57 /sys/sys
parentf6d29697e120dfa64b93e94751cd6806c703a219 (diff)
downloadFreeBSD-src-7db5793b7f5fa7716616953eab087fd10f0a2fe4.zip
FreeBSD-src-7db5793b7f5fa7716616953eab087fd10f0a2fe4.tar.gz
Don't bogusly include <struct.h>
Bogusly define our own versions of strbase() and fldoff() until we have sorted out where they live in the kernel.
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/queue.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index ece552b..ee66759 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -37,8 +37,6 @@
#ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_
-#include <struct.h>
-
/*
* This file defines five types of data structures: singly-linked lists,
* singly-linked tail queues, lists, tail queues, and circular queues.
@@ -111,6 +109,18 @@
*/
/*
+ * XXX: temporary, we need to find the real home of these.
+ */
+
+/* Offset of the field in the structure. */
+#define __qfldoff(name, field) \
+ ((int)&(((struct name *)0)->field))
+
+/* Address of the structure from a field. */
+#define __qstrbase(name, addr, field) \
+ ((struct name *)((char *)(addr) - __qfldoff(name, field)))
+
+/*
* Singly-linked List declarations.
*/
#define SLIST_HEAD(name, type) \
@@ -226,7 +236,7 @@ struct { \
#define STAILQ_LAST(head, type, field) \
(STAILQ_EMPTY(head) ? \
NULL : \
- strbase(type, (head)->stqh_last, field))
+ __qstrbase(type, (head)->stqh_last, field))
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
OpenPOWER on IntegriCloud