APIC IDs may not be consecutive and start from zero, so we cannot really use it

as a direct index into cpus.  Record apicid in struct cpu and have cpunum() look
for it. Replace cpu->id with cpunum() everywhere, and replace cpu->id with cpu->apicid.
Thanks to Xi Wang.
This commit is contained in:
Frans Kaashoek 2016-09-02 08:31:13 -04:00
parent 37939f24c2
commit ae15515d80
6 changed files with 26 additions and 18 deletions

View file

@ -110,7 +110,7 @@ panic(char *s)
cli();
cons.locking = 0;
cprintf("cpu%d: panic: ", cpu->id);
cprintf("cpu with apicid %d: panic: ", cpu->apicid);
cprintf(s);
cprintf("\n");
getcallerpcs(&s, pcs);