diff options
author | msmith <msmith@FreeBSD.org> | 2000-01-26 01:32:51 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 2000-01-26 01:32:51 +0000 |
commit | c7f9f556263df48aa4dabaaad3062174fc1ad252 (patch) | |
tree | ca030372a3954eb1a9328d74380a2e4e636ddbac | |
parent | 1d67bbf0a1edb35bd8c0894932111fcc25a8c23a (diff) | |
download | FreeBSD-src-c7f9f556263df48aa4dabaaad3062174fc1ad252.zip FreeBSD-src-c7f9f556263df48aa4dabaaad3062174fc1ad252.tar.gz |
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)
-rw-r--r-- | sys/amd64/amd64/legacy.c | 21 | ||||
-rw-r--r-- | sys/amd64/amd64/nexus.c | 21 | ||||
-rw-r--r-- | sys/i386/i386/legacy.c | 21 | ||||
-rw-r--r-- | 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 11193eb..f5554f8 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 11193eb..f5554f8 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 11193eb..f5554f8 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 11193eb..f5554f8 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 |