From a6291d555883e78e52ee005ce62515e32dc1ffe8 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Wed, 26 Jan 2000 01:32:51 +0000 Subject: [PATCH] Correctly initialise the available IRQ numbers in the APIC_IO case. IRQ 2 was being unilaterally disallowed, which is only appropriate if the interrupt hardware is the traditional chained PIC arrangement. Reviewed by: tegge (in principle) --- sys/amd64/amd64/legacy.c | 21 ++++++++++++--------- sys/amd64/amd64/nexus.c | 21 ++++++++++++--------- sys/i386/i386/legacy.c | 21 ++++++++++++--------- sys/i386/i386/nexus.c | 21 ++++++++++++--------- 4 files changed, 48 insertions(+), 36 deletions(-) diff --git a/sys/amd64/amd64/legacy.c b/sys/amd64/amd64/legacy.c index 11193eb8e44..f5554f8beac 100644 --- a/sys/amd64/amd64/legacy.c +++ b/sys/amd64/amd64/legacy.c @@ -122,12 +122,6 @@ static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#ifdef APIC_IO -#define LASTIRQ (NINTR - 1) -#else -#define LASTIRQ 15 -#endif - static int nexus_probe(device_t dev) { @@ -140,15 +134,24 @@ nexus_probe(device_t dev) * multi-ISA-bus systems. PCI interrupts are routed to the ISA * component, so in a way, PCI can be a partial child of an ISA bus(!). * APIC interrupts are global though. + * In the non-APIC case, disallow the use of IRQ 2. */ irq_rman.rm_start = 0; - irq_rman.rm_end = LASTIRQ; irq_rman.rm_type = RMAN_ARRAY; irq_rman.rm_descr = "Interrupt request lines"; +#ifdef APIC_IO + irq_rman.rm_end = APIC_INTMAPSIZE - 1; if (rman_init(&irq_rman) - || rman_manage_region(&irq_rman, 0, 1) - || rman_manage_region(&irq_rman, 3, LASTIRQ)) + || rman_manage_region(&irq_rman, + irq_rman.rm_start, irq_rman.rm_end)) panic("nexus_probe irq_rman"); +#else + irq_rman.rm_end = 15; + if (rman_init(&irq_rman) + || rman_manage_region(&irq_rman, irq_rman.rm_start, 1) + || rman_manage_region(&irq_rman, 3, irq_rman.rm_end)) + panic("nexus_probe irq_rman"); +#endif /* * ISA DMA on PCI systems is implemented in the ISA part of each diff --git a/sys/amd64/amd64/nexus.c b/sys/amd64/amd64/nexus.c index 11193eb8e44..f5554f8beac 100644 --- a/sys/amd64/amd64/nexus.c +++ b/sys/amd64/amd64/nexus.c @@ -122,12 +122,6 @@ static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#ifdef APIC_IO -#define LASTIRQ (NINTR - 1) -#else -#define LASTIRQ 15 -#endif - static int nexus_probe(device_t dev) { @@ -140,15 +134,24 @@ nexus_probe(device_t dev) * multi-ISA-bus systems. PCI interrupts are routed to the ISA * component, so in a way, PCI can be a partial child of an ISA bus(!). * APIC interrupts are global though. + * In the non-APIC case, disallow the use of IRQ 2. */ irq_rman.rm_start = 0; - irq_rman.rm_end = LASTIRQ; irq_rman.rm_type = RMAN_ARRAY; irq_rman.rm_descr = "Interrupt request lines"; +#ifdef APIC_IO + irq_rman.rm_end = APIC_INTMAPSIZE - 1; if (rman_init(&irq_rman) - || rman_manage_region(&irq_rman, 0, 1) - || rman_manage_region(&irq_rman, 3, LASTIRQ)) + || rman_manage_region(&irq_rman, + irq_rman.rm_start, irq_rman.rm_end)) panic("nexus_probe irq_rman"); +#else + irq_rman.rm_end = 15; + if (rman_init(&irq_rman) + || rman_manage_region(&irq_rman, irq_rman.rm_start, 1) + || rman_manage_region(&irq_rman, 3, irq_rman.rm_end)) + panic("nexus_probe irq_rman"); +#endif /* * ISA DMA on PCI systems is implemented in the ISA part of each diff --git a/sys/i386/i386/legacy.c b/sys/i386/i386/legacy.c index 11193eb8e44..f5554f8beac 100644 --- a/sys/i386/i386/legacy.c +++ b/sys/i386/i386/legacy.c @@ -122,12 +122,6 @@ static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#ifdef APIC_IO -#define LASTIRQ (NINTR - 1) -#else -#define LASTIRQ 15 -#endif - static int nexus_probe(device_t dev) { @@ -140,15 +134,24 @@ nexus_probe(device_t dev) * multi-ISA-bus systems. PCI interrupts are routed to the ISA * component, so in a way, PCI can be a partial child of an ISA bus(!). * APIC interrupts are global though. + * In the non-APIC case, disallow the use of IRQ 2. */ irq_rman.rm_start = 0; - irq_rman.rm_end = LASTIRQ; irq_rman.rm_type = RMAN_ARRAY; irq_rman.rm_descr = "Interrupt request lines"; +#ifdef APIC_IO + irq_rman.rm_end = APIC_INTMAPSIZE - 1; if (rman_init(&irq_rman) - || rman_manage_region(&irq_rman, 0, 1) - || rman_manage_region(&irq_rman, 3, LASTIRQ)) + || rman_manage_region(&irq_rman, + irq_rman.rm_start, irq_rman.rm_end)) panic("nexus_probe irq_rman"); +#else + irq_rman.rm_end = 15; + if (rman_init(&irq_rman) + || rman_manage_region(&irq_rman, irq_rman.rm_start, 1) + || rman_manage_region(&irq_rman, 3, irq_rman.rm_end)) + panic("nexus_probe irq_rman"); +#endif /* * ISA DMA on PCI systems is implemented in the ISA part of each diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index 11193eb8e44..f5554f8beac 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -122,12 +122,6 @@ static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#ifdef APIC_IO -#define LASTIRQ (NINTR - 1) -#else -#define LASTIRQ 15 -#endif - static int nexus_probe(device_t dev) { @@ -140,15 +134,24 @@ nexus_probe(device_t dev) * multi-ISA-bus systems. PCI interrupts are routed to the ISA * component, so in a way, PCI can be a partial child of an ISA bus(!). * APIC interrupts are global though. + * In the non-APIC case, disallow the use of IRQ 2. */ irq_rman.rm_start = 0; - irq_rman.rm_end = LASTIRQ; irq_rman.rm_type = RMAN_ARRAY; irq_rman.rm_descr = "Interrupt request lines"; +#ifdef APIC_IO + irq_rman.rm_end = APIC_INTMAPSIZE - 1; if (rman_init(&irq_rman) - || rman_manage_region(&irq_rman, 0, 1) - || rman_manage_region(&irq_rman, 3, LASTIRQ)) + || rman_manage_region(&irq_rman, + irq_rman.rm_start, irq_rman.rm_end)) panic("nexus_probe irq_rman"); +#else + irq_rman.rm_end = 15; + if (rman_init(&irq_rman) + || rman_manage_region(&irq_rman, irq_rman.rm_start, 1) + || rman_manage_region(&irq_rman, 3, irq_rman.rm_end)) + panic("nexus_probe irq_rman"); +#endif /* * ISA DMA on PCI systems is implemented in the ISA part of each