- Always allocate the maximum size for the IRQ resource manager. Ideally

we would manage this better by having the interrupt code add each
  interrupt vector to the resource map when each source is registered.
- Use the new interrupt code API for registering and tearing down interrupt
  handlers.
This commit is contained in:
jhb 2003-11-03 22:36:43 +00:00
parent b9072d94e6
commit 2a63f6f972

View File

@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/module.h>
#include <machine/bus.h>
#include <machine/intr_machdep.h>
#include <sys/rman.h>
#include <sys/interrupt.h>
@ -59,10 +60,6 @@ __FBSDID("$FreeBSD$");
#include <machine/pmap.h>
#include <machine/resource.h>
#ifdef APIC_IO
#include <machine/smp.h>
#include <machine/mpapic.h>
#endif
#ifdef DEV_ISA
#include <isa/isavar.h>
@ -72,8 +69,6 @@ __FBSDID("$FreeBSD$");
#include <i386/isa/isa.h>
#endif
#endif
#include <i386/isa/icu.h>
#include <i386/isa/intr_machdep.h>
#include <sys/rtprio.h>
static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
@ -164,18 +159,11 @@ 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.
*
* XXX We depend on the AT PIC driver correctly claiming IRQ 2
* to prevent its reuse elsewhere in the !APIC_IO case.
*/
irq_rman.rm_start = 0;
irq_rman.rm_type = RMAN_ARRAY;
irq_rman.rm_descr = "Interrupt request lines";
#ifdef APIC_IO
irq_rman.rm_end = APIC_INTMAPSIZE - 1;
#else
irq_rman.rm_end = 15;
#endif
irq_rman.rm_end = NUM_IO_INTS - 1;
if (rman_init(&irq_rman)
|| rman_manage_region(&irq_rman,
irq_rman.rm_start, irq_rman.rm_end))
@ -474,7 +462,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
if (error)
return (error);
error = inthand_add(device_get_nameunit(child), irq->r_start,
error = intr_add_handler(device_get_nameunit(child), irq->r_start,
ihand, arg, flags, cookiep);
return (error);
@ -483,7 +471,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
static int
nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih)
{
return (inthand_remove(ih));
return (intr_remove_handler(ih));
}
static int