From 8b4e2a08febc8b957b44732dbc7da831479a0005 Mon Sep 17 00:00:00 2001 From: rtm Date: Sat, 1 Jul 2006 21:26:01 +0000 Subject: swtch saves callee-saved registers swtch idles on per-CPU stack, not on calling process's stack fix pipe bugs usertest.c tests pipes, fork, exit, close --- mp.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'mp.c') diff --git a/mp.c b/mp.c index eb5afc9..57b887d 100644 --- a/mp.c +++ b/mp.c @@ -6,6 +6,7 @@ #include "x86.h" #include "traps.h" #include "mmu.h" +#include "proc.h" /* * Credit: Plan 9 sources, Intel MP spec, and Cliff Frey @@ -92,16 +93,11 @@ enum { /* LAPIC_TDCR */ }; #define APBOOTCODE 0x7000 // XXX hack -#define MPSTACK 512 static struct MP* mp; // The MP floating point structure static uint32_t *lapicaddr; -static struct cpu { - uint8_t apicid; // Local APIC ID - int lintr[2]; // Local APIC - char mpstack[MPSTACK]; // per-cpu start-up stack, only used to get into main() -} cpus[NCPU]; -static int ncpu; +struct cpu cpus[NCPU]; +int ncpu; static struct cpu *bcpu; static int @@ -130,7 +126,7 @@ lapic_timerinit() void lapic_timerintr() { - cprintf("%d: timer interrupt!\n", cpu()); + // cprintf("%d: timer interrupt!\n", cpu()); lapic_write (LAPIC_EOI, 0); } -- cgit v1.2.3