summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2014-03-21 04:45:57 +0000
committerjhibbits <jhibbits@FreeBSD.org>2014-03-21 04:45:57 +0000
commit7dc00b854cfd013cf5e22bd69e8e3cead200f3dc (patch)
treea2ab1bf1b7de1c6a52f4255d25fe86cfc1b3c4f4
parentb7c5f322bcf5a186844acd42fd84755cf3eefd5b (diff)
downloadFreeBSD-src-7dc00b854cfd013cf5e22bd69e8e3cead200f3dc.zip
FreeBSD-src-7dc00b854cfd013cf5e22bd69e8e3cead200f3dc.tar.gz
Mask out SRR1 bits that aren't exported to the MSR.
This appears to fix a strange condition with X on 32-bit PowerBooks I observed, caused by one of these bits getting set in the mcontext, but not set in the thread, which may be a symptom of another problem, more difficult to diagnose. Since these bits aren't exported anyway, this change makes it more explicit that the bits aren't MSR-related in SRR1. MFC after: 3 weeks
-rw-r--r--sys/powerpc/include/psl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/powerpc/include/psl.h b/sys/powerpc/include/psl.h
index d09de52..2362caf 100644
--- a/sys/powerpc/include/psl.h
+++ b/sys/powerpc/include/psl.h
@@ -88,15 +88,17 @@
#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE)
#elif defined(BOOKE_PPC4XX)
#define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP)
+#define PSL_SRR1_MASK 0x00000000UL /* No mask on Book-E */
#elif defined(AIM)
#ifdef __powerpc64__
#define PSL_KERNSET (PSL_SF | PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI)
#else
#define PSL_KERNSET (PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI)
#endif
+#define PSL_SRR1_MASK 0x78300000UL /* Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) */
#endif
#define PSL_USERSET (PSL_KERNSET | PSL_PR)
-#define PSL_USERSTATIC ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1)
+#define PSL_USERSTATIC (~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1) & ~PSL_SRR1_MASK)
#endif /* _MACHINE_PSL_H_ */
OpenPOWER on IntegriCloud