diff options
author | rsc <rsc> | 2006-09-06 19:08:14 +0000 |
---|---|---|
committer | rsc <rsc> | 2006-09-06 19:08:14 +0000 |
commit | 0cfc7290e8307b66ade6d5eb736c89cc4062c302 (patch) | |
tree | 592ad149f605717dfa0162d75da0af050a9c53e4 /mp.c | |
parent | db8fb62e4d599f4e08a3b6420e42b2445e8d7fe3 (diff) | |
download | xv6-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.c | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -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) ; } |