diff options
author | jhb <jhb@FreeBSD.org> | 2007-05-08 22:01:04 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-05-08 22:01:04 +0000 |
commit | 255387b6b7c4ffa606c4a0b6909f5e6125bc16c9 (patch) | |
tree | 92824ff91cad18a16306dcd8738835fb4975be54 /sys/i386/acpica | |
parent | 7b6b99abf6dac45f71e174a2cebfc5aa4491c92e (diff) | |
download | FreeBSD-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/i386/acpica')
-rw-r--r-- | sys/i386/acpica/madt.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/i386/acpica/madt.c b/sys/i386/acpica/madt.c index f6ebd3c..3b32d30 100644 --- a/sys/i386/acpica/madt.c +++ b/sys/i386/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); @@ -449,7 +446,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, @@ -478,7 +475,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) @@ -544,7 +541,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) @@ -565,7 +562,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; |