summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorrsc <rsc>2007-09-27 20:32:45 +0000
committerrsc <rsc>2007-09-27 20:32:45 +0000
commit4f74de0edc243ffdae0233eb5c84d09c44677ccf (patch)
treea06bec65e5b6ad8db480963ffc6646a176baa8da /main.c
parentce2e7515552adca3a60e349de2931112736d17bf (diff)
downloadxv6-labs-4f74de0edc243ffdae0233eb5c84d09c44677ccf.tar.gz
xv6-labs-4f74de0edc243ffdae0233eb5c84d09c44677ccf.tar.bz2
xv6-labs-4f74de0edc243ffdae0233eb5c84d09c44677ccf.zip
okay, that was long enough - revert
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main.c b/main.c
index 0f1acc8..464112b 100644
--- a/main.c
+++ b/main.c
@@ -42,14 +42,12 @@ main(void)
userinit(); // first user process
// Allocate scheduler stacks and boot the other CPUs.
- for(i=0; i<ncpu; i++){
+ for(i=0; i<ncpu; i++)
cpus[i].stack = kalloc(KSTACKSIZE);
- *(void**)(cpus[i].stack + KSTACKTOP) = 0;
- }
bootothers();
// Switch to our scheduler stack and continue with mpmain.
- asm volatile("movl %0, %%esp" : : "r" (cpus[bcpu].stack+KSTACKTOP));
+ asm volatile("movl %0, %%esp" : : "r" (cpus[bcpu].stack+KSTACKSIZE));
mpmain();
}
@@ -86,7 +84,7 @@ bootothers(void)
continue;
// Fill in %esp, %eip and start code on cpu.
- *(void**)(code-4) = c->stack + KSTACKTOP;
+ *(void**)(code-4) = c->stack + KSTACKSIZE;
*(void**)(code-8) = mpmain;
lapic_startap(c->apicid, (uint)code);