From ce2e7515552adca3a60e349de2931112736d17bf Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 27 Sep 2007 20:29:50 +0000 Subject: test: store curproc at top of stack I don't actually think this is worthwhile, but I figured I would check it in before reverting it, so that it can be in the revision history. Pros: * curproc doesn't need to turn on/off interrupts * scheduler doesn't have to edit curproc anymore Cons: * it's ugly * all the stack computation is more complicated. * it doesn't actually simplify anything but curproc, and even curproc is harder to follow. --- main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 464112b..0f1acc8 100644 --- a/main.c +++ b/main.c @@ -42,12 +42,14 @@ main(void) userinit(); // first user process // Allocate scheduler stacks and boot the other CPUs. - for(i=0; istack + KSTACKSIZE; + *(void**)(code-4) = c->stack + KSTACKTOP; *(void**)(code-8) = mpmain; lapic_startap(c->apicid, (uint)code); -- cgit v1.2.3