提交 bc8221a5 创建 作者: Robert Morris's avatar Robert Morris

comment about sched() saving/restoring cpu->intena

上级 4b2152cc
......@@ -302,7 +302,12 @@ scheduler(void)
}
// Enter scheduler. Must hold only ptable.lock
// and have changed proc->state.
// and have changed proc->state. Saves and restores
// intena because intena is a property of this
// kernel thread, not this CPU. It should
// be proc->intena and proc->ncli, but that would
// break in the few places where a lock is held but
// there's no process.
void
sched(void)
{
......
......@@ -102,8 +102,9 @@ pushcli(void)
eflags = readeflags();
cli();
if(cpu->ncli++ == 0)
if(cpu->ncli == 0)
cpu->intena = eflags & FL_IF;
cpu->ncli += 1;
}
void
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论