cpu->scheduler -> cpu->context to reduce confusion

This commit is contained in:
Robert Morris 2020-07-17 16:40:57 -04:00
parent d6dad42aaf
commit 3b053f5d58
2 changed files with 3 additions and 3 deletions

View file

@ -456,7 +456,7 @@ scheduler(void)
// before jumping back to us.
p->state = RUNNING;
c->proc = p;
swtch(&c->scheduler, &p->context);
swtch(&c->context, &p->context);
// Process is done running for now.
// It should have changed its p->state before coming back.
@ -490,7 +490,7 @@ sched(void)
panic("sched interruptible");
intena = mycpu()->intena;
swtch(&p->context, &mycpu()->scheduler);
swtch(&p->context, &mycpu()->context);
mycpu()->intena = intena;
}

View file

@ -21,7 +21,7 @@ struct context {
// Per-CPU state.
struct cpu {
struct proc *proc; // The process running on this cpu, or null.
struct context scheduler; // swtch() here to enter scheduler().
struct context context; // swtch() here to enter scheduler().
int noff; // Depth of push_off() nesting.
int intena; // Were interrupts enabled before push_off()?
};