summaryrefslogtreecommitdiff
path: root/mp.c
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-06 19:08:14 +0000
committerrsc <rsc>2006-09-06 19:08:14 +0000
commit0cfc7290e8307b66ade6d5eb736c89cc4062c302 (patch)
tree592ad149f605717dfa0162d75da0af050a9c53e4 /mp.c
parentdb8fb62e4d599f4e08a3b6420e42b2445e8d7fe3 (diff)
downloadxv6-labs-0cfc7290e8307b66ade6d5eb736c89cc4062c302.tar.gz
xv6-labs-0cfc7290e8307b66ade6d5eb736c89cc4062c302.tar.bz2
xv6-labs-0cfc7290e8307b66ade6d5eb736c89cc4062c302.zip
wrap long lines
Diffstat (limited to 'mp.c')
-rw-r--r--mp.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/mp.c b/mp.c
index 3b67b50..f2bb142 100644
--- a/mp.c
+++ b/mp.c
@@ -174,11 +174,12 @@ mp_init(void)
}
}
- if(mp->imcrp) { // it appears that bochs doesn't support IMCR, and code won't run
- outb(0x22, 0x70); // select IMCR
- byte = inb(0x23); // current contents
- byte |= 0x01; // mask external INTR
- outb(0x23, byte); // disconnect 8259s/NMI
+ if(mp->imcrp) {
+ // It appears that Bochs doesn't support IMCR, so code won't run.
+ outb(0x22, 0x70); // Select IMCR
+ byte = inb(0x23); // Current contents
+ byte |= 0x01; // Mask external INTR
+ outb(0x23, byte); // Disconnect 8259s/NMI
}
}
@@ -204,11 +205,20 @@ mp_startthem(void)
(uint) _binary_bootother_size);
for(c = 0; c < ncpu; c++){
+ // Our current cpu has already started.
if(c == cpu())
continue;
- *(uint*)(APBOOTCODE-4) = (uint) (cpus[c].mpstack) + MPSTACK; // tell it what to use for %esp
- *(uint*)(APBOOTCODE-8) = (uint)mpmain; // tell it where to jump to
+
+ // Set target %esp
+ *(uint*)(APBOOTCODE-4) = (uint) (cpus[c].mpstack) + MPSTACK;
+
+ // Set target %eip
+ *(uint*)(APBOOTCODE-8) = (uint)mpmain;
+
+ // Go!
lapic_startap(cpus[c].apicid, (uint) APBOOTCODE);
+
+ // Wait for cpu to get through bootstrap.
while(cpus[c].booted == 0)
;
}