diff options
author | Russ Cox <[email protected]> | 2009-08-30 23:02:08 -0700 |
---|---|---|
committer | Russ Cox <[email protected]> | 2009-08-30 23:02:08 -0700 |
commit | 48755214c9a02d6249caf3126d3b41d67eda4730 (patch) | |
tree | 2edc8b996fd7c3ef2da8876d657140e242999d93 /mp.c | |
parent | 0aef8914959af9e472852611eb6352c211093d35 (diff) | |
download | xv6-labs-48755214c9a02d6249caf3126d3b41d67eda4730.tar.gz xv6-labs-48755214c9a02d6249caf3126d3b41d67eda4730.tar.bz2 xv6-labs-48755214c9a02d6249caf3126d3b41d67eda4730.zip |
assorted fixes:
* rename c/cp to cpu/proc
* rename cpu.context to cpu.scheduler
* fix some comments
* formatting for printout
Diffstat (limited to 'mp.c')
-rw-r--r-- | mp.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -103,20 +103,22 @@ mpinit(void) struct mpproc *proc; struct mpioapic *ioapic; - bcpu = &cpus[ncpu]; + bcpu = &cpus[0]; if((conf = mpconfig(&mp)) == 0) return; - ismp = 1; lapic = (uint*)conf->lapicaddr; - for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ switch(*p){ case MPPROC: proc = (struct mpproc*)p; - cpus[ncpu].apicid = proc->apicid; + if(ncpu != proc->apicid) { + cprintf("mpinit: ncpu=%d apicpid=%d", ncpu, proc->apicid); + panic("mpinit"); + } if(proc->flags & MPBOOT) bcpu = &cpus[ncpu]; + cpus[ncpu].id = ncpu; ncpu++; p += sizeof(struct mpproc); continue; @@ -135,7 +137,6 @@ mpinit(void) panic("mpinit"); } } - if(mp->imcrp){ // Bochs doesn't support IMCR, so this doesn't run on Bochs. // But it would on real hardware. |