summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include/param.h
diff options
context:
space:
mode:
authorbenno <benno@FreeBSD.org>2001-06-16 07:14:07 +0000
committerbenno <benno@FreeBSD.org>2001-06-16 07:14:07 +0000
commitf371c393d1d9d52936226995942133699ae0c05a (patch)
treecf1bec5626b59af2b2af824ef859e3c5bba5f25f /sys/powerpc/include/param.h
parent99efa6b196d6054b9e66ecbca2ce6523e8df5f54 (diff)
downloadFreeBSD-src-f371c393d1d9d52936226995942133699ae0c05a.zip
FreeBSD-src-f371c393d1d9d52936226995942133699ae0c05a.tar.gz
This commit (along with one pending in sys/dev/ofw and one in sys/conf) give
us our first minimal glimpse of PowerPC support. With this code we can get to the "mountroot>" prompt on my Apple iMac. We can't get any further due to lack of clock and interrupt handling, among other things. This does however mean that pmap and VM are initialising. We're fairly dependant on OpenFirmware at this point, but I hope to add support for other classes of firmware at a later stage. Reviewed by: obrien, dfr
Diffstat (limited to 'sys/powerpc/include/param.h')
-rw-r--r--sys/powerpc/include/param.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h
index ebc67b7..3ebcd94 100644
--- a/sys/powerpc/include/param.h
+++ b/sys/powerpc/include/param.h
@@ -74,7 +74,9 @@
#endif
#define MID_MACHINE MID_POWERPC
+#if !defined(LOCORE)
#include <machine/cpu.h>
+#endif
/*
* OBJFORMAT_NAMES is a comma-separated list of the object formats
@@ -158,18 +160,40 @@
/*
* Mach derived conversion macros
*/
-#define trunc_page(x) ((x) & ~PAGE_MASK)
+#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK))
#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK)
#define trunc_4mpage(x) ((unsigned)(x) & ~PDRMASK)
#define round_4mpage(x) ((((unsigned)(x)) + PDRMASK) & ~PDRMASK)
-#define atop(x) ((unsigned)(x) >> PAGE_SHIFT)
-#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT)
+#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
+#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT)
#define powerpc_btop(x) ((unsigned)(x) >> PAGE_SHIFT)
#define powerpc_ptob(x) ((unsigned)(x) << PAGE_SHIFT)
#define pgtok(x) ((x) * (PAGE_SIZE / 1024))
+/* XXX: NetBSD defines that we're using for the moment */
+#define USER_SR 13
+#define KERNEL_SR 14
+#define KERNEL_SEGMENT (0xfffff0 + KERNEL_SR)
+#define EMPTY_SEGMENT 0xfffff0
+#define USER_ADDR ((void *)(USER_SR << ADDR_SR_SHFT))
+#define SEGMENT_LENGTH 0x10000000
+#define SEGMENT_MASK 0xf0000000
+
+#if !defined(NPMAPS)
+#define NPMAPS 32768
+#endif /* !defined(NPMAPS) */
+
+#if !defined(MSGBUFSIZE)
+#define MSGBUFSIZE PAGE_SIZE
+#endif /* !defined(MSGBUFSIZE) */
+
+/*
+ * XXX: Stop NetBSD msgbuf_paddr code from happening.
+ */
+#define MSGBUFADDR
+
#endif /* !_MACHINE_PARAM_H_ */
#endif /* !_NO_NAMESPACE_POLLUTION */
OpenPOWER on IntegriCloud