From 37ea3ced36ada86e4ff75807430e84d30d42cf68 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 10 Feb 2001 02:46:50 +0000 Subject: [PATCH] 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. --- sys/alpha/alpha/interrupt.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index a6a6555ebab..7d078e5a52d 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);