From 3c854532b0231aefd1836d12b167ef3403f72658 Mon Sep 17 00:00:00 2001 From: Benno Rice Date: Thu, 28 Feb 2002 03:07:48 +0000 Subject: [PATCH] - 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. --- sys/powerpc/include/cpufunc.h | 17 ++++++++++++----- 1 file 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 -#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