cpu->scheduler -> cpu->context to reduce confusion
This commit is contained in:
parent
d6dad42aaf
commit
3b053f5d58
|
@ -456,7 +456,7 @@ scheduler(void)
|
||||||
// before jumping back to us.
|
// before jumping back to us.
|
||||||
p->state = RUNNING;
|
p->state = RUNNING;
|
||||||
c->proc = p;
|
c->proc = p;
|
||||||
swtch(&c->scheduler, &p->context);
|
swtch(&c->context, &p->context);
|
||||||
|
|
||||||
// Process is done running for now.
|
// Process is done running for now.
|
||||||
// It should have changed its p->state before coming back.
|
// It should have changed its p->state before coming back.
|
||||||
|
@ -490,7 +490,7 @@ sched(void)
|
||||||
panic("sched interruptible");
|
panic("sched interruptible");
|
||||||
|
|
||||||
intena = mycpu()->intena;
|
intena = mycpu()->intena;
|
||||||
swtch(&p->context, &mycpu()->scheduler);
|
swtch(&p->context, &mycpu()->context);
|
||||||
mycpu()->intena = intena;
|
mycpu()->intena = intena;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ struct context {
|
||||||
// Per-CPU state.
|
// Per-CPU state.
|
||||||
struct cpu {
|
struct cpu {
|
||||||
struct proc *proc; // The process running on this cpu, or null.
|
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 noff; // Depth of push_off() nesting.
|
||||||
int intena; // Were interrupts enabled before push_off()?
|
int intena; // Were interrupts enabled before push_off()?
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue