summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/include/param.h38
-rw-r--r--sys/arm/include/param.h48
-rw-r--r--sys/i386/include/param.h48
-rw-r--r--sys/ia64/include/param.h45
-rw-r--r--sys/powerpc/include/param.h48
-rw-r--r--sys/sparc64/include/param.h41
-rw-r--r--sys/sys/param.h68
7 files changed, 68 insertions, 268 deletions
diff --git a/sys/alpha/include/param.h b/sys/alpha/include/param.h
index f32b749..444b8b7 100644
--- a/sys/alpha/include/param.h
+++ b/sys/alpha/include/param.h
@@ -116,16 +116,6 @@
#define KERNBASE 0xfffffc0000300000LL /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
-#endif
-#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
-#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
-#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
-
#define CLSIZE 1
#define CLSIZELOG2 0
@@ -139,34 +129,6 @@
#define KSTACK_GUARD /* compile in kstack guard page */
/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE.
- */
-#ifndef MSIZE
-#define MSIZE 256 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of a mbuf cluster */
-
-/* pages to bytes */
-#define ctob(x) ((x) << PAGE_SHIFT)
-#define btoc(x) (((x) + PAGE_MASK) >> PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
* Mach derived conversion macros
*/
#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK))
diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h
index 5a743cc..1fd9b60 100644
--- a/sys/arm/include/param.h
+++ b/sys/arm/include/param.h
@@ -100,58 +100,10 @@
#define KERNBASE 0x100000 /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1 << DEV_BSHIFT)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
-#endif
-#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
-#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
-#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
-
#define UPAGES 2 /* pages of u-area */
#define USPACE (UPAGES * PAGE_SIZE) /* total size of u-area */
/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE.
- */
-#ifndef MSIZE
-#define MSIZE 256 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* pages ("clicks") to bytes */
-#define ctob(x) ((x) << PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x) + PAGE_MASK) >> PAGE_SHIFT)
-
-/* bytes to disk blocks */
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
* Mach derived conversion macros
*/
#define trunc_page(x) ((x) & ~PAGE_MASK)
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index ba28cfb..f22c7ff 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -99,16 +99,6 @@
#define NBPDR (1<<PDRSHIFT) /* bytes/page dir */
#define PDRMASK (NBPDR-1)
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
-#endif
-#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
-#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
-#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
-
#define IOPAGES 2 /* pages of i/o permission bitmap */
#ifndef KSTACK_PAGES
@@ -133,44 +123,6 @@
#define VM_BCACHE_SIZE_MAX (200 * 1024 * 1024)
#endif
-
-/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE.
- */
-#ifndef MSIZE
-#define MSIZE 256 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x) ((x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
/*
* Mach derived conversion macros
*/
diff --git a/sys/ia64/include/param.h b/sys/ia64/include/param.h
index dff273e..cd8dd18 100644
--- a/sys/ia64/include/param.h
+++ b/sys/ia64/include/param.h
@@ -135,16 +135,6 @@
#define KERNBASE 0xfffffc0000300000LL /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
-#endif
-#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
-#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
-#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
-
#define CLSIZE 1
#define CLSIZELOG2 0
@@ -158,41 +148,6 @@
/* #define KSTACK_GUARD */ /* compile in kstack guard page */
/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE.
- */
-#ifndef MSIZE
-#define MSIZE 256 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of a mbuf cluster */
-
-/*
- * Size of kernel malloc arena in CLBYTES-sized logical pages
- */
-#ifndef NKMEMCLUSTERS
-#define NKMEMCLUSTERS (4096*1024/CLBYTES) /* XXX? */
-#endif
-
-/* pages to bytes */
-#define ctob(x) ((x) << PAGE_SHIFT)
-#define btoc(x) (((x) + PAGE_MASK) >> PAGE_SHIFT)
-
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
* Mach derived conversion macros
*/
#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK))
diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h
index 81bc3db..7969e4f 100644
--- a/sys/powerpc/include/param.h
+++ b/sys/powerpc/include/param.h
@@ -104,16 +104,6 @@
#define KERNBASE 0x100000 /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1 << DEV_BSHIFT)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
-#endif
-#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
-#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
-#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
-
#ifndef KSTACK_UPAGES
#define KSTACK_PAGES 4 /* includes pcb */
#define KSTACK_GUARD_PAGES 1
@@ -122,44 +112,6 @@
#define UAREA_PAGES 1 /* holds struct user WITHOUT PCB */
/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE.
- */
-#ifndef MSIZE
-#define MSIZE 256 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* pages ("clicks") to bytes */
-#define ctob(x) ((x) << PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned)(x) + PAGE_MASK) >> PAGE_SHIFT)
-
-/* bytes to disk blocks */
-/*
- * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
- * want to shift an unsigned type to avoid sign extension and we don't
- * want to widen `bytes' unnecessarily. Assume that the result fits in
- * a daddr_t.
- */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (sizeof (bytes) > sizeof(long) \
- ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
- : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
-
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- ((off_t)(db) << DEV_BSHIFT)
-
-/*
* Mach derived conversion macros
*/
#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK))
diff --git a/sys/sparc64/include/param.h b/sys/sparc64/include/param.h
index 36aef81..9532671 100644
--- a/sys/sparc64/include/param.h
+++ b/sys/sparc64/include/param.h
@@ -114,16 +114,6 @@
#define PAGE_SIZE_MAX PAGE_SIZE_4M
#define PAGE_MASK_MAX PAGE_MASK_4M
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1<<DEV_BSHIFT)
-
-#ifndef BLKDEV_IOSIZE
-#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
-#endif
-#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
-#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
-#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
-
#define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */
#define UAREA_PAGES 1 /* pages of user area */
#define PCPU_PAGES 1
@@ -132,37 +122,6 @@
#define KSTACK_GUARD_PAGES 1
/*
- * Constants related to network buffer management.
- * MCLBYTES must be no larger than PAGE_SIZE.
- */
-#ifndef MSIZE
-#define MSIZE 256 /* size of an mbuf */
-#endif /* MSIZE */
-
-#ifndef MCLSHIFT
-#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
-#endif /* MCLSHIFT */
-#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
-
-/*
- * Some macros for units conversion
- */
-
-/* clicks to bytes */
-#define ctob(x) ((unsigned long)(x)<<PAGE_SHIFT)
-
-/* bytes to clicks */
-#define btoc(x) (((unsigned long)(x)+PAGE_MASK)>>PAGE_SHIFT)
-
-/* bytes to disk blocks */
-#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
- (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)
-
-/* disk blocks to bytes */
-#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
- (off_t)((unsigned long)(db) << DEV_BSHIFT)
-
-/*
* Mach derived conversion macros
*/
#define round_page(x) (((unsigned long)(x) + PAGE_MASK) & ~PAGE_MASK)
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 05e3b07..ce87bc7 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -107,6 +107,74 @@
#include <machine/limits.h>
#endif
+#ifndef _NO_NAMESPACE_POLLUTION
+
+#ifndef DEV_BSHIFT
+#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
+#endif
+#define DEV_BSIZE (1<<DEV_BSHIFT)
+
+#ifndef BLKDEV_IOSIZE
+#define BLKDEV_IOSIZE PAGE_SIZE /* default block device I/O size */
+#endif
+#ifndef DFLTPHYS
+#define DFLTPHYS (64 * 1024) /* default max raw I/O transfer size */
+#endif
+#ifndef MAXPHYS
+#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */
+#endif
+#ifndef MAXDUMPPGS
+#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE)
+#endif
+
+/*
+ * Constants related to network buffer management.
+ * MCLBYTES must be no larger than PAGE_SIZE.
+ */
+#ifndef MSIZE
+#define MSIZE 256 /* size of an mbuf */
+#endif /* MSIZE */
+
+#ifndef MCLSHIFT
+#define MCLSHIFT 11 /* convert bytes to mbuf clusters */
+#endif /* MCLSHIFT */
+
+#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
+
+/*
+ * Some macros for units conversion
+ */
+
+/* clicks to bytes */
+#ifndef ctob
+#define ctob(x) ((x)<<PAGE_SHIFT)
+#endif
+
+/* bytes to clicks */
+#ifndef btoc
+#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
+#endif
+
+/*
+ * btodb() is messy and perhaps slow because `bytes' may be an off_t. We
+ * want to shift an unsigned type to avoid sign extension and we don't
+ * want to widen `bytes' unnecessarily. Assume that the result fits in
+ * a daddr_t.
+ */
+#ifndef btodb
+#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
+ (sizeof (bytes) > sizeof(long) \
+ ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
+ : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
+#endif
+
+#ifndef dbtob
+#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
+ ((off_t)(db) << DEV_BSHIFT)
+#endif
+
+#endif /* _NO_NAMESPACE_POLLUTION */
+
#define PRIMASK 0x0ff
#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
#define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */
OpenPOWER on IntegriCloud