summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-01-11 22:01:06 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-01-11 22:01:06 +0000
commit8690b38de9e7834cf7b150c7f53c53affa1ab3f0 (patch)
treefe889ff28fd6a8808d7617b049a53633460d7857 /sys/dev/acpi
parent261fa8338cdc6b1b98f0bec2fe564fc5008c87b5 (diff)
Assume that the first cpu in the table is the boot processor, instead of
the cpu with apic id 0. tested by many
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpimadt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c
index e7a339c77b9..b8bb052b176 100644
--- a/sys/dev/acpi/acpimadt.c
+++ b/sys/dev/acpi/acpimadt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpimadt.c,v 1.5 2006/12/21 19:59:02 deraadt Exp $ */
+/* $OpenBSD: acpimadt.c,v 1.6 2007/01/11 22:01:05 kettenis Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -118,6 +118,7 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
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, struct device *self, void *aux)
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, struct device *self, void *aux)
#endif
config_found(mainbus, &caa, acpimadt_print);
+
+ cpu_role = CPU_ROLE_AP;
}
break;
case ACPI_MADT_IOAPIC: