summaryrefslogtreecommitdiff
path: root/mp.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-07-01 21:26:01 +0000
committerrtm <rtm>2006-07-01 21:26:01 +0000
commit8b4e2a08febc8b957b44732dbc7da831479a0005 (patch)
tree46c3b079ec65f0efbd1f3b603f1b11a3ae09e56d /mp.c
parentf7cea12b38a86e9b37fa5bc635310d3f85e5f8db (diff)
downloadxv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.tar.gz
xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.tar.bz2
xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.zip
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
Diffstat (limited to 'mp.c')
-rw-r--r--mp.c12
1 files changed, 4 insertions, 8 deletions
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);
}