From b63bb0fd00cb34ed1d776e6836f5a2bb90de98c1 Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 27 Aug 2007 16:57:13 +0000 Subject: Clean up lapic code. One initialization function now, not three. Use #defines instead of enums (consistent with other code, but sigh). Still boots in Bochs in SMP mode. --- main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d467217..29a8d34 100644 --- a/main.c +++ b/main.c @@ -37,7 +37,6 @@ main0(void) asm volatile("movl %0, %%ebp" : : "r" (cpus[bcpu].mpstack+MPSTACK)); lapic_init(bcpu); - cprintf("\ncpu%d: starting xv6\n\n", cpu()); pinit(); // process table @@ -53,10 +52,7 @@ main0(void) console_init(); // I/O devices & their interrupts ide_init(); // disk mp_startthem(); // other CPUs - if(ismp){ - lapic_timerinit(); // smp timer - lapic_enableintr(); // local interrupts - }else + if(!ismp) pit8253_timerinit(); // uniprocessor timer userinit(); // first user process @@ -74,8 +70,6 @@ mpmain(void) cprintf("cpu%d: starting\n", cpu()); idtinit(); lapic_init(cpu()); - lapic_timerinit(); - lapic_enableintr(); setupsegs(0); cpuid(0, 0, 0, 0, 0); // memory barrier -- cgit v1.2.3