From d81080b30a89cb054e0e77e230958a9c4b134855 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 18 Jan 2005 20:27:24 +0000 Subject: [PATCH] If a valid ELCR was found, consult it for the trigger mode of ISA interrupts that have a trigger mode of conforming. This fixes problems on some older machines that still route PCI devices via ISA interrupts when using an I/O APIC. Tested by: Peter Trifonov pvtrifonov at mail dot ru MFC after: 1 month --- sys/i386/i386/io_apic.c | 2 +- sys/i386/i386/mptable.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/i386/i386/io_apic.c b/sys/i386/i386/io_apic.c index aca7d78b4713..18923e2621d5 100644 --- a/sys/i386/i386/io_apic.c +++ b/sys/i386/i386/io_apic.c @@ -423,7 +423,7 @@ ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig, * them to be set to active low. * * XXX: Should we write to the ELCR if the trigger mode changes for - * an EISA IRQ? + * an EISA IRQ or an ISA IRQ with the ELCR present? */ if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index 2026702a3dfa..d2b0c2ca3a6c 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -580,12 +580,18 @@ conforming_trigger(u_char src_bus, u_char src_bus_irq) KASSERT(src_bus <= mptable_maxbusid, ("bus id %d too large", src_bus)); switch (busses[src_bus].bus_type) { case ISA: - return (INTR_TRIGGER_EDGE); +#ifndef PC98 + if (elcr_found) + return (elcr_read_trigger(src_bus_irq)); + else +#endif + return (INTR_TRIGGER_EDGE); case PCI: return (INTR_TRIGGER_LEVEL); #ifndef PC98 case EISA: KASSERT(src_bus_irq < 16, ("Invalid EISA IRQ %d", src_bus_irq)); + KASSERT(elcr_found, ("Missing ELCR")); return (elcr_read_trigger(src_bus_irq)); #endif default: