summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index b009892..808a15e 100644
--- a/proc.c
+++ b/proc.c
@@ -179,7 +179,6 @@ userinit(void)
}
// Return currently running process.
-// XXX comment better
struct proc*
curproc(void)
{
@@ -206,11 +205,13 @@ scheduler(void)
struct cpu *c;
int i;
+ c = &cpus[cpu()];
for(;;){
+ // Enable interrupts on this processor.
+ sti();
+
// Loop over process table looking for process to run.
acquire(&proc_table_lock);
-
- c = &cpus[cpu()];
for(i = 0; i < NPROC; i++){
p = &proc[i];
if(p->state != RUNNABLE)
@@ -229,8 +230,8 @@ scheduler(void)
c->curproc = 0;
setupsegs(0);
}
-
release(&proc_table_lock);
+
}
}