summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-20 18:12:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-20 18:12:50 +0000
commita51bc804544ef1f0b2c7709e0578cd7d13e7afe5 (patch)
tree46740c8ffa3539991ac2ee1bd24a552aadb2edda
parent3a521b530625f0840ca5a4ab3c47e9287a7d9353 (diff)
Years ago, MSIZE had to be known in <sys/param.h> probably to allocate
memory for the mbuf layer up front. These days it only matters for sizing of macros in <sys/mbuf.h>, so move it there. MCLSHIFT, MCLBYTES, and MCLOFSET can move also (a decade ago, architectures had different mbuf sizes. you don't want to know more) ok guenther, ports fallout checked for by sthen
-rw-r--r--sys/sys/mbuf.h16
-rw-r--r--sys/sys/param.h18
2 files changed, 16 insertions, 18 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 22ff1e831e5..f5136e5995e 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.183 2014/10/03 01:02:47 dlg Exp $ */
+/* $OpenBSD: mbuf.h,v 1.184 2015/01/20 18:12:49 deraadt Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -39,6 +39,15 @@
#include <sys/queue.h>
/*
+ * Constants related to network buffer management.
+ * MCLBYTES must be no larger than PAGE_SIZE (the software page size) and,
+ * on machines that exchange pages of input or output buffers with mbuf
+ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
+ * of the hardware page size.
+ */
+#define MSIZE 256 /* size of an mbuf */
+
+/*
* Mbufs are of a single size, MSIZE (sys/param.h), which
* includes overhead. An mbuf may add a single "mbuf cluster" of size
* MCLBYTES (also in sys/param.h), which has no additional overhead
@@ -53,6 +62,11 @@
#define MINCLSIZE (MHLEN + MLEN + 1) /* smallest amount to put in cluster */
#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */
+#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
+ /* 2K cluster can hold Ether frame */
+#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
+#define MCLOFSET (MCLBYTES - 1)
+
/* Packet tags structure */
struct m_tag {
SLIST_ENTRY(m_tag) m_tag_link; /* List of packet tags */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index fe28564658d..f37af027152 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.113 2015/01/20 18:08:16 deraadt Exp $ */
+/* $OpenBSD: param.h,v 1.114 2015/01/20 18:12:49 deraadt Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -120,22 +120,6 @@
#define NODEV (dev_t)(-1) /* non-existent device */
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE (the software page size) and,
- * on machines that exchange pages of input or output buffers with mbuf
- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
- * of the hardware page size.
- */
-#define MSIZE 256 /* size of an mbuf */
-
-#ifdef _KERNEL
-#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
- /* 2K cluster can hold Ether frame */
-#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
-#define MCLOFSET (MCLBYTES - 1)
-#endif /* _KERNEL */
-
#define ALIGNBYTES _ALIGNBYTES
#define ALIGN(p) _ALIGN(p)
#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t)