From 0cfc7290e8307b66ade6d5eb736c89cc4062c302 Mon Sep 17 00:00:00 2001 From: rsc Date: Wed, 6 Sep 2006 19:08:14 +0000 Subject: wrap long lines --- mp.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'mp.c') 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) ; } -- cgit v1.2.3