summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-03-23 16:12:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-03-23 16:12:32 +0000
commit73c9f13809997febbf178be4123a0352ee8b8312 (patch)
tree4a514d179014528fcaa112abb942d619dc1ae9ca /sys/arch/mips64
parent3ea8990ba9276efe1c2bbde129074f8dd9b8c992 (diff)
refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is added
to keep definitions our of user space. The MD files now follow a consistant order -- all namespace intrusion is at the tail can be cleaned up independently. locore, bootblocks, and libkvm still see enough visibility to build. Checked on 90% of platforms...
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/include/param.h53
1 files changed, 18 insertions, 35 deletions
diff --git a/sys/arch/mips64/include/param.h b/sys/arch/mips64/include/param.h
index 3347a9042fe..d22b5415a8b 100644
--- a/sys/arch/mips64/include/param.h
+++ b/sys/arch/mips64/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.30 2011/09/08 03:40:32 guenther Exp $ */
+/* $OpenBSD: param.h,v 1.31 2013/03/23 16:12:25 deraadt Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -32,13 +32,10 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * from: Utah Hdr: machparam.h 1.11 89/08/14
- * from: @(#)param.h 8.1 (Berkeley) 6/10/93
*/
-#ifndef _MIPS64_PARAM_H_
-#define _MIPS64_PARAM_H_
+#ifndef _MIPS64_PARAM_H_
+#define _MIPS64_PARAM_H_
#ifdef _KERNEL
#include <machine/cpu.h>
@@ -48,60 +45,46 @@
#define ALIGN(p) _ALIGN(p)
#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t)
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#define PAGE_MASK (PAGE_SIZE - 1)
-
-#define NBPG PAGE_SIZE
-#define PGOFSET PAGE_MASK
+#define PAGE_SIZE (1 << PAGE_SHIFT)
+#define PAGE_MASK (PAGE_SIZE - 1)
#define PGSHIFT PAGE_SHIFT
+#define PGOFSET PAGE_MASK
#define KERNBASE 0xffffffff80000000L /* start of kernel virtual */
-#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
-#define DEV_BSIZE (1 << DEV_BSHIFT)
-#define BLKDEV_IOSIZE 2048
-#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
-
-#define USPACE (16384)
#ifdef _KERNEL
+
+#define NBPG PAGE_SIZE
+
+#define USPACE 16384
#define UPAGES (USPACE >> PAGE_SHIFT)
#if PAGE_SHIFT > 12
#define USPACE_ALIGN 0
#else
#define USPACE_ALIGN (2 * PAGE_SIZE) /* align to an even TLB boundary */
#endif
-#endif /* _KERNEL */
-/*
- * Constants related to network buffer management.
- */
#define NMBCLUSTERS 4096 /* map size, max cluster allocation */
-#ifdef _KERNEL
+#ifndef MSGBUFSIZE
#if PAGE_SHIFT > 12
#define MSGBUFSIZE PAGE_SIZE
#else
#define MSGBUFSIZE 8192
#endif
+#endif
-/* Default malloc arena size */
-#define NKMEMPAGES_MIN_DEFAULT ((8 * 1024 * 1024) >> PAGE_SHIFT)
+/*
+ * Maximum size of the kernel malloc arena in PAGE_SIZE-sized
+ * logical pages.
+ */
#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
-#endif /* _KERNEL */
-
-/* pages ("clicks") to disk blocks */
-#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
-#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
-
-/* bytes to disk blocks */
-#define btodb(x) ((x) >> DEV_BSHIFT)
-#define dbtob(x) ((x) << DEV_BSHIFT)
-#ifdef _KERNEL
#ifndef _LOCORE
#define DELAY(n) delay(n)
void delay(int);
#endif
+
#endif /* _KERNEL */
-#endif /* !_MIPS64_PARAM_H_ */
+#endif /* _MIPS64_PARAM_H_ */