diff options
author | benno <benno@FreeBSD.org> | 2002-02-28 03:07:48 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2002-02-28 03:07:48 +0000 |
commit | bd730b687104ab126381c7a0789a524b31db27fb (patch) | |
tree | 47c919122b01c3453eda0f73b38fc212218b61f7 /sys/powerpc | |
parent | 0535cd31ee937a1b061f68769b039652136634cb (diff) | |
download | FreeBSD-src-bd730b687104ab126381c7a0789a524b31db27fb.zip FreeBSD-src-bd730b687104ab126381c7a0789a524b31db27fb.tar.gz |
- 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.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/include/cpufunc.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/powerpc/include/cpufunc.h b/sys/powerpc/include/cpufunc.h index 1ed8934..282c9c4 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 |