From bc8221a59c083811ee2d8c49c0342ea59caa6d51 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 2 Sep 2016 05:40:54 -0400 Subject: comment about sched() saving/restoring cpu->intena --- proc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'proc.c') 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) { -- cgit v1.2.3