summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2006-11-25 16:59:32 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2006-11-25 16:59:32 +0000
commitdf051cfcc1226d26b85f9ac9aa7c874e9c88ae81 (patch)
tree00a0ded035702cdd4370ab83ee54f5b0baec8cad /sys/dev/acpi
parentd845014b7d5a3b3cdb5441166055f3dea7ea5f56 (diff)
sync amd64 to i386 w.r.t. acpi support. Also fix interrupt routing for multi-ioapic systems.
ok kettenis
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpimadt.c14
-rw-r--r--sys/dev/acpi/acpiprt.c9
2 files changed, 19 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c
index 73dafb46921..b10b3a48177 100644
--- a/sys/dev/acpi/acpimadt.c
+++ b/sys/dev/acpi/acpimadt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpimadt.c,v 1.2 2006/11/20 21:55:23 jordan Exp $ */
+/* $OpenBSD: acpimadt.c,v 1.3 2006/11/25 16:59:31 niklas Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -154,9 +154,11 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
caa.caa_name = "cpu";
caa.cpu_number = entry->madt_lapic.apic_id;
caa.cpu_func = &mp_cpu_funcs;
+#ifdef __i386__
extern int cpu_id, cpu_feature;
caa.cpu_signature = cpu_id;
caa.feature_flags = cpu_feature;
+#endif
config_found(mainbus, &caa, acpimadt_print);
}
@@ -208,8 +210,13 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
return;
memset(map, 0, sizeof *map);
+ map->ioapic = apic;
+ map->ioapic_pin = pin - apic->sc_apic_vecbase;
map->bus_pin = entry->madt_override.source;
map->flags = entry->madt_override.flags;
+#ifdef __amd64__ /* XXX */
+ map->global_int = entry->madt_override.global_int;
+#endif
acpimadt_cfg_intr(entry->madt_override.flags, &map->redir);
map->ioapic_ih = APIC_INT_VIA_APIC |
@@ -238,7 +245,12 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
return;
memset(map, 0, sizeof *map);
+ map->ioapic = apic;
+ map->ioapic_pin = pin;
map->bus_pin = pin;
+#ifdef __amd64__ /* XXX */
+ map->global_int = -1;
+#endif
map->redir = (IOAPIC_REDLO_DEL_LOPRI << IOAPIC_REDLO_DEL_SHIFT);
map->ioapic_ih = APIC_INT_VIA_APIC |
diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c
index a2c6fdcf259..235cbda90cb 100644
--- a/sys/dev/acpi/acpiprt.c
+++ b/sys/dev/acpi/acpiprt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiprt.c,v 1.1 2006/11/15 21:39:06 kettenis Exp $ */
+/* $OpenBSD: acpiprt.c,v 1.2 2006/11/25 16:59:31 niklas Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -166,14 +166,17 @@ acpiprt_prt_add(struct acpiprt_softc *sc, struct aml_value *v)
#endif
memset(map, 0, sizeof *map);
+ map->ioapic = apic;
+ map->ioapic_pin = irq - apic->sc_apic_vecbase;
map->bus_pin = ((addr >> 14) & 0x7c) | (pin & 0x3);
map->redir = IOAPIC_REDLO_ACTLO | IOAPIC_REDLO_LEVEL;
map->redir |= (IOAPIC_REDLO_DEL_LOPRI << IOAPIC_REDLO_DEL_SHIFT);
map->ioapic_ih = APIC_INT_VIA_APIC |
- ((apic->sc_apicid << APIC_INT_APIC_SHIFT) | (irq << APIC_INT_PIN_SHIFT));
+ ((apic->sc_apicid << APIC_INT_APIC_SHIFT) |
+ (map->ioapic_pin << APIC_INT_PIN_SHIFT));
- apic->sc_pins[irq].ip_map = map;
+ apic->sc_pins[map->ioapic_pin].ip_map = map;
map->next = mp_busses[sc->sc_bus].mb_intrs;
mp_busses[sc->sc_bus].mb_intrs = map;