Group: fa.openbsd.tech




Subject: acpimadt(4) diff
From: Mark Kettenis
Date: 1/10/2007 10:24:17 PM
This diff fixes some machines where the cpu with apic id 0 isn't the boot processor, but might break some other machines. Please test this if you're running GENERIC.MP with acpi enabled on i386 or amd64. Mark Index: acpimadt.c =================================================================== RCS file: /cvs/src/sys/dev/acpi/acpimadt.c,v retrieving revision 1.5 diff -u -p -r1.5 acpimadt.c --- acpimadt.c 21 Dec 2006 19:59:02 -0000 1.5 +++ acpimadt.c 10 Jan 2007 20:52:31 -0000 @@ -118,6 +118,7 @@ acpimadt_attach(struct device *parent, s caddr_t addr = (caddr_t)(madt + 1); struct mp_intr_map *map; struct ioapic_softc *apic; + int cpu_role = CPU_ROLE_BP; int pin; printf(" addr 0x%x", madt->local_apic_address); @@ -147,10 +148,7 @@ acpimadt_attach(struct device *parent, s break; memset(&caa, 0, sizeof(struct cpu_attach_args)); - if (entry->madt_lapic.apic_id == 0) - caa.cpu_role = CPU_ROLE_BP; - else - caa.cpu_role = CPU_ROLE_AP; + caa.cpu_role = cpu_role; caa.caa_name = "cpu"; caa.cpu_number = entry->madt_lapic.apic_id; caa.cpu_func = &mp_cpu_funcs; @@ -161,6 +159,8 @@ acpimadt_attach(struct device *parent, s #endif config_found(mainbus, &caa, acpimadt_print); + + cpu_role = CPU_ROLE_AP; } break; case ACPI_MADT_IOAPIC: