summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2007-02-22 07:39:56 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2007-02-22 07:39:56 +0000
commit009e5051018d6d02b817f085a7ad5f793399e608 (patch)
tree258fd2af0102bf926acb389eb186d448e0e671ef /sys/arch/amd64
parent623d8ad9746804f21602916862fee7f498c2c41e (diff)
Enable ACPI interrupts in APIC mode
ok marco@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/acpi_machdep.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c
index 9177b3954be..4070bd8fc13 100644
--- a/sys/arch/amd64/amd64/acpi_machdep.c
+++ b/sys/arch/amd64/amd64/acpi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_machdep.c,v 1.5 2006/11/29 11:57:27 kettenis Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.6 2007/02/22 07:39:55 jordan Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -30,6 +30,13 @@
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h>
+#include "ioapic.h"
+
+#if NIOAPIC > 0
+#include <machine/i82093var.h>
+#include <machine/mpbiosvar.h>
+#endif
+
#define ACPI_BIOS_RSDP_WINDOW_BASE 0xe0000
#define ACPI_BIOS_RSDP_WINDOW_SIZE 0x20000
@@ -150,8 +157,21 @@ void
acpi_attach_machdep(struct acpi_softc *sc)
{
#ifdef ACPI_ENABLE
- sc->sc_interrupt = intr_establish(sc->sc_fadt->sci_int, &i8259_pic,
- sc->sc_fadt->sci_int, IST_LEVEL, IPL_TTY, acpi_interrupt, sc,
- "acpi");
+ struct pic *pic;
+ int pin;
+ int irq;
+
+ pic = &i8259_pic;
+ pin = sc->sc_fadt->sci_int;
+ irq = sc->sc_fadt->sci_int;
+#if NIOAPIC > 0
+ pic = (struct pic *)ioapic_find_bybase(sc->sc_fadt->sci_int);
+ if (pic == NULL) {
+ printf("error: can't establish ACPI interrupt!\n");
+ return;
+ }
+#endif
+ sc->sc_interrupt = intr_establish(irq, pic, pin, IST_LEVEL, IPL_TTY,
+ acpi_interrupt, sc, "acpi");
#endif
}