Skip to content
Snippets Groups Projects
Commit bc8221a5 authored by Robert Morris's avatar Robert Morris
Browse files

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

parent 4b2152cc
No related branches found
No related tags found
No related merge requests found
...@@ -302,7 +302,12 @@ scheduler(void) ...@@ -302,7 +302,12 @@ scheduler(void)
} }
// Enter scheduler. Must hold only ptable.lock // 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 void
sched(void) sched(void)
{ {
......
...@@ -102,8 +102,9 @@ pushcli(void) ...@@ -102,8 +102,9 @@ pushcli(void)
eflags = readeflags(); eflags = readeflags();
cli(); cli();
if(cpu->ncli++ == 0) if(cpu->ncli == 0)
cpu->intena = eflags & FL_IF; cpu->intena = eflags & FL_IF;
cpu->ncli += 1;
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment