MFi386: (jhb): Deal with MAXCPU etc correctly

This commit is contained in:
Peter Wemm 2003-12-11 02:47:35 +00:00
parent 65365aa0c6
commit bf342084e5
2 changed files with 4 additions and 4 deletions

View File

@ -163,9 +163,9 @@ void
cpu_add(u_int apic_id, char boot_cpu)
{
if (apic_id > MAXCPU) {
if (apic_id >= MAXCPU) {
printf("SMP: CPU %d exceeds maximum CPU %d, ignoring\n",
apic_id, MAXCPU);
apic_id, MAXCPU - 1);
return;
}
KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %d added twice",

View File

@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
/* string defined by the Intel MP Spec as identifying the MP table */
#define MP_SIG 0x5f504d5f /* _MP_ */
#define NAPICID 32 /* Max number of I/O APIC's */
#define NAPICID 32 /* Max number of APIC's */
#define BIOS_BASE (0xf0000)
#define BIOS_SIZE (0x10000)
@ -811,7 +811,7 @@ mptable_hyperthread_fixup(u_int id_mask)
* physical processor. If any of those ID's are
* already in the table, then kill the fixup.
*/
for (id = 0; id <= MAXCPU; id++) {
for (id = 0; id < NAPICID; id++) {
if ((id_mask & 1 << id) == 0)
continue;
/* First, make sure we are on a logical_cpus boundary. */