diff options
author | jake <jake@FreeBSD.org> | 2001-02-01 03:34:20 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-02-01 03:34:20 +0000 |
commit | a9f4853a90e9a3d0a29707d7da60599d5cf64468 (patch) | |
tree | 84ae793f8179f0a4684d40da39573fd2b24cc4d4 /sys/i386/isa/npx.c | |
parent | de48d4010094bae98c3ed8c82cef640a182c5a75 (diff) | |
download | FreeBSD-src-a9f4853a90e9a3d0a29707d7da60599d5cf64468.zip FreeBSD-src-a9f4853a90e9a3d0a29707d7da60599d5cf64468.tar.gz |
Implement preemptive scheduling of hardware interrupt threads.
- If possible, context switch to the thread directly in sched_ithd(),
rather than triggering a delayed ast reschedule.
- Disable interrupts while restoring fpu state in the trap handler,
in order to ensure that we are not preempted in the middle, which
could cause migration to another cpu.
Reviewed by: peter
Tested by: peter (alpha)
Diffstat (limited to 'sys/i386/isa/npx.c')
-rw-r--r-- | sys/i386/isa/npx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 7c6c4f0..a729e0f 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -796,6 +796,8 @@ npx_intr(dummy) int npxdna() { + int s; + if (!npx_exists) return (0); if (PCPU_GET(npxproc) != NULL) { @@ -803,6 +805,8 @@ npxdna() PCPU_GET(npxproc), curproc); panic("npxdna"); } + s = save_intr(); + disable_intr(); stop_emulating(); /* * Record new context early in case frstor causes an IRQ13. @@ -822,6 +826,7 @@ npxdna() * first FPU instruction after a context switch. */ frstor(&PCPU_GET(curpcb)->pcb_savefpu); + restore_intr(s); return (1); } |