From 124f32ae38260ff32ddd176d37ebb98d19675178 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 24 Aug 2007 19:36:52 +0000 Subject: [PATCH] tweak --- main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index 6ef8da1..d467217 100644 --- a/main.c +++ b/main.c @@ -20,7 +20,7 @@ void main0(void) { int i; - static int bcpu; // cannot be on stack + static volatile int bcpu; // cannot be on stack // clear BSS memset(edata, 0, end - edata); @@ -32,7 +32,7 @@ main0(void) mp_init(); // collect info about this machine bcpu = mp_bcpu(); - // switch to bootstrap processor's stack + // Switch to bootstrap processor's stack asm volatile("movl %0, %%esp" : : "r" (cpus[bcpu].mpstack+MPSTACK-32)); asm volatile("movl %0, %%ebp" : : "r" (cpus[bcpu].mpstack+MPSTACK)); @@ -72,14 +72,10 @@ void mpmain(void) { cprintf("cpu%d: starting\n", cpu()); - idtinit(); // CPU's idt - if(cpu() == 0) - panic("mpmain on cpu 0"); + idtinit(); lapic_init(cpu()); lapic_timerinit(); lapic_enableintr(); - - // make sure there's a TSS setupsegs(0); cpuid(0, 0, 0, 0, 0); // memory barrier