summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-12-11 02:47:35 +0000
committerpeter <peter@FreeBSD.org>2003-12-11 02:47:35 +0000
commit53f83b99f5f25981464cacb932f75000645a854d (patch)
tree61795c27834428e2954bdfc28768a4b8fb7e5e03
parent7c39c3076469f905d48046dfa4d772d648562a7b (diff)
downloadFreeBSD-src-53f83b99f5f25981464cacb932f75000645a854d.zip
FreeBSD-src-53f83b99f5f25981464cacb932f75000645a854d.tar.gz
MFi386: (jhb): Deal with MAXCPU etc correctly
-rw-r--r--sys/amd64/amd64/mp_machdep.c4
-rw-r--r--sys/amd64/amd64/mptable.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 0d4ddf8..8054bf8 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -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",
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index f0a9883..a65ca0f 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -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. */
OpenPOWER on IntegriCloud