diff options
author | jhb <jhb@FreeBSD.org> | 2001-02-10 02:46:50 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-02-10 02:46:50 +0000 |
commit | 3896c2916461728494e6362e2d2e1d19ecdde272 (patch) | |
tree | f139e15eca5d1db816ee1edc44a36bdaea897cd0 /sys | |
parent | 57f3613f044821baef0d2f821469a045072902e9 (diff) | |
download | FreeBSD-src-3896c2916461728494e6362e2d2e1d19ecdde272.zip FreeBSD-src-3896c2916461728494e6362e2d2e1d19ecdde272.tar.gz |
Reenable preemption on interrupts. My last commit accidentally reverted
it as I was playing with some other ways of doing kernel preemption.
You must still specify the PREEMPTION option in your config file to get a
preemptive kernel.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/alpha/interrupt.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index a6a6555..7d078e5 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -396,6 +396,7 @@ alpha_dispatch_intr(void *frame, unsigned long vector) int h = HASHVEC(vector); struct alpha_intr *i; struct ithd *ithd; /* our interrupt thread */ + int saveintr; struct intrhand *ih; /* @@ -456,7 +457,18 @@ alpha_dispatch_intr(void *frame, unsigned long vector) alpha_mb(); /* XXX - this is bogus, mtx_lock_spin has a barrier */ ithd->it_proc->p_stat = SRUN; setrunqueue(ithd->it_proc); - need_resched(); +#ifdef PREEMPTION + /* Does not work on 4100 */ + if (!cold) { + saveintr = sched_lock.mtx_saveintr; + mtx_intr_enable(&sched_lock); + if (curproc != PCPU_GET(idleproc)) + setrunqueue(curproc); + mi_switch(); + sched_lock.mtx_saveintr = saveintr; + } else +#endif + need_resched(); } else { CTR3(KTR_INTR, "alpha_dispatch_intr: %d: it_need %d, state %d", ithd->it_proc->p_pid, ithd->it_need, ithd->it_proc->p_stat); |