aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/include/cpufunc.h
diff options
context:
space:
mode:
authorBenno Rice <benno@FreeBSD.org>2002-02-28 03:07:48 +0000
committerBenno Rice <benno@FreeBSD.org>2002-02-28 03:07:48 +0000
commit3c854532b0231aefd1836d12b167ef3403f72658 (patch)
tree47c919122b01c3453eda0f73b38fc212218b61f7 /sys/powerpc/include/cpufunc.h
parent85a745c15ed8cb4a6292a7039617ea453aac65ce (diff)
downloadsrc-3c854532b0231aefd1836d12b167ef3403f72658.tar.gz
src-3c854532b0231aefd1836d12b167ef3403f72658.zip
- When enabling/disabling interrupts, set/clear both PSL_EE and PSL_RI, not
just PSL_EE. - Make cpu_critical_enter/exit independant of save_intr/restore_intr.
Notes
Notes: svn path=/head/; revision=91461
Diffstat (limited to 'sys/powerpc/include/cpufunc.h')
-rw-r--r--sys/powerpc/include/cpufunc.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/powerpc/include/cpufunc.h b/sys/powerpc/include/cpufunc.h
index 1ed8934d3c1e..282c9c4e3bba 100644
--- a/sys/powerpc/include/cpufunc.h
+++ b/sys/powerpc/include/cpufunc.h
@@ -35,7 +35,7 @@
#include <machine/psl.h>
-#define CRITICAL_FORK (mfmsr() | PSL_EE)
+#define CRITICAL_FORK (mfmsr() | PSL_EE | PSL_RI)
#ifdef __GNUC__
@@ -93,7 +93,7 @@ disable_intr(void)
unsigned int msr;
msr = mfmsr();
- mtmsr(msr & ~PSL_EE);
+ mtmsr(msr & ~(PSL_EE|PSL_RI));
}
static __inline void
@@ -102,7 +102,7 @@ enable_intr(void)
unsigned int msr;
msr = mfmsr();
- mtmsr(msr | PSL_EE);
+ mtmsr(msr | PSL_EE | PSL_RI);
}
static __inline unsigned int
@@ -118,8 +118,15 @@ save_intr(void)
static __inline critical_t
cpu_critical_enter(void)
{
+ u_int msr;
+ critical_t crit;
- return ((critical_t)save_intr());
+ msr = mfmsr();
+ crit = (critical_t)msr;
+ msr &= ~(PSL_EE | PSL_RI);
+ mtmsr(msr);
+
+ return (crit);
}
static __inline void
@@ -133,7 +140,7 @@ static __inline void
cpu_critical_exit(critical_t msr)
{
- return (restore_intr((unsigned int)msr));
+ mtmsr(msr);
}
static __inline void