diff options
author | Frans Kaashoek <[email protected]> | 2017-01-31 17:47:16 -0500 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2017-01-31 17:47:16 -0500 |
commit | abf847a083888bbed4260ecacf849ea19f23e810 (patch) | |
tree | 4ae9b3487bbfe27f6382486bf877917dbb8bc030 /main.c | |
parent | 59cdd6c63b89395d64ec9550181af5ed569b8466 (diff) | |
download | xv6-labs-abf847a083888bbed4260ecacf849ea19f23e810.tar.gz xv6-labs-abf847a083888bbed4260ecacf849ea19f23e810.tar.bz2 xv6-labs-abf847a083888bbed4260ecacf849ea19f23e810.zip |
Start of an experiment to remove the use of gs for cpu local variables.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -22,7 +22,6 @@ main(void) mpinit(); // detect other processors lapicinit(); // interrupt controller seginit(); // segment descriptors - cprintf("\ncpu%d: starting xv6\n\n", cpunum()); picinit(); // another interrupt controller ioapicinit(); // another interrupt controller consoleinit(); // console hardware @@ -31,7 +30,7 @@ main(void) tvinit(); // trap vectors binit(); // buffer cache fileinit(); // file table - ideinit(); // disk + ideinit(); // disk if(!ismp) timerinit(); // uniprocessor timer startothers(); // start other processors @@ -54,9 +53,9 @@ mpenter(void) static void mpmain(void) { - cprintf("cpu%d: starting\n", cpunum()); + cprintf("cpu%d: starting %d\n", cpuid(), lapiccpunum()); idtinit(); // load idt register - xchg(&cpu->started, 1); // tell startothers() we're up + xchg(&(mycpu()->started), 1); // tell startothers() we're up scheduler(); // start running processes } @@ -78,7 +77,7 @@ startothers(void) memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); for(c = cpus; c < cpus+ncpu; c++){ - if(c == cpus+cpunum()) // We've started already. + if(c == mycpu()) // We've started already. continue; // Tell entryother.S what stack to use, where to enter, and what |