summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
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/powerpc
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/powerpc')
-rw-r--r--sys/arch/powerpc/include/param.h62
-rw-r--r--sys/arch/powerpc/include/pmap.h15
2 files changed, 28 insertions, 49 deletions
diff --git a/sys/arch/powerpc/include/param.h b/sys/arch/powerpc/include/param.h
index 6f8337d2bcc..3b8fcd3bf71 100644
--- a/sys/arch/powerpc/include/param.h
+++ b/sys/arch/powerpc/include/param.h
@@ -1,5 +1,4 @@
-/* $OpenBSD: param.h,v 1.32 2011/09/08 03:40:32 guenther Exp $ */
-/* $NetBSD: param.h,v 1.1 1996/09/30 16:34:28 ws Exp $ */
+/* $OpenBSD: param.h,v 1.33 2013/03/23 16:12:26 deraadt Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -41,12 +40,8 @@
#endif /* _LOCORE */
#endif
-/*
- * Machine dependent constants for PowerPC (32-bit only currently)
- */
#define MACHINE_ARCH "powerpc"
#define _MACHINE_ARCH powerpc
-
#define MID_MACHINE MID_POWERPC
#define ALIGNBYTES _ALIGNBYTES
@@ -54,50 +49,26 @@
#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t)
#define PAGE_SHIFT 12
-#define PAGE_SIZE 4096
+#define PAGE_SIZE (1 << PAGE_SHIFT)
#define PAGE_MASK (PAGE_SIZE - 1)
#define PGSHIFT PAGE_SHIFT
-#define NBPG PAGE_SIZE
#define PGOFSET PAGE_MASK
-#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 UPAGES 4
-#define USPACE (UPAGES * NBPG)
-#define USPACE_ALIGN (0) /* u-area alignment 0-none */
-
-/*
- * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
- * logical pages.
- */
-#define NKMEMPAGES_MIN_DEFAULT ((4 * 1024 * 1024) >> PAGE_SHIFT)
-#define NKMEMPAGES_MAX_DEFAULT ((64 * 1024 * 1024) >> PAGE_SHIFT)
+#ifdef _KERNEL
-/*
- * Constants related to network buffer management.
- */
-#define NMBCLUSTERS 4096 /* map size, max cluster allocation */
+#define NBPG PAGE_SIZE
-/*
- * pages ("clicks") to disk blocks
- */
-#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
-#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
+#define UPAGES 4 /* pages of u-area */
+#define USPACE (UPAGES * PAGE_SIZE) /* total size of u-area */
+#define USPACE_ALIGN 0 /* u-area alignment 0-none */
-/*
- * bytes to disk blocks
- */
-#define dbtob(x) ((x) << DEV_BSHIFT)
-#define btodb(x) ((x) >> DEV_BSHIFT)
+#define NMBCLUSTERS 4096 /* map size, max cluster allocation */
/*
- * Segment handling stuff
+ * Maximum size of the kernel malloc arena in PAGE_SIZE-sized
+ * logical pages.
*/
-#define PPC_SEGMENT_LENGTH 0x10000000
-#define PPC_SEGMENT_MASK 0xf0000000
+#define NKMEMPAGES_MAX_DEFAULT ((64 * 1024 * 1024) >> PAGE_SHIFT)
/*
* Fixed segments
@@ -109,15 +80,10 @@
#define PPC_USER_ADDR ((void *)(PPC_USER_SR << ADDR_SR_SHIFT))
/*
- * Some system constants
- */
-#ifndef NPMAPS
-#define NPMAPS 32768 /* Number of pmaps in system */
-#endif
-
-/*
* Temporary kludge till we do (ov)bcopy in assembler
*/
#define ovbcopy bcopy
-#endif /* _POWERPC_PARAM_H_ */
+#endif /* _KERNEL */
+
+#endif /* _POWERPC_PARAM_H_ */
diff --git a/sys/arch/powerpc/include/pmap.h b/sys/arch/powerpc/include/pmap.h
index ab30385ce46..03ae397f4d7 100644
--- a/sys/arch/powerpc/include/pmap.h
+++ b/sys/arch/powerpc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.48 2012/08/30 18:14:26 mpi Exp $ */
+/* $OpenBSD: pmap.h,v 1.49 2013/03/23 16:12:26 deraadt Exp $ */
/* $NetBSD: pmap.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */
/*-
@@ -94,6 +94,19 @@ struct pmap {
struct pmap_statistics pm_stats; /* pmap statistics */
};
+/*
+ * Segment handling stuff
+ */
+#define PPC_SEGMENT_LENGTH 0x10000000
+#define PPC_SEGMENT_MASK 0xf0000000
+
+/*
+ * Some system constants
+ */
+#ifndef NPMAPS
+#define NPMAPS 32768 /* Number of pmaps in system */
+#endif
+
typedef struct pmap *pmap_t;
extern struct pmap kernel_pmap_;