Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Fixup PSL handling to be tolerant of modules. Move...



details:   https://anonhg.NetBSD.org/src/rev/24a1d0fc62f3
branches:  trunk
changeset: 766284:24a1d0fc62f3
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jun 20 07:23:36 2011 +0000

description:
Fixup PSL handling to be tolerant of modules.  Move evbppc psl changes
into powerpc psl.h

diffstat:

 sys/arch/evbppc/include/psl.h          |  27 +--------------------------
 sys/arch/powerpc/booke/booke_machdep.c |   8 ++++++++
 sys/arch/powerpc/include/psl.h         |  29 ++++++++++++++++++++---------
 3 files changed, 29 insertions(+), 35 deletions(-)

diffs (110 lines):

diff -r 0e68f1d4d71b -r 24a1d0fc62f3 sys/arch/evbppc/include/psl.h
--- a/sys/arch/evbppc/include/psl.h     Mon Jun 20 07:18:05 2011 +0000
+++ b/sys/arch/evbppc/include/psl.h     Mon Jun 20 07:23:36 2011 +0000
@@ -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
diff -r 0e68f1d4d71b -r 24a1d0fc62f3 sys/arch/powerpc/booke/booke_machdep.c
--- a/sys/arch/powerpc/booke/booke_machdep.c    Mon Jun 20 07:18:05 2011 +0000
+++ b/sys/arch/powerpc/booke/booke_machdep.c    Mon Jun 20 07:23:36 2011 +0000
@@ -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);
 
diff -r 0e68f1d4d71b -r 24a1d0fc62f3 sys/arch/powerpc/include/psl.h
--- a/sys/arch/powerpc/include/psl.h    Mon Jun 20 07:18:05 2011 +0000
+++ b/sys/arch/powerpc/include/psl.h    Mon Jun 20 07:23:36 2011 +0000
@@ -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 */
 



Home | Main Index | Thread Index | Old Index