summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpimadt.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-11-18 21:52:04 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-11-18 21:52:04 +0000
commit510f4285472b98d25ce168a5c6c705f9c5f43e47 (patch)
tree5c32eaf21b376273500eca5dbc6afb3024e57974 /sys/dev/acpi/acpimadt.c
parentf1ce453e03f3e443c0be15acf3897c357ebf9ddc (diff)
Don't add identity mappings for ISA interrupts for which we have an override.
Tested by many; seems to fix ian@'s evil Compaq, at least with GENERIC.MP.
Diffstat (limited to 'sys/dev/acpi/acpimadt.c')
-rw-r--r--sys/dev/acpi/acpimadt.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c
index 979f658afc7..f7230419249 100644
--- a/sys/dev/acpi/acpimadt.c
+++ b/sys/dev/acpi/acpimadt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpimadt.c,v 1.14 2007/11/16 16:21:05 deraadt Exp $ */
+/* $OpenBSD: acpimadt.c,v 1.15 2007/11/18 21:52:03 kettenis Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -293,11 +293,21 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
addr += entry->madt_lapic.length;
}
+ /*
+ * ISA interrupts are supposed to be identity mapped unless
+ * there is an override, in which case we will already have a
+ * mapping for the interrupt.
+ */
for (pin = 0; pin < ICU_LEN; pin++) {
- apic = ioapic_find_bybase(pin);
- if (apic->sc_pins[pin].ip_map != NULL)
+ /* Skip if we already have a mapping for this interrupt. */
+ for (map = mp_isa_bus->mb_intrs; map != NULL; map = map->next)
+ if (map->bus_pin == pin)
+ break;
+ if (map != NULL)
continue;
+ apic = ioapic_find_bybase(pin);
+
map = malloc(sizeof(*map), M_DEVBUF, M_NOWAIT | M_ZERO);
if (map == NULL)
return;