summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-28 04:13:24 +0000
committerrsc <rsc>2007-08-28 04:13:24 +0000
commit3341e30f6e080c93e61e60410052bc7290dd7e16 (patch)
treeb33cb2c50804fab4c3c168b2820a131118e3e1ea /main.c
parenta759b8a45098b7f52a92c5415f48becd2a69b02d (diff)
downloadxv6-labs-3341e30f6e080c93e61e60410052bc7290dd7e16.tar.gz
xv6-labs-3341e30f6e080c93e61e60410052bc7290dd7e16.tar.bz2
xv6-labs-3341e30f6e080c93e61e60410052bc7290dd7e16.zip
nit
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/main.c b/main.c
index 3508ecc..308541b 100644
--- a/main.c
+++ b/main.c
@@ -5,9 +5,7 @@
#include "proc.h"
#include "x86.h"
-extern char edata[], end[];
-
-void bootothers(void);
+static void bootothers(void);
// Bootstrap processor starts running C code here.
int
@@ -15,6 +13,7 @@ main(void)
{
int i;
static volatile int bcpu; // cannot be on stack
+ extern char edata[], end[];
// clear BSS
memset(edata, 0, end - edata);
@@ -65,7 +64,6 @@ mpmain(void)
idtinit();
lapic_init(cpu());
setupsegs(0);
-
cpuid(0, 0, 0, 0, 0); // memory barrier
cpus[cpu()].booted = 1;
@@ -76,7 +74,7 @@ mpmain(void)
scheduler();
}
-void
+static void
bootothers(void)
{
extern uchar _binary_bootother_start[], _binary_bootother_size[];
@@ -91,7 +89,7 @@ bootothers(void)
if(c == cpus+cpu()) // We've started already.
continue;
- // Set target %esp, %eip
+ // Fill in %esp, %eip and start code on cpu.
*(void**)(code-4) = c->mpstack + MPSTACK;
*(void**)(code-8) = mpmain;
lapic_startap(c->apicid, (uint)code);