summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2004-08-03 04:14:55 +0000
committergrehan <grehan@FreeBSD.org>2004-08-03 04:14:55 +0000
commit2f05904e1888f800b4dbb1588415900b79af2603 (patch)
tree8611c992abb8a7230630b4bdb79baecab27abd52 /sys/powerpc
parente327e6bd591c088aa916f68246d3ff4dfc0bd1e0 (diff)
downloadFreeBSD-src-2f05904e1888f800b4dbb1588415900b79af2603.zip
FreeBSD-src-2f05904e1888f800b4dbb1588415900b79af2603.tar.gz
Remove race condition between reading of MSR, setting md_savecrit,
and setting MSR. This was most evident with the idle proc running with interrupts disabled and causing a lockup. Switch over to the i386 style which does things in the right order. debug assisted by: gallatin, and the invaluable KTR option.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/include/critical.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/powerpc/include/critical.h b/sys/powerpc/include/critical.h
index 93a177b..cc0768a 100644
--- a/sys/powerpc/include/critical.h
+++ b/sys/powerpc/include/critical.h
@@ -58,12 +58,8 @@ void cpu_critical_fork_exit(void);
static __inline void
cpu_critical_enter(struct thread *td)
{
- u_int msr;
- msr = mfmsr();
- td->td_md.md_savecrit = msr;
- msr &= ~PSL_EE;
- mtmsr(msr);
+ td->td_md.md_savecrit = intr_disable();
}
/*
@@ -77,7 +73,7 @@ static __inline void
cpu_critical_exit(struct thread *td)
{
- mtmsr(td->td_md.md_savecrit);
+ intr_restore(td->td_md.md_savecrit);
}
OpenPOWER on IntegriCloud