mp: do not panic on surprising hw
This commit is contained in:
parent
1a81e38b17
commit
af6a6a4775
1 changed files with 12 additions and 3 deletions
15
mp.c
15
mp.c
|
@ -113,9 +113,10 @@ mpinit(void)
|
||||||
switch(*p){
|
switch(*p){
|
||||||
case MPPROC:
|
case MPPROC:
|
||||||
proc = (struct mpproc*)p;
|
proc = (struct mpproc*)p;
|
||||||
|
cprintf("mpproc %d\n", proc->apicid);
|
||||||
if(ncpu != proc->apicid){
|
if(ncpu != proc->apicid){
|
||||||
cprintf("mpinit: ncpu=%d apicpid=%d\n", ncpu, proc->apicid);
|
cprintf("mpinit: ncpu=%d apicid=%d\n", ncpu, proc->apicid);
|
||||||
panic("mpinit");
|
ismp = 0;
|
||||||
}
|
}
|
||||||
if(proc->flags & MPBOOT)
|
if(proc->flags & MPBOOT)
|
||||||
bcpu = &cpus[ncpu];
|
bcpu = &cpus[ncpu];
|
||||||
|
@ -135,9 +136,17 @@ mpinit(void)
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
cprintf("mpinit: unknown config type %x\n", *p);
|
cprintf("mpinit: unknown config type %x\n", *p);
|
||||||
panic("mpinit");
|
ismp = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!ismp){
|
||||||
|
// Didn't like what we found; fall back to no MP.
|
||||||
|
ncpu = 1;
|
||||||
|
lapic = 0;
|
||||||
|
ioapicid = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(mp->imcrp){
|
if(mp->imcrp){
|
||||||
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
|
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
|
||||||
// But it would on real hardware.
|
// But it would on real hardware.
|
||||||
|
|
Loading…
Reference in a new issue