From 3b053f5d58b4914c6389588ad4e556bc887bc99d Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 17 Jul 2020 16:40:57 -0400 Subject: [PATCH] cpu->scheduler -> cpu->context to reduce confusion --- kernel/proc.c | 4 ++-- kernel/proc.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/proc.c b/kernel/proc.c index d4ff37c..f7652f6 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -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; } diff --git a/kernel/proc.h b/kernel/proc.h index 02e7bc3..c257eb7 100644 --- a/kernel/proc.h +++ b/kernel/proc.h @@ -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()? };