summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2016-09-02 05:40:54 -0400
committerRobert Morris <[email protected]>2016-09-02 05:40:54 -0400
commitbc8221a59c083811ee2d8c49c0342ea59caa6d51 (patch)
treeb3ba908c45b694dfa60578100b6662e3bfdfba3c /proc.c
parent4b2152cc2d46865f3e4be011698b7a49bca794b8 (diff)
downloadxv6-labs-bc8221a59c083811ee2d8c49c0342ea59caa6d51.tar.gz
xv6-labs-bc8221a59c083811ee2d8c49c0342ea59caa6d51.tar.bz2
xv6-labs-bc8221a59c083811ee2d8c49c0342ea59caa6d51.zip
comment about sched() saving/restoring cpu->intena
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index 751d886..9e95529 100644
--- a/proc.c
+++ b/proc.c
@@ -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)
{