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.
This commit is contained in:
John Baldwin 2001-02-10 02:46:50 +00:00
parent e990501c21
commit 37ea3ced36

View file

@ -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);