timer-preempted kernel thread resumes execution in trap() after yield().
otherwise the kernel could get an arbitrary number of nested timer intrs.
c = &cpus[cpu()];
for(;;){
- // Enable interrupts on this processor.
+ // Enable interrupts on this processor, in lieu of saving intena.
sti();
// Loop over process table looking for process to run.
void
sched(void)
{
+ int intena;
+
if(read_eflags()&FL_IF)
panic("sched interruptible");
if(cp->state == RUNNING)
if(cpus[cpu()].ncli != 1)
panic("sched locks");
+ intena = cpus[cpu()].intena;
swtch(&cp->context, &cpus[cpu()].context);
+ cpus[cpu()].intena = intena;
}
// Give up the CPU for one scheduling round.