summaryrefslogtreecommitdiffstats
path: root/sys/amd64/acpica
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-05-08 22:01:04 +0000
committerjhb <jhb@FreeBSD.org>2007-05-08 22:01:04 +0000
commit255387b6b7c4ffa606c4a0b6909f5e6125bc16c9 (patch)
tree92824ff91cad18a16306dcd8738835fb4975be54 /sys/amd64/acpica
parent7b6b99abf6dac45f71e174a2cebfc5aa4491c92e (diff)
downloadFreeBSD-src-255387b6b7c4ffa606c4a0b6909f5e6125bc16c9.zip
FreeBSD-src-255387b6b7c4ffa606c4a0b6909f5e6125bc16c9.tar.gz
Handle CPUs with APIC IDs higher than 32 (at least one IBM server uses
an APIC ID of 38 for its second CPU): - Add a new MAX_APIC_ID constant for the highest valid APIC ID for modern systems. - Size the various arrays in the MADT, MP Table, and SMP code that are indexed by APIC IDs to allow for up to MAX_APIC_ID. - Explicitly go through and assign logical cpu ids to local APICs before starting any of the APs up rather than doing it while starting up the APs. This step is now where we honor MAXCPU. MFC after: 1 week
Diffstat (limited to 'sys/amd64/acpica')
-rw-r--r--sys/amd64/acpica/madt.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/amd64/acpica/madt.c b/sys/amd64/acpica/madt.c
index becc2ab..fcd40c8 100644
--- a/sys/amd64/acpica/madt.c
+++ b/sys/amd64/acpica/madt.c
@@ -53,21 +53,18 @@ __FBSDID("$FreeBSD$");
#include <dev/acpica/acpivar.h>
#include <dev/pci/pcivar.h>
-#define NIOAPICS 32 /* Max number of I/O APICs */
-#define NLAPICS 32 /* Max number of local APICs */
-
typedef void madt_entry_handler(ACPI_SUBTABLE_HEADER *entry, void *arg);
/* These two arrays are indexed by APIC IDs. */
struct ioapic_info {
void *io_apic;
UINT32 io_vector;
-} ioapics[NIOAPICS];
+} ioapics[MAX_APIC_ID + 1];
struct lapic_info {
u_int la_enabled:1;
u_int la_acpi_id:8;
-} lapics[NLAPICS];
+} lapics[MAX_APIC_ID + 1];
static int madt_found_sci_override;
static ACPI_TABLE_MADT *madt;
@@ -393,7 +390,7 @@ madt_setup_io(void)
}
/* Third, we register all the I/O APIC's. */
- for (i = 0; i < NIOAPICS; i++)
+ for (i = 0; i <= MAX_APIC_ID; i++)
if (ioapics[i].io_apic != NULL)
ioapic_register(ioapics[i].io_apic);
@@ -450,7 +447,7 @@ madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
"enabled" : "disabled");
if (!(proc->LapicFlags & ACPI_MADT_ENABLED))
break;
- if (proc->Id >= NLAPICS)
+ if (proc->Id > MAX_APIC_ID)
panic("%s: CPU ID %u too high", __func__, proc->Id);
la = &lapics[proc->Id];
KASSERT(la->la_enabled == 0,
@@ -479,7 +476,7 @@ madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *arg __unused)
"MADT: Found IO APIC ID %u, Interrupt %u at %p\n",
apic->Id, apic->GlobalIrqBase,
(void *)(uintptr_t)apic->Address);
- if (apic->Id >= NIOAPICS)
+ if (apic->Id > MAX_APIC_ID)
panic("%s: I/O APIC ID %u too high", __func__,
apic->Id);
if (ioapics[apic->Id].io_apic != NULL)
@@ -545,7 +542,7 @@ madt_find_cpu(u_int acpi_id, u_int *apic_id)
{
int i;
- for (i = 0; i < NLAPICS; i++) {
+ for (i = 0; i <= MAX_APIC_ID; i++) {
if (!lapics[i].la_enabled)
continue;
if (lapics[i].la_acpi_id != acpi_id)
@@ -566,7 +563,7 @@ madt_find_interrupt(int intr, void **apic, u_int *pin)
int i, best;
best = -1;
- for (i = 0; i < NIOAPICS; i++) {
+ for (i = 0; i <= MAX_APIC_ID; i++) {
if (ioapics[i].io_apic == NULL ||
ioapics[i].io_vector > intr)
continue;
OpenPOWER on IntegriCloud