summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/proc.c b/proc.c
index 2ed2952..fb79444 100644
--- a/proc.c
+++ b/proc.c
@@ -65,15 +65,14 @@ growproc(int n)
return cp->sz - n;
}
-// Set up CPU's segment descriptors and task state for a
-// given process.
-// If p==0, set up for "idle" state for when scheduler()
-// is idling, not running any process.
+// Set up CPU's segment descriptors and task state for a given process.
+// If p==0, set up for "idle" state for when scheduler() is running.
void
setupsegs(struct proc *p)
{
- struct cpu *c = &cpus[cpu()];
-
+ struct cpu *c;
+
+ c = &cpus[cpu()];
c->ts.ss0 = SEG_KDATA << 3;
if(p)
c->ts.esp0 = (uint)(p->kstack + KSTACKSIZE);