summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2020-07-17 16:40:57 -0400
committerFrans Kaashoek <[email protected]>2020-08-10 11:19:10 -0400
commit1e72d5ca087985938589ce509ace4914039860d3 (patch)
tree59175bed3c14e765d5cb4210ac3d6f19d9a03593
parent5494c9170587b17c9d749e19753fa3e7fb6958b9 (diff)
downloadxv6-labs-1e72d5ca087985938589ce509ace4914039860d3.tar.gz
xv6-labs-1e72d5ca087985938589ce509ace4914039860d3.tar.bz2
xv6-labs-1e72d5ca087985938589ce509ace4914039860d3.zip
cpu->scheduler -> cpu->context to reduce confusion
-rw-r--r--kernel/proc.c4
-rw-r--r--kernel/proc.h2
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()?
};