From 47ce2ca68d921981e418a9ab1f56760d8460603c Mon Sep 17 00:00:00 2001 From: Alexander Polakov Date: Fri, 16 Oct 2009 21:55:00 +0400 Subject: [PATCH] acpi_pcib: Remove APIC case, moving into nexus. --- sys/dev/acpica5/acpi_pcib.c | 22 ---------------------- sys/platform/pc32/i386/nexus.c | 22 ++++++++++++++++++++-- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/sys/dev/acpica5/acpi_pcib.c b/sys/dev/acpica5/acpi_pcib.c index b25fdfe72f..03ffaf9f9f 100644 --- a/sys/dev/acpica5/acpi_pcib.c +++ b/sys/dev/acpica5/acpi_pcib.c @@ -259,28 +259,6 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin, pci_get_slot(dev), 'A' + pin, prt->SourceIndex); if (prt->SourceIndex) { interrupt = prt->SourceIndex; -#if defined(APIC_IO) - int line; - line = pci_apic_irq(pci_get_bus(dev), pci_get_slot(dev), pin+1, interrupt); - if (line >= 0) { -kprintf("apic: try line %d\n", line); - return line; - } else { - int irq = pci_get_irq(dev); - - /* - * PCI interrupts might be redirected to the - * ISA bus according to some MP tables. Use the - * same methods as used by the ISA devices - * devices to find the proper IOAPIC int pin. - */ - kprintf("ACPI: Try routing through ISA bus for " - "bus %d slot %d INT%c irq %d\n", - pci_get_bus(dev), pci_get_slot(dev), 'A' + pin+1, irq); - line = isa_apic_irq(irq); - } - interrupt = line; -#endif pci_write_config(dev, PCIR_INTLINE, interrupt, 1); BUS_CONFIG_INTR(device_get_parent(dev), dev, interrupt, INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 32f65aaa67..95c80f7f4b 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -59,6 +59,14 @@ #include #include +#include +#include +#include +#include +#include + +#include "pcib_if.h" + static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { struct resource_list nx_resources; @@ -468,8 +476,18 @@ static int nexus_config_intr(device_t dev, device_t child, int irq, enum intr_trigger trig, enum intr_polarity pol) { - kprintf("%s(%s): irq: %d, trigger: %d, polarity: %d\n", __FUNCTION__, device_get_nameunit(child), irq, trig, pol); - return(0); +#ifdef APIC_IO + int line; + kprintf("%s(%s): irq: %d, trigger: %d, polarity: %d\n", __FUNCTION__, device_get_nameunit(dev), irq, trig, pol); + line = pci_apic_irq(pci_get_bus(child), pci_get_slot(child), irq); + if(line >= 0) + return line; + line = isa_apic_irq(pci_get_irq(child)); + + return(line); +#else + return irq; +#endif } /* -- 2.41.0