summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-12-03 13:45:34 +0000
committerbde <bde@FreeBSD.org>1995-12-03 13:45:34 +0000
commit35ee95831939f06cb374e771e2a51cf938bff1fa (patch)
tree69c8a72f05bc71681c14faa7323ef938e23dadd8
parent754df9d25d89ae310e9795f92160d1aee988180b (diff)
downloadFreeBSD-src-35ee95831939f06cb374e771e2a51cf938bff1fa.zip
FreeBSD-src-35ee95831939f06cb374e771e2a51cf938bff1fa.tar.gz
Moved inline functions for insque() and remque() to <sys/queue.h>.
Protected them with `#ifdef KERNEL' so that <sys/queue.h> is valid C++. Added the necessary #includes of <sys/queue.h>. These functions are bogus and should be replaced by the queue macros.
-rw-r--r--sys/amd64/include/cpufunc.h34
-rw-r--r--sys/i386/include/cpufunc.h34
-rw-r--r--sys/net/raw_cb.c3
-rw-r--r--sys/netccitt/llc_subr.c3
-rw-r--r--sys/netccitt/pk_input.c3
-rw-r--r--sys/netccitt/pk_subr.c3
-rw-r--r--sys/netns/ns_pcb.c3
-rw-r--r--sys/netns/spp_usrreq.c3
-rw-r--r--sys/sys/queue.h51
9 files changed, 62 insertions, 75 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 1415042..11774bf 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.40 1995/08/26 20:45:59 bde Exp $
+ * $Id: cpufunc.h,v 1.41 1995/10/05 10:32:47 phk Exp $
*/
/*
@@ -296,35 +296,6 @@ write_eflags(u_long ef)
__asm __volatile("pushl %0; popfl" : : "r" (ef));
}
-/*
- * XXX queue stuff belongs elsewhere.
- */
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
#else /* !__GNUC__ */
int bdb __P((void));
@@ -348,9 +319,6 @@ u_long read_eflags __P((void));
u_long rcr2 __P((void));
void write_eflags __P((u_long ef));
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
#endif /* __GNUC__ */
/*
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 1415042..11774bf 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.40 1995/08/26 20:45:59 bde Exp $
+ * $Id: cpufunc.h,v 1.41 1995/10/05 10:32:47 phk Exp $
*/
/*
@@ -296,35 +296,6 @@ write_eflags(u_long ef)
__asm __volatile("pushl %0; popfl" : : "r" (ef));
}
-/*
- * XXX queue stuff belongs elsewhere.
- */
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
#else /* !__GNUC__ */
int bdb __P((void));
@@ -348,9 +319,6 @@ u_long read_eflags __P((void));
u_long rcr2 __P((void));
void write_eflags __P((u_long ef));
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
#endif /* __GNUC__ */
/*
diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c
index 274c546..0471e1c 100644
--- a/sys/net/raw_cb.c
+++ b/sys/net/raw_cb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)raw_cb.c 8.1 (Berkeley) 6/10/93
- * $Id: raw_cb.c,v 1.4 1995/05/30 08:08:21 rgrimes Exp $
+ * $Id: raw_cb.c,v 1.5 1995/07/29 11:40:59 bde Exp $
*/
#include <sys/param.h>
@@ -41,6 +41,7 @@
#include <sys/socketvar.h>
#include <sys/domain.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <sys/errno.h>
#include <net/if.h>
diff --git a/sys/netccitt/llc_subr.c b/sys/netccitt/llc_subr.c
index af5adb6..614df0f 100644
--- a/sys/netccitt/llc_subr.c
+++ b/sys/netccitt/llc_subr.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)llc_subr.c 8.1 (Berkeley) 6/10/93
- * $Id: llc_subr.c,v 1.5 1995/05/30 08:08:52 rgrimes Exp $
+ * $Id: llc_subr.c,v 1.6 1995/07/29 11:41:22 bde Exp $
*/
#include <sys/param.h>
@@ -46,6 +46,7 @@
#include <sys/domain.h>
#include <sys/socket.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <sys/socketvar.h>
#include <sys/errno.h>
#include <sys/time.h>
diff --git a/sys/netccitt/pk_input.c b/sys/netccitt/pk_input.c
index d783825..da8d71f 100644
--- a/sys/netccitt/pk_input.c
+++ b/sys/netccitt/pk_input.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)pk_input.c 8.1 (Berkeley) 6/10/93
- * $Id: pk_input.c,v 1.5 1995/05/30 08:08:59 rgrimes Exp $
+ * $Id: pk_input.c,v 1.6 1995/07/29 11:41:26 bde Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,7 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <sys/socketvar.h>
#include <sys/errno.h>
diff --git a/sys/netccitt/pk_subr.c b/sys/netccitt/pk_subr.c
index 4666c27..232c63a 100644
--- a/sys/netccitt/pk_subr.c
+++ b/sys/netccitt/pk_subr.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)pk_subr.c 8.1 (Berkeley) 6/10/93
- * $Id: pk_subr.c,v 1.4 1995/05/30 08:09:07 rgrimes Exp $
+ * $Id: pk_subr.c,v 1.5 1995/07/29 11:41:26 bde Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,7 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <sys/socketvar.h>
#include <sys/errno.h>
#include <sys/time.h>
diff --git a/sys/netns/ns_pcb.c b/sys/netns/ns_pcb.c
index 754c9fb..da840a7 100644
--- a/sys/netns/ns_pcb.c
+++ b/sys/netns/ns_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ns_pcb.c 8.1 (Berkeley) 6/10/93
- * $Id: ns_pcb.c,v 1.2 1994/08/02 07:51:52 davidg Exp $
+ * $Id: ns_pcb.c,v 1.3 1995/05/30 08:12:28 rgrimes Exp $
*/
#include <sys/param.h>
@@ -41,6 +41,7 @@
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <net/if.h>
#include <net/route.h>
diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c
index f0df56f..d2e554d 100644
--- a/sys/netns/spp_usrreq.c
+++ b/sys/netns/spp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)spp_usrreq.c 8.1 (Berkeley) 6/10/93
- * $Id: spp_usrreq.c,v 1.4 1995/05/30 08:12:31 rgrimes Exp $
+ * $Id: spp_usrreq.c,v 1.5 1995/07/29 11:41:59 bde Exp $
*/
#include <sys/param.h>
@@ -39,6 +39,7 @@
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/errno.h>
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 0c53c00..0501551 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -31,10 +31,10 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.4 (Berkeley) 1/4/94
- * $Id: queue.h,v 1.2 1994/08/02 07:53:25 davidg Exp $
+ * $Id: queue.h,v 1.3 1995/05/30 08:14:30 rgrimes Exp $
*/
-#ifndef _SYS_QUEUE_H_
+#ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_
/*
@@ -243,4 +243,49 @@ struct { \
(elm)->field.cqe_prev->field.cqe_next = \
(elm)->field.cqe_next; \
}
-#endif /* !_SYS_QUEUE_H_ */
+
+#ifdef KERNEL
+
+/*
+ * XXX insque() and remque() are an old way of handling certain queues.
+ * They bogusly assumes that all queue heads look alike.
+ */
+
+struct quehead {
+ struct quehead *qh_link;
+ struct quehead *qh_rlink;
+};
+
+#ifdef __GNUC__
+
+static __inline void
+insque(void *a, void *b)
+{
+ struct quehead *element = a, *head = b;
+
+ element->qh_link = head->qh_link;
+ element->qh_rlink = head;
+ head->qh_link = element;
+ element->qh_link->qh_rlink = element;
+}
+
+static __inline void
+remque(void *a)
+{
+ struct quehead *element = a;
+
+ element->qh_link->qh_rlink = element->qh_rlink;
+ element->qh_rlink->qh_link = element->qh_link;
+ element->qh_rlink = 0;
+}
+
+#else /* !__GNUC__ */
+
+void insque __P((void *a, void *b));
+void remque __P((void *a));
+
+#endif /* __GNUC__ */
+
+#endif /* KERNEL */
+
+#endif /* !_SYS_QUEUE_H_ */
OpenPOWER on IntegriCloud