Module Name: src
Committed By: matt
Date: Mon Jun 20 07:23:36 UTC 2011
Modified Files:
src/sys/arch/evbppc/include: psl.h
src/sys/arch/powerpc/booke: booke_machdep.c
src/sys/arch/powerpc/include: psl.h
Log Message:
Fixup PSL handling to be tolerant of modules. Move evbppc psl changes
into powerpc psl.h
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/include/psl.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/booke/booke_machdep.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/include/psl.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/evbppc/include/psl.h
diff -u src/sys/arch/evbppc/include/psl.h:1.3 src/sys/arch/evbppc/include/psl.h:1.4
--- src/sys/arch/evbppc/include/psl.h:1.3 Sun Dec 11 12:17:12 2005
+++ src/sys/arch/evbppc/include/psl.h Mon Jun 20 07:23:36 2011
@@ -1,28 +1,3 @@
-/* $NetBSD: psl.h,v 1.3 2005/12/11 12:17:12 christos Exp $ */
-
-#ifdef _KERNEL_OPT
-#include "opt_ppcarch.h"
-#endif
+/* $NetBSD: psl.h,v 1.4 2011/06/20 07:23:36 matt Exp $ */
#include <powerpc/psl.h>
-
-#ifdef PPC_IBM4XX
-/* 4xx don't have PSL_RI */
-#undef PSL_USERSET
-#ifdef PPC_IBM403
-#define PSL_USERSET (PSL_EE | PSL_PR | PSL_ME | PSL_IR | PSL_DR)
-#else
-/* Apparently we get unexplained machine checks, so disable them. */
-#define PSL_USERSET (PSL_EE | PSL_PR | PSL_IR | PSL_DR)
-#endif
-
-/*
- * We also need to override the PSL_SE bit. 4xx have completely
- * different debug register support.
- *
- * The SE bit is actually the DWE bit. We want to set the DE bit
- * to enable the debug regs instead of the DWE bit.
- */
-#undef PSL_SE
-#define PSL_SE 0x00000200
-#endif
Index: src/sys/arch/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.8 src/sys/arch/powerpc/booke/booke_machdep.c:1.9
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.8 Wed Jun 15 15:22:56 2011
+++ src/sys/arch/powerpc/booke/booke_machdep.c Mon Jun 20 07:23:36 2011
@@ -38,6 +38,8 @@
#include <sys/cdefs.h>
+#include "opt_modular.h"
+
#include <sys/param.h>
#include <sys/cpu.h>
#include <sys/device.h>
@@ -61,6 +63,12 @@
psize_t pmemsize;
struct vm_map *phys_map;
+#ifdef MODULAR
+register_t cpu_psluserset = PSL_USERSET;
+register_t cpu_pslusermod = PSL_USERMOD;
+register_t cpu_pslusermask = PSL_USERMASK;
+#endif
+
static bus_addr_t booke_dma_phys_to_bus_mem(bus_dma_tag_t, bus_addr_t);
static bus_addr_t booke_dma_bus_mem_to_phys(bus_dma_tag_t, bus_addr_t);
Index: src/sys/arch/powerpc/include/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.17 src/sys/arch/powerpc/include/psl.h:1.18
--- src/sys/arch/powerpc/include/psl.h:1.17 Mon May 2 02:01:33 2011
+++ src/sys/arch/powerpc/include/psl.h Mon Jun 20 07:23:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: psl.h,v 1.17 2011/05/02 02:01:33 matt Exp $ */
+/* $NetBSD: psl.h,v 1.18 2011/06/20 07:23:36 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -102,23 +102,34 @@
#include "opt_ppcarch.h"
#endif /* _KERNEL_OPT */
-#if defined(PPC_OEA) || defined (PPC_OEA64_BRIDGE)
-extern int cpu_psluserset, cpu_pslusermod;
+#if defined(PPC_OEA) || defined (PPC_OEA64_BRIDGE) || defined(_MODULE)
+extern register_t cpu_psluserset, cpu_pslusermod, cpu_pslusermask;
#define PSL_USERSET cpu_psluserset
#define PSL_USERMOD cpu_pslusermod
+#define PSL_USERMASK cpu_pslusermask
#elif defined(PPC_BOOKE)
-#define PSL_USERSET (PSL_EE | PSL_PR | PSL_ME | PSL_CE | PSL_DE | PSL_IS | PSL_DS)
-#define PSL_USERSRR1 ((PSL_USERSET|PSL_USERMOD) & (PSL_SPV|PSL_CE|0xFFFF))
+#define PSL_USERSET (PSL_EE | PSL_PR | PSL_IS | PSL_DS | PSL_ME | PSL_CE | PSL_DE)
+#define PSL_USERMASK (PSL_SPV | PSL_CE | 0xFFFF)
#define PSL_USERMOD (PSL_SPV)
#else /* PPC_IBM4XX */
-#define PSL_USERSET (PSL_EE | PSL_PR | PSL_ME | PSL_IR | PSL_DR)
+#ifdef PPC_IBM403
+#define PSL_USERSET (PSL_EE | PSL_PR | PSL_IR | PSL_DR | PSL_ME)
+#else /* Apparently we get unexplained machine checks, so disable them. */
+#define PSL_USERSET (PSL_EE | PSL_PR | PSL_IR | PSL_DR)
+#endif
+#define PSL_USERMASK 0xFFFF
#define PSL_USERMOD (0)
+/*
+ * We also need to override the PSL_SE bit. 4xx have completely different
+ * debug register support. The SE bit is actually the DWE bit. We want to
+ * set the DE bit to enable the debug regs instead of the DWE bit.
+ */
+#undef PSL_SE
+#define PSL_SE PSL_DE
#endif /* PPC_OEA */
-#ifndef PSL_USERSRR1
-#define PSL_USERSRR1 ((PSL_USERSET|PSL_USERMOD) & 0xFFFF)
-#endif
+#define PSL_USERSRR1 ((PSL_USERSET|PSL_USERMOD) & PSL_USERMASK)
#define PSL_USEROK_P(psl) (((psl) & ~PSL_USERMOD) == PSL_USERSET)
#endif /* !_LOCORE */