summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/intr_machdep.c14
-rw-r--r--sys/amd64/amd64/nexus.c8
-rw-r--r--sys/amd64/include/intr_machdep.h5
-rw-r--r--sys/amd64/isa/clock.c16
-rw-r--r--sys/amd64/isa/isa.c5
-rw-r--r--sys/arm/arm/intr.c10
-rw-r--r--sys/arm/arm/nexus.c6
-rw-r--r--sys/arm/at91/at91.c6
-rw-r--r--sys/arm/at91/at91_mci.c2
-rw-r--r--sys/arm/at91/at91_pio.c10
-rw-r--r--sys/arm/at91/at91_rtc.c8
-rw-r--r--sys/arm/at91/at91_spi.c2
-rw-r--r--sys/arm/at91/at91_ssc.c2
-rw-r--r--sys/arm/at91/at91_st.c8
-rw-r--r--sys/arm/at91/at91_twi.c2
-rw-r--r--sys/arm/at91/if_ate.c2
-rw-r--r--sys/arm/include/intr.h4
-rw-r--r--sys/arm/sa11x0/sa11x0.c8
-rw-r--r--sys/arm/sa11x0/sa11x0_ost.c15
-rw-r--r--sys/arm/xscale/i80321/i80321_pci.c6
-rw-r--r--sys/arm/xscale/i80321/i80321_timer.c10
-rw-r--r--sys/arm/xscale/i80321/iq80321.c8
-rw-r--r--sys/arm/xscale/ixp425/ixp425.c8
-rw-r--r--sys/arm/xscale/ixp425/ixp425_npe.c2
-rw-r--r--sys/arm/xscale/ixp425/ixp425_pci.c4
-rw-r--r--sys/arm/xscale/ixp425/ixp425_timer.c9
-rw-r--r--sys/compat/ndis/kern_ndis.c2
-rw-r--r--sys/contrib/dev/oltr/if_oltr.c2
-rw-r--r--sys/dev/aac/aac.c12
-rw-r--r--sys/dev/aac/aacvar.h2
-rw-r--r--sys/dev/acpica/Osd/OsdInterrupt.c2
-rw-r--r--sys/dev/adlink/adlink.c16
-rw-r--r--sys/dev/advansys/adv_eisa.c3
-rw-r--r--sys/dev/advansys/adv_isa.c2
-rw-r--r--sys/dev/advansys/adv_pci.c3
-rw-r--r--sys/dev/advansys/adwcam.c4
-rw-r--r--sys/dev/aha/aha_isa.c2
-rw-r--r--sys/dev/ahb/ahb.c3
-rw-r--r--sys/dev/aic/aic_cbus.c2
-rw-r--r--sys/dev/aic/aic_isa.c2
-rw-r--r--sys/dev/aic/aic_pccard.c2
-rw-r--r--sys/dev/aic7xxx/aic79xx_osm.c2
-rw-r--r--sys/dev/aic7xxx/aic7xxx_osm.c2
-rw-r--r--sys/dev/amd/amd.c2
-rw-r--r--sys/dev/amr/amr_pci.c2
-rw-r--r--sys/dev/an/if_an_isa.c2
-rw-r--r--sys/dev/an/if_an_pccard.c2
-rw-r--r--sys/dev/an/if_an_pci.c2
-rw-r--r--sys/dev/ar/if_ar.c2
-rw-r--r--sys/dev/arcmsr/arcmsr.c2
-rw-r--r--sys/dev/arl/if_arl_isa.c2
-rw-r--r--sys/dev/asr/asr.c2
-rw-r--r--sys/dev/ata/ata-all.c2
-rw-r--r--sys/dev/ata/ata-cbus.c10
-rw-r--r--sys/dev/ata/ata-chipset.c6
-rw-r--r--sys/dev/ata/ata-pci.c10
-rw-r--r--sys/dev/ata/ata-pci.h2
-rw-r--r--sys/dev/ath/if_ath_pci.c2
-rw-r--r--sys/dev/atkbdc/atkbd_atkbdc.c2
-rw-r--r--sys/dev/atkbdc/psm.c2
-rw-r--r--sys/dev/awi/if_awi_pccard.c2
-rw-r--r--sys/dev/bce/if_bce.c2
-rw-r--r--sys/dev/bfe/if_bfe.c2
-rw-r--r--sys/dev/bge/if_bge.c2
-rw-r--r--sys/dev/bktr/bktr_os.c2
-rw-r--r--sys/dev/buslogic/bt.c2
-rw-r--r--sys/dev/ce/if_ce.c2
-rw-r--r--sys/dev/ciss/ciss.c2
-rw-r--r--sys/dev/cm/if_cm_isa.c2
-rw-r--r--sys/dev/cp/if_cp.c2
-rw-r--r--sys/dev/cs/if_cs_isa.c2
-rw-r--r--sys/dev/cs/if_cs_pccard.c2
-rw-r--r--sys/dev/ct/ct_isa.c2
-rw-r--r--sys/dev/ctau/if_ct.c2
-rw-r--r--sys/dev/cx/if_cx.c2
-rw-r--r--sys/dev/cy/cy.c5
-rw-r--r--sys/dev/cy/cy_isa.c4
-rw-r--r--sys/dev/cy/cy_pci.c6
-rw-r--r--sys/dev/cy/cyvar.h2
-rw-r--r--sys/dev/dc/if_dc.c2
-rw-r--r--sys/dev/de/if_de.c2
-rw-r--r--sys/dev/dpt/dpt_eisa.c2
-rw-r--r--sys/dev/dpt/dpt_pci.c2
-rw-r--r--sys/dev/drm/drm_irq.c2
-rw-r--r--sys/dev/ed/if_ed_cbus.c2
-rw-r--r--sys/dev/ed/if_ed_isa.c2
-rw-r--r--sys/dev/ed/if_ed_pccard.c2
-rw-r--r--sys/dev/ed/if_ed_pci.c2
-rw-r--r--sys/dev/em/if_em.c17
-rw-r--r--sys/dev/en/if_en_pci.c2
-rw-r--r--sys/dev/ep/if_ep_eisa.c4
-rw-r--r--sys/dev/ep/if_ep_isa.c4
-rw-r--r--sys/dev/ep/if_ep_pccard.c2
-rw-r--r--sys/dev/esp/esp_sbus.c2
-rw-r--r--sys/dev/ex/if_ex_isa.c2
-rw-r--r--sys/dev/ex/if_ex_pccard.c2
-rw-r--r--sys/dev/fatm/if_fatm.c2
-rw-r--r--sys/dev/fdc/fdc.c17
-rw-r--r--sys/dev/fe/if_fe.c2
-rw-r--r--sys/dev/firewire/fwohci_pci.c2
-rw-r--r--sys/dev/fxp/if_fxp.c2
-rw-r--r--sys/dev/gem/if_gem_pci.c2
-rw-r--r--sys/dev/hatm/if_hatm.c2
-rw-r--r--sys/dev/hfa/hfa_pci.c2
-rw-r--r--sys/dev/hifn/hifn7751.c2
-rw-r--r--sys/dev/hme/if_hme_pci.c2
-rw-r--r--sys/dev/hme/if_hme_sbus.c2
-rw-r--r--sys/dev/hptmv/entry.c2
-rw-r--r--sys/dev/ichsmb/ichsmb.c2
-rw-r--r--sys/dev/ida/ida_eisa.c2
-rw-r--r--sys/dev/ida/ida_pci.c2
-rw-r--r--sys/dev/idt/idt_pci.c2
-rw-r--r--sys/dev/ie/if_ie_isa.c6
-rw-r--r--sys/dev/iir/iir_pci.c2
-rw-r--r--sys/dev/ipmi/ipmi.c2
-rw-r--r--sys/dev/ips/ips_pci.c3
-rw-r--r--sys/dev/ipw/if_ipw.c2
-rw-r--r--sys/dev/isp/isp_pci.c2
-rw-r--r--sys/dev/isp/isp_sbus.c2
-rw-r--r--sys/dev/iwi/if_iwi.c2
-rw-r--r--sys/dev/ixgb/if_ixgb.c2
-rw-r--r--sys/dev/le/if_le_cbus.c2
-rw-r--r--sys/dev/le/if_le_isa.c2
-rw-r--r--sys/dev/le/if_le_lebuffer.c2
-rw-r--r--sys/dev/le/if_le_ledma.c2
-rw-r--r--sys/dev/le/if_le_pci.c2
-rw-r--r--sys/dev/lge/if_lge.c2
-rw-r--r--sys/dev/lmc/if_lmc.c2
-rw-r--r--sys/dev/mfi/mfi.c2
-rw-r--r--sys/dev/mlx/mlx.c2
-rw-r--r--sys/dev/mly/mly.c2
-rw-r--r--sys/dev/mpt/mpt_pci.c2
-rw-r--r--sys/dev/mse/mse.c2
-rw-r--r--sys/dev/msk/if_msk.c9
-rw-r--r--sys/dev/mxge/if_mxge.c2
-rw-r--r--sys/dev/my/if_my.c2
-rw-r--r--sys/dev/ncv/ncr53c500_pccard.c2
-rw-r--r--sys/dev/nfe/if_nfe.c2
-rw-r--r--sys/dev/nge/if_nge.c2
-rw-r--r--sys/dev/nsp/nsp_pccard.c2
-rw-r--r--sys/dev/nve/if_nve.c2
-rw-r--r--sys/dev/patm/if_patm_attach.c2
-rw-r--r--sys/dev/pccard/pccard.c31
-rw-r--r--sys/dev/pccard/pccardvarp.h1
-rw-r--r--sys/dev/pccbb/pccbb.c7
-rw-r--r--sys/dev/pccbb/pccbb_pci.c2
-rw-r--r--sys/dev/pccbb/pccbbvar.h3
-rw-r--r--sys/dev/pcf/envctrl.c2
-rw-r--r--sys/dev/pcf/pcf_ebus.c2
-rw-r--r--sys/dev/pcf/pcf_isa.c2
-rw-r--r--sys/dev/ppbus/if_plip.c2
-rw-r--r--sys/dev/ppbus/lpt.c2
-rw-r--r--sys/dev/ppbus/ppbconf.c4
-rw-r--r--sys/dev/ppbus/pps.c9
-rw-r--r--sys/dev/ppc/ppc.c8
-rw-r--r--sys/dev/ppc/ppcvar.h2
-rw-r--r--sys/dev/pst/pst-iop.c2
-rw-r--r--sys/dev/puc/puc.c22
-rw-r--r--sys/dev/puc/puc_bfe.h2
-rw-r--r--sys/dev/ral/if_ral_pci.c2
-rw-r--r--sys/dev/ray/if_ray.c2
-rw-r--r--sys/dev/rc/rc.c4
-rw-r--r--sys/dev/re/if_re.c12
-rw-r--r--sys/dev/rr232x/osm_bsd.c2
-rw-r--r--sys/dev/safe/safe.c2
-rw-r--r--sys/dev/sbni/if_sbni_isa.c2
-rw-r--r--sys/dev/sbni/if_sbni_pci.c2
-rw-r--r--sys/dev/sbsh/if_sbsh.c2
-rw-r--r--sys/dev/scc/scc_bfe.h4
-rw-r--r--sys/dev/scc/scc_core.c24
-rw-r--r--sys/dev/sf/if_sf.c2
-rw-r--r--sys/dev/sio/sio.c12
-rw-r--r--sys/dev/sk/if_sk.c2
-rw-r--r--sys/dev/sn/if_sn.c3
-rw-r--r--sys/dev/snc/if_snc_cbus.c2
-rw-r--r--sys/dev/snc/if_snc_pccard.c2
-rw-r--r--sys/dev/sound/isa/gusc.c10
-rw-r--r--sys/dev/sound/isa/sbc.c12
-rw-r--r--sys/dev/sound/pci/csa.c10
-rw-r--r--sys/dev/sound/pci/emu10kx.c2
-rw-r--r--sys/dev/sound/pci/vibes.c2
-rw-r--r--sys/dev/sound/pcm/sound.c2
-rw-r--r--sys/dev/sr/if_sr.c2
-rw-r--r--sys/dev/stg/tmc18c30_isa.c2
-rw-r--r--sys/dev/stg/tmc18c30_pccard.c2
-rw-r--r--sys/dev/stg/tmc18c30_pci.c2
-rw-r--r--sys/dev/stge/if_stge.c2
-rw-r--r--sys/dev/sym/sym_hipd.c2
-rw-r--r--sys/dev/ti/if_ti.c2
-rw-r--r--sys/dev/trm/trm.c2
-rw-r--r--sys/dev/twa/tw_osl_freebsd.c44
-rw-r--r--sys/dev/twe/twe_freebsd.c3
-rw-r--r--sys/dev/tx/if_tx.c2
-rw-r--r--sys/dev/txp/if_txp.c2
-rw-r--r--sys/dev/uart/uart_core.c14
-rw-r--r--sys/dev/ubsec/ubsec.c2
-rw-r--r--sys/dev/usb/ehci_pci.c2
-rw-r--r--sys/dev/usb/ohci_pci.c4
-rw-r--r--sys/dev/usb/uhci_pci.c2
-rw-r--r--sys/dev/vge/if_vge.c2
-rw-r--r--sys/dev/vr/if_vr.c2
-rw-r--r--sys/dev/vx/if_vx_eisa.c4
-rw-r--r--sys/dev/vx/if_vx_pci.c2
-rw-r--r--sys/dev/wi/if_wi.c2
-rw-r--r--sys/dev/xe/if_xe.c4
-rw-r--r--sys/i386/i386/intr_machdep.c12
-rw-r--r--sys/i386/i386/nexus.c8
-rw-r--r--sys/i386/include/intr_machdep.h4
-rw-r--r--sys/i386/isa/clock.c14
-rw-r--r--sys/i386/isa/isa.c5
-rw-r--r--sys/i386/isa/npx.c9
-rw-r--r--sys/ia64/ia64/interrupt.c13
-rw-r--r--sys/ia64/ia64/nexus.c8
-rw-r--r--sys/ia64/include/intr.h6
-rw-r--r--sys/isa/atrtc.c14
-rw-r--r--sys/isa/isa_common.h3
-rw-r--r--sys/kern/bus_if.m1
-rw-r--r--sys/kern/kern_intr.c25
-rw-r--r--sys/kern/subr_bus.c21
-rw-r--r--sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c2
-rw-r--r--sys/pc98/cbus/clock.c7
-rw-r--r--sys/pc98/cbus/fdc.c2
-rw-r--r--sys/pc98/cbus/pckbd.c2
-rw-r--r--sys/pc98/cbus/pcrtc.c7
-rw-r--r--sys/pc98/cbus/sio.c12
-rw-r--r--sys/pci/if_pcn.c2
-rw-r--r--sys/pci/if_rl.c2
-rw-r--r--sys/pci/if_sf.c2
-rw-r--r--sys/pci/if_sis.c2
-rw-r--r--sys/pci/if_ste.c2
-rw-r--r--sys/pci/if_tl.c2
-rw-r--r--sys/pci/if_vr.c2
-rw-r--r--sys/pci/if_wb.c2
-rw-r--r--sys/pci/if_xl.c2
-rw-r--r--sys/pci/intpm.c4
-rw-r--r--sys/powerpc/include/intr_machdep.h4
-rw-r--r--sys/powerpc/include/openpicvar.h4
-rw-r--r--sys/powerpc/powermac/hrowpic.c9
-rw-r--r--sys/powerpc/powerpc/intr_machdep.c12
-rw-r--r--sys/powerpc/powerpc/openpic.c5
-rw-r--r--sys/sparc64/fhc/fhc.c22
-rw-r--r--sys/sparc64/include/intr_machdep.h4
-rw-r--r--sys/sparc64/isa/isa.c8
-rw-r--r--sys/sparc64/pci/psycho.c87
-rw-r--r--sys/sparc64/sbus/sbus.c40
-rw-r--r--sys/sparc64/sparc64/intr_machdep.c16
-rw-r--r--sys/sparc64/sparc64/nexus.c4
-rw-r--r--sys/sparc64/sparc64/upa.c4
-rw-r--r--sys/sun4v/include/intr_machdep.h4
-rw-r--r--sys/sun4v/sun4v/hvcons.c2
-rw-r--r--sys/sun4v/sun4v/intr_machdep.c30
-rw-r--r--sys/sun4v/sun4v/nexus.c4
-rw-r--r--sys/sun4v/sun4v/vnex.c4
-rw-r--r--sys/sys/bus.h43
-rw-r--r--sys/sys/interrupt.h8
255 files changed, 781 insertions, 575 deletions
diff --git a/sys/amd64/amd64/intr_machdep.c b/sys/amd64/amd64/intr_machdep.c
index a3db90d..2a7dd9a 100644
--- a/sys/amd64/amd64/intr_machdep.c
+++ b/sys/amd64/amd64/intr_machdep.c
@@ -158,8 +158,8 @@ intr_lookup_source(int vector)
}
int
-intr_add_handler(const char *name, int vector, driver_intr_t handler,
- void *arg, enum intr_type flags, void **cookiep)
+intr_add_handler(const char *name, int vector, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
{
struct intsrc *isrc;
int error;
@@ -167,8 +167,8 @@ intr_add_handler(const char *name, int vector, driver_intr_t handler,
isrc = intr_lookup_source(vector);
if (isrc == NULL)
return (EINVAL);
- error = intr_event_add_handler(isrc->is_event, name, handler, arg,
- intr_priority(flags), flags, cookiep);
+ error = intr_event_add_handler(isrc->is_event, name, filter, handler,
+ arg, intr_priority(flags), flags, cookiep);
if (error == 0) {
intrcnt_updatename(isrc);
mtx_lock_spin(&intr_table_lock);
@@ -266,7 +266,7 @@ intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)
thread = 0;
critical_enter();
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST)) {
+ if (ih->ih_filter == NULL) {
thread = 1;
continue;
}
@@ -274,9 +274,9 @@ intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)
ih->ih_handler, ih->ih_argument == NULL ? frame :
ih->ih_argument, ih->ih_name);
if (ih->ih_argument == NULL)
- ih->ih_handler(frame);
+ ih->ih_filter(frame);
else
- ih->ih_handler(ih->ih_argument);
+ ih->ih_filter(ih->ih_argument);
}
/*
diff --git a/sys/amd64/amd64/nexus.c b/sys/amd64/amd64/nexus.c
index 01e9f42..eebd5cd 100644
--- a/sys/amd64/amd64/nexus.c
+++ b/sys/amd64/amd64/nexus.c
@@ -95,7 +95,8 @@ static int nexus_deactivate_resource(device_t, device_t, int, int,
static int nexus_release_resource(device_t, device_t, int, int,
struct resource *);
static int nexus_setup_intr(device_t, device_t, struct resource *, int flags,
- void (*)(void *), void *, void **);
+ driver_filter_t filter, void (*)(void *), void *,
+ void **);
static int nexus_teardown_intr(device_t, device_t, struct resource *,
void *);
static struct resource_list *nexus_get_reslist(device_t dev, device_t child);
@@ -417,7 +418,8 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
*/
static int
nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
- int flags, void (*ihand)(void *), void *arg, void **cookiep)
+ int flags, driver_filter_t filter, void (*ihand)(void *),
+ void *arg, void **cookiep)
{
int error;
@@ -437,7 +439,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
return (error);
error = intr_add_handler(device_get_nameunit(child),
- rman_get_start(irq), ihand, arg, flags, cookiep);
+ rman_get_start(irq), filter, ihand, arg, flags, cookiep);
return (error);
}
diff --git a/sys/amd64/include/intr_machdep.h b/sys/amd64/include/intr_machdep.h
index c0054b1..fd481b0 100644
--- a/sys/amd64/include/intr_machdep.h
+++ b/sys/amd64/include/intr_machdep.h
@@ -135,8 +135,9 @@ void intr_add_cpu(u_int apic_id);
#else
#define intr_add_cpu(apic_id)
#endif
-int intr_add_handler(const char *name, int vector, driver_intr_t handler,
- void *arg, enum intr_type flags, void **cookiep);
+int intr_add_handler(const char *name, int vector, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags,
+ void **cookiep);
int intr_config_intr(int vector, enum intr_trigger trig,
enum intr_polarity pol);
void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index e548b26..a6410ea 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -140,7 +140,7 @@ static struct timecounter i8254_timecounter = {
0 /* quality */
};
-static void
+static int
clkintr(struct trapframe *frame)
{
@@ -157,6 +157,7 @@ clkintr(struct trapframe *frame)
}
KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer"));
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+ return (FILTER_HANDLED);
}
int
@@ -211,11 +212,13 @@ release_timer2()
* Stat clock ticks can still be lost, causing minor loss of accuracy
* in the statistics, but the stat clock will no longer stop.
*/
-static void
+static int
rtcintr(struct trapframe *frame)
{
+ int flag = 0;
while (rtcin(RTC_INTR) & RTCIR_PERIOD) {
+ flag = 1;
if (profprocs != 0) {
if (--pscnt == 0)
pscnt = psdiv;
@@ -224,6 +227,7 @@ rtcintr(struct trapframe *frame)
if (pscnt == psdiv)
statclock(TRAPF_USERMODE(frame));
}
+ return(flag ? FILTER_HANDLED : FILTER_STRAY);
}
#include "opt_ddb.h"
@@ -758,8 +762,8 @@ cpu_initclocks()
* timecounter to user a simpler algorithm.
*/
if (!using_lapic_timer) {
- intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL,
+ INTR_TYPE_CLK, NULL);
i8254_intsrc = intr_lookup_source(0);
if (i8254_intsrc != NULL)
i8254_pending =
@@ -792,8 +796,8 @@ cpu_initclocks()
/* Enable periodic interrupts from the RTC. */
rtc_statusb |= RTCSB_PINTR;
- intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL,
+ INTR_TYPE_CLK, NULL);
writertc(RTC_STATUSB, rtc_statusb);
rtcin(RTC_INTR);
diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c
index 9ac9c32..1f20226 100644
--- a/sys/amd64/isa/isa.c
+++ b/sys/amd64/isa/isa.c
@@ -147,10 +147,11 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
*/
int
isa_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
- void (*ihand)(void *), void *arg, void **cookiep)
+ driver_filter_t *filter, void (*ihand)(void *), void *arg,
+ void **cookiep)
{
return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags,
- ihand, arg, cookiep));
+ filter, ihand, arg, cookiep));
}
int
diff --git a/sys/arm/arm/intr.c b/sys/arm/arm/intr.c
index 2812648..c5bbb51 100644
--- a/sys/arm/arm/intr.c
+++ b/sys/arm/arm/intr.c
@@ -58,8 +58,8 @@ static int last_printed = 0;
void arm_handler_execute(struct trapframe *, int);
void
-arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg,
- int irq, int flags, void **cookiep)
+arm_setup_irqhandler(const char *name, driver_filter_t *filt,
+ void (*hand)(void*), void *arg, int irq, int flags, void **cookiep)
{
struct intr_event *event;
int error;
@@ -82,7 +82,7 @@ arm_setup_irqhandler(const char *name, void (*hand)(void*), void *arg,
intrcnt_index++;
}
- intr_event_add_handler(event, name, hand, arg,
+ intr_event_add_handler(event, name, filt, hand, arg,
intr_priority(flags), flags, cookiep);
}
@@ -118,10 +118,10 @@ arm_handler_execute(struct trapframe *frame, int irqnb)
/* Execute fast handlers. */
thread = 0;
TAILQ_FOREACH(ih, &event->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST))
+ if (ih->ih_filter == NULL)
thread = 1;
else
- ih->ih_handler(ih->ih_argument ?
+ ih->ih_filter(ih->ih_argument ?
ih->ih_argument : frame);
}
diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c
index b670417..0d9c388 100644
--- a/sys/arm/arm/nexus.c
+++ b/sys/arm/arm/nexus.c
@@ -81,7 +81,7 @@ static int nexus_activate_resource(device_t, device_t, int, int,
struct resource *);
static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
- driver_intr_t *intr, void *arg, void **cookiep);
+ driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep);
static int
nexus_teardown_intr(device_t, device_t, struct resource *, void *);
@@ -125,13 +125,13 @@ nexus_probe(device_t dev)
static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
int i;
for (i = rman_get_start(res); i <= rman_get_end(res); i++)
arm_setup_irqhandler(device_get_nameunit(child),
- intr, arg, i, flags, cookiep);
+ filt, intr, arg, i, flags, cookiep);
return (0);
}
diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c
index cae88f2..59e5f08 100644
--- a/sys/arm/at91/at91.c
+++ b/sys/arm/at91/at91.c
@@ -543,14 +543,14 @@ at91_release_resource(device_t dev, device_t child, int type,
static int
at91_setup_intr(device_t dev, device_t child,
- struct resource *ires, int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ struct resource *ires, int flags, driver_filter_t *filt,
+ driver_intr_t *intr, void *arg, void **cookiep)
{
struct at91_softc *sc = device_get_softc(dev);
if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && !(flags & INTR_FAST))
panic("All system interrupt ISRs must be type INTR_FAST");
- BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg,
+ BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg,
cookiep);
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IECR,
1 << rman_get_start(ires));
diff --git a/sys/arm/at91/at91_mci.c b/sys/arm/at91/at91_mci.c
index 1cc9091..ca9f399 100644
--- a/sys/arm/at91/at91_mci.c
+++ b/sys/arm/at91/at91_mci.c
@@ -192,7 +192,7 @@ at91_mci_attach(device_t dev)
* Activate the interrupt
*/
err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
- at91_mci_intr, sc, &sc->intrhand);
+ NULL, at91_mci_intr, sc, &sc->intrhand);
if (err) {
AT91_MCI_LOCK_DESTROY(sc);
goto out;
diff --git a/sys/arm/at91/at91_pio.c b/sys/arm/at91/at91_pio.c
index 18ffe9b..f8c1863 100644
--- a/sys/arm/at91/at91_pio.c
+++ b/sys/arm/at91/at91_pio.c
@@ -83,7 +83,7 @@ static devclass_t at91_pio_devclass;
static int at91_pio_probe(device_t dev);
static int at91_pio_attach(device_t dev);
static int at91_pio_detach(device_t dev);
-static void at91_pio_intr(void *);
+static int at91_pio_intr(void *);
/* helper routines */
static int at91_pio_activate(device_t dev);
@@ -148,8 +148,8 @@ at91_pio_attach(device_t dev)
* Activate the interrupt, but disable all interrupts in the hardware
*/
WR4(sc, PIO_IDR, 0xffffffff);
- err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_FAST,
- at91_pio_intr, sc, &sc->intrhand);
+ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC,
+ at91_pio_intr, NULL, sc, &sc->intrhand);
if (err) {
AT91_PIO_LOCK_DESTROY(sc);
goto out;
@@ -217,7 +217,7 @@ at91_pio_deactivate(device_t dev)
return;
}
-static void
+static int
at91_pio_intr(void *xsc)
{
struct at91_pio_softc *sc = xsc;
@@ -232,7 +232,7 @@ at91_pio_intr(void *xsc)
AT91_PIO_UNLOCK(sc);
#endif
wakeup(sc);
- return;
+ return (FILTER_HANDLED);
}
static int
diff --git a/sys/arm/at91/at91_rtc.c b/sys/arm/at91/at91_rtc.c
index 3a68200..ad70b85 100644
--- a/sys/arm/at91/at91_rtc.c
+++ b/sys/arm/at91/at91_rtc.c
@@ -110,8 +110,8 @@ at91_rtc_attach(device_t dev)
* Activate the interrupt, but disable all interrupts in the hardware
*/
WR4(sc, RTC_IDR, 0xffffffff);
- err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_FAST,
- at91_rtc_intr, sc, &sc->intrhand);
+ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC,
+ at91_rtc_intr, NULL, sc, &sc->intrhand);
if (err) {
AT91_RTC_LOCK_DESTROY(sc);
goto out;
@@ -173,7 +173,7 @@ at91_rtc_deactivate(device_t dev)
return;
}
-static void
+static int
at91_rtc_intr(void *xsc)
{
struct at91_rtc_softc *sc = xsc;
@@ -188,7 +188,7 @@ at91_rtc_intr(void *xsc)
AT91_RTC_UNLOCK(sc);
#endif
wakeup(sc);
- return;
+ return (FILTER_HANDLED);
}
/*
diff --git a/sys/arm/at91/at91_spi.c b/sys/arm/at91/at91_spi.c
index 6341176..d3ee67d 100644
--- a/sys/arm/at91/at91_spi.c
+++ b/sys/arm/at91/at91_spi.c
@@ -163,7 +163,7 @@ at91_spi_activate(device_t dev)
if (sc->irq_res == NULL)
goto errout;
err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
- at91_spi_intr, sc, &sc->intrhand);
+ NULL, at91_spi_intr, sc, &sc->intrhand);
if (err != 0)
goto errout;
return (0);
diff --git a/sys/arm/at91/at91_ssc.c b/sys/arm/at91/at91_ssc.c
index f4db0d1..3e08431 100644
--- a/sys/arm/at91/at91_ssc.c
+++ b/sys/arm/at91/at91_ssc.c
@@ -124,7 +124,7 @@ at91_ssc_attach(device_t dev)
* Activate the interrupt
*/
err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
- at91_ssc_intr, sc, &sc->intrhand);
+ NULL, at91_ssc_intr, sc, &sc->intrhand);
if (err) {
AT91_SSC_LOCK_DESTROY(sc);
goto out;
diff --git a/sys/arm/at91/at91_st.c b/sys/arm/at91/at91_st.c
index e165f24..6ec9730 100644
--- a/sys/arm/at91/at91_st.c
+++ b/sys/arm/at91/at91_st.c
@@ -183,7 +183,7 @@ at91st_watchdog(void *argp, u_int cmd, int *error)
WR4(ST_CR, ST_CR_WDRST);
}
-static void
+static int
clock_intr(void *arg)
{
struct trapframe *fp = arg;
@@ -194,7 +194,9 @@ clock_intr(void *arg)
tot_count += 32768 / hz;
#endif
hardclock(TRAPF_USERMODE(fp), TRAPF_PC(fp));
+ return (FILTER_HANDLED);
}
+ return (FILTER_STRAY);
}
void
@@ -222,8 +224,8 @@ cpu_initclocks(void)
if (!irq)
panic("Unable to allocate irq for the system timer");
else
- bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST,
- clock_intr, NULL, &ih);
+ bus_setup_intr(dev, irq, INTR_TYPE_CLK,
+ clock_intr, NULL, NULL, &ih);
WR4(ST_PIMR, rel_value);
diff --git a/sys/arm/at91/at91_twi.c b/sys/arm/at91/at91_twi.c
index 1f522d6..0319e12 100644
--- a/sys/arm/at91/at91_twi.c
+++ b/sys/arm/at91/at91_twi.c
@@ -118,7 +118,7 @@ at91_twi_attach(device_t dev)
* Activate the interrupt
*/
err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
- at91_twi_intr, sc, &sc->intrhand);
+ NULL, at91_twi_intr, sc, &sc->intrhand);
if (err) {
AT91_TWI_LOCK_DESTROY(sc);
goto out;
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c
index 9fb0d9a..02b49fb 100644
--- a/sys/arm/at91/if_ate.c
+++ b/sys/arm/at91/if_ate.c
@@ -226,7 +226,7 @@ ate_attach(device_t dev)
* Activate the interrupt
*/
err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- ate_intr, sc, &sc->intrhand);
+ NULL, ate_intr, sc, &sc->intrhand);
if (err) {
ether_ifdetach(ifp);
ATE_LOCK_DESTROY(sc);
diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h
index dc08c7f..a378d38 100644
--- a/sys/arm/include/intr.h
+++ b/sys/arm/include/intr.h
@@ -50,7 +50,7 @@
int arm_get_next_irq(void);
void arm_mask_irq(uintptr_t);
void arm_unmask_irq(uintptr_t);
-void arm_setup_irqhandler(const char *, void (*)(void*), void *, int, int,
- void **);
+void arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*),
+ void *, int, int, void **);
int arm_remove_irqhandler(void *);
#endif /* _MACHINE_INTR_H */
diff --git a/sys/arm/sa11x0/sa11x0.c b/sys/arm/sa11x0/sa11x0.c
index b099600..4c12162 100644
--- a/sys/arm/sa11x0/sa11x0.c
+++ b/sys/arm/sa11x0/sa11x0.c
@@ -91,14 +91,14 @@ static struct resource *sa1110_alloc_resource(device_t, device_t, int, int *,
static int sa1110_activate_resource(device_t, device_t, int, int,
struct resource *);
static int sa1110_setup_intr(device_t, device_t, struct resource *, int,
- driver_intr_t *, void *, void **);
+ driver_filter_t *, driver_intr_t *, void *, void **);
struct sa11x0_softc *sa11x0_softc; /* There can be only one. */
static int
sa1110_setup_intr(device_t dev, device_t child,
- struct resource *ires, int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ struct resource *ires, int flags, driver_filter_t *filt,
+ driver_intr_t *intr, void *arg, void **cookiep)
{
int saved_cpsr;
@@ -113,7 +113,7 @@ sa1110_setup_intr(device_t dev, device_t child,
saved_cpsr = SetCPSR(I32_bit, I32_bit);
SetCPSR(I32_bit, saved_cpsr & I32_bit);
- BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg,
+ BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg,
cookiep);
return (0);
}
diff --git a/sys/arm/sa11x0/sa11x0_ost.c b/sys/arm/sa11x0/sa11x0_ost.c
index fbe73eb..6edced9 100644
--- a/sys/arm/sa11x0/sa11x0_ost.c
+++ b/sys/arm/sa11x0/sa11x0_ost.c
@@ -67,9 +67,9 @@ static int saost_probe(device_t);
static int saost_attach(device_t);
int gettick(void);
-static void clockintr(void *);
+static int clockintr(void *);
#if 0
-static void statintr(void *);
+static int statintr(void *);
#endif
void rtcinit(void);
@@ -141,7 +141,7 @@ saost_attach(device_t dev)
}
-static void
+static int
clockintr(arg)
void *arg;
{
@@ -184,10 +184,11 @@ clockintr(arg)
#if 0
mtx_unlock_spin(&clock_lock);
#endif
+ return (FILTER_HANDLED);
}
#if 0
-static void
+static int
statintr(arg)
void *arg;
{
@@ -227,7 +228,7 @@ statintr(arg)
saost_sc->sc_statclock_count = nextmatch;
statclock(TRAPF_USERMODE(frame));
-
+ return (FILTER_HANDLED);
}
#endif
@@ -271,10 +272,10 @@ cpu_initclocks()
rid = 1;
irq2 = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_ACTIVE);
- bus_setup_intr(dev, irq1, INTR_TYPE_CLK | INTR_FAST, clockintr, NULL,
+ bus_setup_intr(dev, irq1, INTR_TYPE_CLK, clockintr, NULL, NULL,
&ih1);
#if 0
- bus_setup_intr(dev, irq2, INTR_TYPE_CLK | INTR_FAST, statintr, NULL
+ bus_setup_intr(dev, irq2, INTR_TYPE_CLK, statintr, NULL, NULL,
,&ih2);
#endif
bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_SR, 0xf);
diff --git a/sys/arm/xscale/i80321/i80321_pci.c b/sys/arm/xscale/i80321/i80321_pci.c
index abda074d..aa4801d 100644
--- a/sys/arm/xscale/i80321/i80321_pci.c
+++ b/sys/arm/xscale/i80321/i80321_pci.c
@@ -346,11 +346,11 @@ i80321_pci_activate_resource(device_t bus, device_t child, int type, int rid,
static int
i80321_pci_setup_intr(device_t dev, device_t child,
- struct resource *ires, int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ struct resource *ires, int flags, driver_filter_t *filt,
+ driver_intr_t *intr, void *arg, void **cookiep)
{
return (BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
- intr, arg, cookiep));
+ filt, intr, arg, cookiep));
}
static int
diff --git a/sys/arm/xscale/i80321/i80321_timer.c b/sys/arm/xscale/i80321/i80321_timer.c
index 8f9e4b9..1abfdaf 100644
--- a/sys/arm/xscale/i80321/i80321_timer.c
+++ b/sys/arm/xscale/i80321/i80321_timer.c
@@ -133,7 +133,7 @@ static devclass_t i80321_timer_devclass;
DRIVER_MODULE(itimer, iq, i80321_timer_driver, i80321_timer_devclass, 0, 0);
-void clockhandler(void *);
+int clockhandler(void *);
static __inline uint32_t
@@ -336,8 +336,8 @@ cpu_initclocks(void)
if (!irq)
panic("Unable to setup the clock irq handler.\n");
else
- bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST,
- clockhandler, NULL, &ihl);
+ bus_setup_intr(dev, irq, INTR_TYPE_CLK, clockhandler, NULL,
+ NULL, &ihl);
tmr0_write(0); /* stop timer */
tisr_write(TISR_TMR0); /* clear interrupt */
@@ -401,7 +401,7 @@ DELAY(int n)
*
* Handle the hardclock interrupt.
*/
-void
+int
clockhandler(void *arg)
{
struct trapframe *frame = arg;
@@ -412,7 +412,7 @@ clockhandler(void *arg)
if (i80321_hardclock_hook != NULL)
(*i80321_hardclock_hook)();
- return;
+ return (FILTER_HANDLED);
}
void
diff --git a/sys/arm/xscale/i80321/iq80321.c b/sys/arm/xscale/i80321/iq80321.c
index 13b5917..7f94879 100644
--- a/sys/arm/xscale/i80321/iq80321.c
+++ b/sys/arm/xscale/i80321/iq80321.c
@@ -351,11 +351,11 @@ iq80321_alloc_resource(device_t dev, device_t child, int type, int *rid,
static int
iq80321_setup_intr(device_t dev, device_t child,
- struct resource *ires, int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ struct resource *ires, int flags, driver_filter_t *filt,
+ driver_intr_t *intr, void *arg, void **cookiep)
{
- BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg,
- cookiep);
+ BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr,
+ arg, cookiep);
intr_enabled |= 1 << rman_get_start(ires);
i80321_set_intrmask();
diff --git a/sys/arm/xscale/ixp425/ixp425.c b/sys/arm/xscale/ixp425/ixp425.c
index f35db99..78155bc 100644
--- a/sys/arm/xscale/ixp425/ixp425.c
+++ b/sys/arm/xscale/ixp425/ixp425.c
@@ -310,8 +310,8 @@ ixp425_alloc_resource(device_t dev, device_t child, int type, int *rid,
static int
ixp425_setup_intr(device_t dev, device_t child,
- struct resource *ires, int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ struct resource *ires, int flags, driver_filter_t *filt,
+ driver_intr_t *intr, void *arg, void **cookiep)
{
uint32_t mask;
int i;
@@ -324,8 +324,8 @@ ixp425_setup_intr(device_t dev, device_t child,
rman_set_start(ires, IXP425_INT_UART1);
rman_set_end(ires, rman_get_start(ires));
}
- BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, intr, arg,
- cookiep);
+ BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr,
+ arg, cookiep);
mask = 0;
for (i = rman_get_start(ires); i <= rman_get_end(ires); i++)
diff --git a/sys/arm/xscale/ixp425/ixp425_npe.c b/sys/arm/xscale/ixp425/ixp425_npe.c
index c3e9dbd..2d5680d 100644
--- a/sys/arm/xscale/ixp425/ixp425_npe.c
+++ b/sys/arm/xscale/ixp425/ixp425_npe.c
@@ -291,7 +291,7 @@ ixpnpe_attach(device_t dev)
panic("%s: Unable to allocate irq %u", device_get_name(dev), irq);
/* XXX could be a source of entropy */
bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE,
- ixpnpe_intr, sc, &sc->sc_ih);
+ NULL, ixpnpe_intr, sc, &sc->sc_ih);
/* enable output fifo interrupts (NB: must also set OFIFO Write Enable) */
npe_reg_write(sc, IX_NPECTL,
npe_reg_read(sc, IX_NPECTL) | (IX_NPECTL_OFE | IX_NPECTL_OFWE));
diff --git a/sys/arm/xscale/ixp425/ixp425_pci.c b/sys/arm/xscale/ixp425/ixp425_pci.c
index cadb088..ef29052 100644
--- a/sys/arm/xscale/ixp425/ixp425_pci.c
+++ b/sys/arm/xscale/ixp425/ixp425_pci.c
@@ -254,11 +254,11 @@ ixppcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
static int
ixppcib_setup_intr(device_t dev, device_t child, struct resource *ires,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
return (BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
- intr, arg, cookiep));
+ filt, intr, arg, cookiep));
}
static int
diff --git a/sys/arm/xscale/ixp425/ixp425_timer.c b/sys/arm/xscale/ixp425/ixp425_timer.c
index 0fa9d1f..e7717d0 100644
--- a/sys/arm/xscale/ixp425/ixp425_timer.c
+++ b/sys/arm/xscale/ixp425/ixp425_timer.c
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
static uint32_t counts_per_hz;
/* callback functions for intr_functions */
-void ixpclk_intr(void *);
+int ixpclk_intr(void *);
struct ixpclk_softc {
device_t sc_dev;
@@ -182,8 +182,8 @@ cpu_initclocks(void)
if (!irq)
panic("Unable to setup the clock irq handler.\n");
else
- bus_setup_intr(dev, irq, INTR_TYPE_CLK | INTR_FAST,
- ixpclk_intr, NULL, &ihl);
+ bus_setup_intr(dev, irq, INTR_TYPE_CLK, ixpclk_intr, NULL,
+ NULL, &ihl);
/* Set up the new clock parameters. */
@@ -244,7 +244,7 @@ DELAY(int n)
*
* Handle the hardclock interrupt.
*/
-void
+int
ixpclk_intr(void *arg)
{
struct ixpclk_softc* sc = ixpclk_sc;
@@ -254,6 +254,7 @@ ixpclk_intr(void *arg)
OST_TIM0_INT);
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+ return (FILTER_HANDLED);
}
void
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index 962f69d..396434e 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -1373,7 +1373,7 @@ NdisAddDevice(drv, pdo)
if (sc->ndis_iftype == PCMCIABus || sc->ndis_iftype == PCIBus) {
error = bus_setup_intr(sc->ndis_dev, sc->ndis_irq,
INTR_TYPE_NET | INTR_MPSAFE,
- ntoskrnl_intr, NULL, &sc->ndis_intrhand);
+ NULL, ntoskrnl_intr, NULL, &sc->ndis_intrhand);
if (error)
return(NDIS_STATUS_FAILURE);
}
diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c
index 7fc9dc2..1f62d41 100644
--- a/sys/contrib/dev/oltr/if_oltr.c
+++ b/sys/contrib/dev/oltr/if_oltr.c
@@ -154,7 +154,7 @@ oltr_attach(device_t dev)
if_free(ifp);
return (-1);
}
- if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, oltr_intr,
+ if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, oltr_intr,
sc, &sc-> oltr_intrhand)) {
device_printf(dev, "couldn't setup interrupt\n");
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 3b6ad54..078f809 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -305,20 +305,21 @@ aac_attach(struct aac_softc *sc)
}
if (sc->flags & AAC_FLAGS_NEW_COMM) {
if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
- INTR_MPSAFE|INTR_TYPE_BIO, aac_new_intr,
- sc, &sc->aac_intr)) {
+ INTR_MPSAFE|INTR_TYPE_BIO, NULL,
+ aac_new_intr, sc, &sc->aac_intr)) {
device_printf(sc->aac_dev, "can't set up interrupt\n");
return (EINVAL);
}
} else {
if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
- INTR_FAST|INTR_TYPE_BIO, aac_fast_intr,
+ INTR_TYPE_BIO, aac_fast_intr, NULL,
sc, &sc->aac_intr)) {
device_printf(sc->aac_dev,
"can't set up FAST interrupt\n");
if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
INTR_MPSAFE|INTR_TYPE_BIO,
- aac_fast_intr, sc, &sc->aac_intr)) {
+ NULL, (driver_intr_t *)aac_fast_intr,
+ sc, &sc->aac_intr)) {
device_printf(sc->aac_dev,
"can't set up MPSAFE interrupt\n");
return (EINVAL);
@@ -780,7 +781,7 @@ aac_new_intr(void *arg)
mtx_unlock(&sc->aac_io_lock);
}
-void
+int
aac_fast_intr(void *arg)
{
struct aac_softc *sc;
@@ -822,6 +823,7 @@ aac_fast_intr(void *arg)
*/
wakeup(sc->aifthread);
}
+ return (FILTER_HANDLED);
}
/*
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h
index a5ae32b..de3425b 100644
--- a/sys/dev/aac/aacvar.h
+++ b/sys/dev/aac/aacvar.h
@@ -425,7 +425,7 @@ extern int aac_shutdown(device_t dev);
extern int aac_suspend(device_t dev);
extern int aac_resume(device_t dev);
extern void aac_new_intr(void *arg);
-extern void aac_fast_intr(void *arg);
+extern int aac_fast_intr(void *arg);
extern void aac_submit_bio(struct bio *bp);
extern void aac_biodone(struct bio *bp);
extern void aac_startio(struct aac_softc *sc);
diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c
index 4842cfc..c973124 100644
--- a/sys/dev/acpica/Osd/OsdInterrupt.c
+++ b/sys/dev/acpica/Osd/OsdInterrupt.c
@@ -86,7 +86,7 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber,
goto error;
}
if (bus_setup_intr(sc->acpi_dev, sc->acpi_irq, INTR_TYPE_MISC|INTR_MPSAFE,
- (driver_intr_t *)ServiceRoutine, Context, &sc->acpi_irq_handle)) {
+ NULL, (driver_intr_t *)ServiceRoutine, Context, &sc->acpi_irq_handle)) {
device_printf(sc->acpi_dev, "could not set up interrupt\n");
goto error;
}
diff --git a/sys/dev/adlink/adlink.c b/sys/dev/adlink/adlink.c
index 75b55dc..1a669fc 100644
--- a/sys/dev/adlink/adlink.c
+++ b/sys/dev/adlink/adlink.c
@@ -115,7 +115,7 @@ struct softc {
static d_ioctl_t adlink_ioctl;
static d_mmap_t adlink_mmap;
-static void adlink_intr(void *arg);
+static int adlink_intr(void *arg);
static struct cdevsw adlink_cdevsw = {
.d_version = D_VERSION,
@@ -124,7 +124,7 @@ static struct cdevsw adlink_cdevsw = {
.d_name = "adlink",
};
-static void
+static int
adlink_intr(void *arg)
{
struct softc *sc;
@@ -134,7 +134,7 @@ adlink_intr(void *arg)
sc = arg;
u = bus_read_4(sc->res[0], 0x38);
if (!(u & 0x00800000))
- return;
+ return; // XXX - FILTER_STRAY?
bus_write_4(sc->res[0], 0x38, u | 0x003f4000);
sc->sample += sc->p0->chunksize / 2;
@@ -147,7 +147,7 @@ adlink_intr(void *arg)
if (sc->p0->state != STATE_RUN) {
printf("adlink: stopping %d\n", sc->p0->state);
- return;
+ return; // XXX - FILTER_STRAY?
}
pg = pg->next;
@@ -156,6 +156,7 @@ adlink_intr(void *arg)
bus_write_4(sc->res[0], 0x24, pg->phys);
bus_write_4(sc->res[0], 0x28, sc->p0->chunksize);
wakeup(sc);
+ return (FILTER_HANDLED);
}
static int
@@ -372,14 +373,15 @@ adlink_attach(device_t self)
if (error)
return (error);
+ /* XXX why do we need INTR_MPSAFE if INTR_FAST was declared too?!?!? */
i = bus_setup_intr(self, sc->res[2],
- INTR_MPSAFE | INTR_TYPE_MISC | INTR_FAST,
- adlink_intr, sc, &sc->intrhand);
+ INTR_MPSAFE | INTR_TYPE_MISC,
+ adlink_intr, NULL, sc, &sc->intrhand);
if (i) {
printf("adlink: Couldn't get FAST intr\n");
i = bus_setup_intr(self, sc->res[2],
INTR_MPSAFE | INTR_TYPE_MISC,
- adlink_intr, sc, &sc->intrhand);
+ NULL, (driver_intr_t *)adlink_intr, sc, &sc->intrhand);
}
if (i) {
diff --git a/sys/dev/advansys/adv_eisa.c b/sys/dev/advansys/adv_eisa.c
index 08b98d0..6afdc5f 100644
--- a/sys/dev/advansys/adv_eisa.c
+++ b/sys/dev/advansys/adv_eisa.c
@@ -323,7 +323,8 @@ adv_eisa_attach(device_t dev)
/*
* Enable our interrupt handler.
*/
- bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih);
+ bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, adv_intr,
+ adv, &ih);
/* Attach sub-devices - always succeeds */
adv_attach(adv);
diff --git a/sys/dev/advansys/adv_isa.c b/sys/dev/advansys/adv_isa.c
index dde65ef..182ca54 100644
--- a/sys/dev/advansys/adv_isa.c
+++ b/sys/dev/advansys/adv_isa.c
@@ -337,7 +337,7 @@ adv_isa_probe(device_t dev)
RF_ACTIVE);
if (irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY,
- adv_intr, adv, &ih)) {
+ NULL, adv_intr, adv, &ih)) {
bus_dmamap_unload(overrun_dmat, overrun_dmamap);
bus_dmamem_free(overrun_dmat, overrun_buf,
overrun_dmamap);
diff --git a/sys/dev/advansys/adv_pci.c b/sys/dev/advansys/adv_pci.c
index 7ce53b6..6a073ba 100644
--- a/sys/dev/advansys/adv_pci.c
+++ b/sys/dev/advansys/adv_pci.c
@@ -309,7 +309,8 @@ adv_pci_attach(device_t dev)
irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqrid,
RF_SHAREABLE | RF_ACTIVE);
if (irqres == NULL ||
- bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih)) {
+ bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, NULL,
+ adv_intr, adv, &ih)) {
adv_free(adv);
bus_release_resource(dev, SYS_RES_IOPORT, rid, iores);
return ENXIO;
diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c
index ccf15eb..78b8fdd 100644
--- a/sys/dev/advansys/adwcam.c
+++ b/sys/dev/advansys/adwcam.c
@@ -1213,8 +1213,8 @@ adw_attach(struct adw_softc *adw)
s = splcam();
/* Hook up our interrupt handler */
if ((error = bus_setup_intr(adw->device, adw->irq,
- INTR_TYPE_CAM | INTR_ENTROPY, adw_intr,
- adw, &adw->ih)) != 0) {
+ INTR_TYPE_CAM | INTR_ENTROPY, NULL,
+ adw_intr, adw, &adw->ih)) != 0) {
device_printf(adw->device, "bus_setup_intr() failed: %d\n",
error);
goto fail;
diff --git a/sys/dev/aha/aha_isa.c b/sys/dev/aha/aha_isa.c
index 93e7955..b29d370 100644
--- a/sys/dev/aha/aha_isa.c
+++ b/sys/dev/aha/aha_isa.c
@@ -272,7 +272,7 @@ aha_isa_attach(device_t dev)
}
error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY,
- aha_intr, aha, &ih);
+ NULL, aha_intr, aha, &ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
goto fail;
diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c
index 4455886..051688b 100644
--- a/sys/dev/ahb/ahb.c
+++ b/sys/dev/ahb/ahb.c
@@ -378,7 +378,8 @@ ahbattach(device_t dev)
goto error_exit;
/* Enable our interrupt */
- bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, ahbintr, ahb, &ih);
+ bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr,
+ ahb, &ih);
return (0);
error_exit:
diff --git a/sys/dev/aic/aic_cbus.c b/sys/dev/aic/aic_cbus.c
index f72df43..aa43782 100644
--- a/sys/dev/aic/aic_cbus.c
+++ b/sys/dev/aic/aic_cbus.c
@@ -211,7 +211,7 @@ aic_isa_attach(device_t dev)
}
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY,
- aic_intr, aic, &sc->sc_ih);
+ NULL, aic_intr, aic, &sc->sc_ih);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
aic_isa_release_resources(dev);
diff --git a/sys/dev/aic/aic_isa.c b/sys/dev/aic/aic_isa.c
index 71736f2..f5f96e8 100644
--- a/sys/dev/aic/aic_isa.c
+++ b/sys/dev/aic/aic_isa.c
@@ -188,7 +188,7 @@ aic_isa_attach(device_t dev)
}
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY,
- aic_intr, aic, &sc->sc_ih);
+ NULL, aic_intr, aic, &sc->sc_ih);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
aic_isa_release_resources(dev);
diff --git a/sys/dev/aic/aic_pccard.c b/sys/dev/aic/aic_pccard.c
index fa293cb..e4273c6 100644
--- a/sys/dev/aic/aic_pccard.c
+++ b/sys/dev/aic/aic_pccard.c
@@ -142,7 +142,7 @@ aic_pccard_attach(device_t dev)
}
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM|INTR_ENTROPY,
- aic_intr, aic, &sc->sc_ih);
+ NULL, aic_intr, aic, &sc->sc_ih);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
aic_pccard_release_resources(dev);
diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c
index e33fb0e..e16b421 100644
--- a/sys/dev/aic7xxx/aic79xx_osm.c
+++ b/sys/dev/aic7xxx/aic79xx_osm.c
@@ -95,7 +95,7 @@ ahd_map_int(struct ahd_softc *ahd)
/* Hook up our interrupt handler */
error = bus_setup_intr(ahd->dev_softc, ahd->platform_data->irq,
- INTR_TYPE_CAM, ahd_platform_intr, ahd,
+ INTR_TYPE_CAM, NULL, ahd_platform_intr, ahd,
&ahd->platform_data->ih);
if (error != 0)
device_printf(ahd->dev_softc, "bus_setup_intr() failed: %d\n",
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c
index 0de7e8d..f3b106c 100644
--- a/sys/dev/aic7xxx/aic7xxx_osm.c
+++ b/sys/dev/aic7xxx/aic7xxx_osm.c
@@ -107,7 +107,7 @@ ahc_map_int(struct ahc_softc *ahc)
/* Hook up our interrupt handler */
error = bus_setup_intr(ahc->dev_softc, ahc->platform_data->irq,
- INTR_TYPE_CAM, ahc_platform_intr, ahc,
+ INTR_TYPE_CAM, NULL, ahc_platform_intr, ahc,
&ahc->platform_data->ih);
if (error != 0)
diff --git a/sys/dev/amd/amd.c b/sys/dev/amd/amd.c
index 6541110..4c8ed41 100644
--- a/sys/dev/amd/amd.c
+++ b/sys/dev/amd/amd.c
@@ -2460,7 +2460,7 @@ amd_attach(device_t dev)
RF_SHAREABLE | RF_ACTIVE);
if (irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM | INTR_ENTROPY,
- amd_intr, amd, &ih)) {
+ NULL, amd_intr, amd, &ih)) {
if (bootverbose)
printf("amd%d: unable to register interrupt handler!\n",
unit);
diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c
index 7d48572..2c7e78a 100644
--- a/sys/dev/amr/amr_pci.c
+++ b/sys/dev/amr/amr_pci.c
@@ -263,7 +263,7 @@ amr_pci_attach(device_t dev)
goto out;
}
if (bus_setup_intr(sc->amr_dev, sc->amr_irq,
- INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, amr_pci_intr,
+ INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, NULL, amr_pci_intr,
sc, &sc->amr_intr)) {
device_printf(sc->amr_dev, "can't set up interrupt\n");
goto out;
diff --git a/sys/dev/an/if_an_isa.c b/sys/dev/an/if_an_isa.c
index 6baccaf..80933b1 100644
--- a/sys/dev/an/if_an_isa.c
+++ b/sys/dev/an/if_an_isa.c
@@ -122,7 +122,7 @@ an_attach_isa(device_t dev)
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- an_intr, sc, &sc->irq_handle);
+ NULL, an_intr, sc, &sc->irq_handle);
if (error) {
an_release_resources(dev);
return (error);
diff --git a/sys/dev/an/if_an_pccard.c b/sys/dev/an/if_an_pccard.c
index cde90c7..b475265 100644
--- a/sys/dev/an/if_an_pccard.c
+++ b/sys/dev/an/if_an_pccard.c
@@ -153,7 +153,7 @@ an_pccard_attach(device_t dev)
* Must setup the interrupt after the an_attach to prevent racing.
*/
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- an_intr, sc, &sc->irq_handle);
+ NULL, an_intr, sc, &sc->irq_handle);
fail:
if (error)
an_release_resources(dev);
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c
index 5098f50..a284c8a 100644
--- a/sys/dev/an/if_an_pci.c
+++ b/sys/dev/an/if_an_pci.c
@@ -240,7 +240,7 @@ an_attach_pci(dev)
* Must setup the interrupt after the an_attach to prevent racing.
*/
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- an_intr, sc, &sc->irq_handle);
+ NULL, an_intr, sc, &sc->irq_handle);
fail:
if (error)
diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c
index b29c26b..fbce1d9 100644
--- a/sys/dev/ar/if_ar.c
+++ b/sys/dev/ar/if_ar.c
@@ -259,7 +259,7 @@ ar_attach(device_t device)
arc_init(hc);
if(bus_setup_intr(device, hc->res_irq,
- INTR_TYPE_NET, arintr, hc, &hc->intr_cookie) != 0)
+ INTR_TYPE_NET, NULL, arintr, hc, &hc->intr_cookie) != 0)
return (1);
sc = hc->sc;
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c
index 0f3638c..185e0da 100644
--- a/sys/dev/arcmsr/arcmsr.c
+++ b/sys/dev/arcmsr/arcmsr.c
@@ -2117,7 +2117,7 @@ static u_int32_t arcmsr_attach(device_t dev)
irqres=bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE);
if(irqres == NULL ||
bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE
- , arcmsr_interrupt, acb, &acb->ih)) {
+ , NULL, arcmsr_interrupt, acb, &acb->ih)) {
arcmsr_free_resource(acb);
printf("arcmsr%d: unable to register interrupt handler!\n", unit);
return ENXIO;
diff --git a/sys/dev/arl/if_arl_isa.c b/sys/dev/arl/if_arl_isa.c
index 5f985aa..11cbf5f 100644
--- a/sys/dev/arl/if_arl_isa.c
+++ b/sys/dev/arl/if_arl_isa.c
@@ -303,7 +303,7 @@ arl_isa_attach (device_t dev)
arl_alloc_irq(dev, sc->irq_rid, 0);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- arl_intr, sc, &sc->irq_handle);
+ NULL, arl_intr, sc, &sc->irq_handle);
if (error) {
arl_release_resources(dev);
return (error);
diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c
index 9c8dde4..1de0bfd 100644
--- a/sys/dev/asr/asr.c
+++ b/sys/dev/asr/asr.c
@@ -2297,7 +2297,7 @@ asr_pci_map_int(device_t dev, Asr_softc_t *sc)
return (0);
}
if (bus_setup_intr(dev, sc->ha_irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- (driver_intr_t *)asr_intr, (void *)sc, &(sc->ha_intr))) {
+ NULL, (driver_intr_t *)asr_intr, (void *)sc, &(sc->ha_intr))) {
return (0);
}
sc->ha_irq = pci_read_config(dev, PCIR_INTLINE, sizeof(char));
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index 1e5d470..39c1dd6 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -134,7 +134,7 @@ ata_attach(device_t dev)
device_printf(dev, "unable to allocate interrupt\n");
return ENXIO;
}
- if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS,
+ if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
(driver_intr_t *)ata_interrupt, ch, &ch->ih))) {
device_printf(dev, "unable to setup interrupt\n");
return error;
diff --git a/sys/dev/ata/ata-cbus.c b/sys/dev/ata/ata-cbus.c
index a58109d..c978dc3 100644
--- a/sys/dev/ata/ata-cbus.c
+++ b/sys/dev/ata/ata-cbus.c
@@ -144,7 +144,7 @@ ata_cbus_attach(device_t dev)
}
if ((bus_setup_intr(dev, ctlr->irq, ATA_INTR_FLAGS,
- ata_cbus_intr, ctlr, &ctlr->ih))) {
+ NULL, ata_cbus_intr, ctlr, &ctlr->ih))) {
device_printf(dev, "unable to setup interrupt\n");
bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlr->ctlio);
@@ -188,12 +188,16 @@ ata_cbus_alloc_resource(device_t dev, device_t child, int type, int *rid,
static int
ata_cbus_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ int flags, driver_filter_t *filter, driver_intr_t *intr,
+ void *arg, void **cookiep)
{
struct ata_cbus_controller *controller = device_get_softc(dev);
int unit = ((struct ata_channel *)device_get_softc(child))->unit;
+ if (filter != NULL) {
+ printf("ata-cbus.c: we cannot use a filter here\n");
+ return (EINVAL);
+ }
controller->interrupt[unit].function = intr;
controller->interrupt[unit].argument = arg;
*cookiep = controller;
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index dcd40f4..783cf26 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -3267,7 +3267,7 @@ ata_promise_chipinit(device_t dev)
u_int32_t dimm = ATA_INL(ctlr->r_res2, 0x000c0080);
if (bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle) ||
- bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS,
+ bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL,
ata_promise_sx4_intr, ctlr, &ctlr->handle)) {
device_printf(dev, "unable to setup interrupt\n");
goto failnfree;
@@ -3301,7 +3301,7 @@ ata_promise_chipinit(device_t dev)
/* mio type controllers need an interrupt intercept */
if (bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle) ||
- bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS,
+ bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL,
ata_promise_mio_intr, ctlr, &ctlr->handle)) {
device_printf(dev, "unable to setup interrupt\n");
goto failnfree;
@@ -5161,7 +5161,7 @@ ata_setup_interrupt(device_t dev)
device_printf(dev, "unable to map interrupt\n");
return ENXIO;
}
- if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS,
+ if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL,
ata_generic_intr, ctlr, &ctlr->handle))) {
device_printf(dev, "unable to setup interrupt\n");
return ENXIO;
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 3bc6d8f..d1b4b9a 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -339,17 +339,21 @@ ata_pci_release_resource(device_t dev, device_t child, int type, int rid,
int
ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *function, void *argument,
- void **cookiep)
+ int flags, driver_filter_t *filter, driver_intr_t *function,
+ void *argument, void **cookiep)
{
if (ata_legacy(dev)) {
return BUS_SETUP_INTR(device_get_parent(dev), child, irq,
- flags, function, argument, cookiep);
+ flags, filter, function, argument, cookiep);
}
else {
struct ata_pci_controller *controller = device_get_softc(dev);
int unit = ((struct ata_channel *)device_get_softc(child))->unit;
+ if (filter != NULL) {
+ printf("ata-pci.c: we cannot use a filter here\n");
+ return (EINVAL);
+ }
controller->interrupt[unit].function = function;
controller->interrupt[unit].argument = argument;
*cookiep = controller;
diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h
index d7fc883..9f9e29b 100644
--- a/sys/dev/ata/ata-pci.h
+++ b/sys/dev/ata/ata-pci.h
@@ -430,7 +430,7 @@ int ata_pci_attach(device_t dev);
int ata_pci_detach(device_t dev);
struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r);
-int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_intr_t *function, void *argument, void **cookiep);
+int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep);
int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);
int ata_pci_allocate(device_t dev);
void ata_pci_hw(device_t dev);
diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c
index 20ca504..8c931c6 100644
--- a/sys/dev/ath/if_ath_pci.c
+++ b/sys/dev/ath/if_ath_pci.c
@@ -169,7 +169,7 @@ ath_pci_attach(device_t dev)
}
if (bus_setup_intr(dev, psc->sc_irq,
INTR_TYPE_NET | INTR_MPSAFE,
- ath_intr, sc, &psc->sc_ih)) {
+ NULL, ath_intr, sc, &psc->sc_ih)) {
device_printf(dev, "could not establish interrupt\n");
goto bad2;
}
diff --git a/sys/dev/atkbdc/atkbd_atkbdc.c b/sys/dev/atkbdc/atkbd_atkbdc.c
index 63c30d9..ec6555b 100644
--- a/sys/dev/atkbdc/atkbd_atkbdc.c
+++ b/sys/dev/atkbdc/atkbd_atkbdc.c
@@ -136,7 +136,7 @@ atkbdattach(device_t dev)
RF_SHAREABLE | RF_ACTIVE);
if (sc->intr == NULL)
return ENXIO;
- error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, atkbdintr,
+ error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, atkbdintr,
kbd, &sc->ih);
if (error)
bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr);
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 754799f..dfac849 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -1285,7 +1285,7 @@ psmattach(device_t dev)
RF_SHAREABLE | RF_ACTIVE);
if (sc->intr == NULL)
return (ENXIO);
- error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, psmintr, sc, &sc->ih);
+ error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, &sc->ih);
if (error) {
bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr);
return (error);
diff --git a/sys/dev/awi/if_awi_pccard.c b/sys/dev/awi/if_awi_pccard.c
index 28c0e17..815b15b 100644
--- a/sys/dev/awi/if_awi_pccard.c
+++ b/sys/dev/awi/if_awi_pccard.c
@@ -239,7 +239,7 @@ awi_pccard_enable(struct awi_softc *sc)
if (psc->sc_intrhand == 0) {
error = bus_setup_intr(dev, psc->sc_irq_res, INTR_TYPE_NET,
- (void (*)(void *))awi_intr, sc, &psc->sc_intrhand);
+ NULL, (void (*)(void *))awi_intr, sc, &psc->sc_intrhand);
if (error) {
device_printf(dev,
"couldn't establish interrupt error=%d\n", error);
diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c
index fc3c947..fc634c0 100644
--- a/sys/dev/bce/if_bce.c
+++ b/sys/dev/bce/if_bce.c
@@ -754,7 +754,7 @@ bce_attach(device_t dev)
#endif
/* Hookup IRQ last. */
- rc = bus_setup_intr(dev, sc->bce_irq, INTR_TYPE_NET | INTR_MPSAFE,
+ rc = bus_setup_intr(dev, sc->bce_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL,
bce_intr, sc, &sc->bce_intrhand);
if (rc) {
diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c
index dc24da9..b88a6bd 100644
--- a/sys/dev/bfe/if_bfe.c
+++ b/sys/dev/bfe/if_bfe.c
@@ -423,7 +423,7 @@ bfe_attach(device_t dev)
* Hook interrupt last to avoid having to lock softc
*/
error = bus_setup_intr(dev, sc->bfe_irq, INTR_TYPE_NET | INTR_MPSAFE,
- bfe_intr, sc, &sc->bfe_intrhand);
+ NULL, bfe_intr, sc, &sc->bfe_intrhand);
if (error) {
printf("bfe%d: couldn't set up irq\n", unit);
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index f7ec758..1243669 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -2505,7 +2505,7 @@ again:
* Hookup IRQ last.
*/
error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE,
- bge_intr, sc, &sc->bge_intrhand);
+ NULL, bge_intr, sc, &sc->bge_intrhand);
if (error) {
bge_detach(dev);
diff --git a/sys/dev/bktr/bktr_os.c b/sys/dev/bktr/bktr_os.c
index e51cdf9..9ce258c 100644
--- a/sys/dev/bktr/bktr_os.c
+++ b/sys/dev/bktr/bktr_os.c
@@ -384,7 +384,7 @@ bktr_attach( device_t dev )
}
error = bus_setup_intr(dev, bktr->res_irq, INTR_TYPE_TTY,
- bktr_intr, bktr, &bktr->res_ih);
+ NULL, bktr_intr, bktr, &bktr->res_ih);
if (error) {
device_printf(dev, "could not setup irq\n");
goto fail;
diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c
index af030a5..7eee35b 100644
--- a/sys/dev/buslogic/bt.c
+++ b/sys/dev/buslogic/bt.c
@@ -896,7 +896,7 @@ bt_attach(device_t dev)
/*
* Setup interrupt.
*/
- error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM|INTR_ENTROPY,
+ error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL,
bt_intr, bt, &bt->ih);
if (error) {
device_printf(dev, "bus_setup_intr() failed: %d\n", error);
diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c
index cf4204e..7de8e18 100644
--- a/sys/dev/ce/if_ce.c
+++ b/sys/dev/ce/if_ce.c
@@ -667,7 +667,7 @@ static int ce_attach (device_t dev)
#else
INTR_TYPE_NET,
#endif
- ce_intr, bd, &bd->ce_intrhand);
+ NULL, ce_intr, bd, &bd->ce_intrhand);
if (error) {
printf ("ce%d: cannot set up irq\n", unit);
bus_release_resource (dev, SYS_RES_IRQ, 0, bd->ce_irq);
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index 7b0d680..f23017b 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -655,7 +655,7 @@ ciss_init_pci(struct ciss_softc *sc)
return(ENXIO);
}
if (bus_setup_intr(sc->ciss_dev, sc->ciss_irq_resource,
- INTR_TYPE_CAM|INTR_ENTROPY, ciss_intr, sc,
+ INTR_TYPE_CAM|INTR_ENTROPY, NULL, ciss_intr, sc,
&sc->ciss_intr)) {
ciss_printf(sc, "can't set up interrupt\n");
return(ENXIO);
diff --git a/sys/dev/cm/if_cm_isa.c b/sys/dev/cm/if_cm_isa.c
index e8cf14a..2986c60 100644
--- a/sys/dev/cm/if_cm_isa.c
+++ b/sys/dev/cm/if_cm_isa.c
@@ -107,7 +107,7 @@ cm_isa_attach(dev)
mtx_init(&sc->sc_mtx, device_get_nameunit(dev),
MTX_NETWORK_LOCK, MTX_DEF);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- cmintr, sc, &sc->irq_handle);
+ NULL, cmintr, sc, &sc->irq_handle);
if (error)
goto err;
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index fbd0b0e..95b372a 100644
--- a/sys/dev/cp/if_cp.c
+++ b/sys/dev/cp/if_cp.c
@@ -481,7 +481,7 @@ static int cp_attach (device_t dev)
callout_init (&led_timo[unit], cp_mpsafenet ? CALLOUT_MPSAFE : 0);
error = bus_setup_intr (dev, bd->cp_irq,
INTR_TYPE_NET|(cp_mpsafenet?INTR_MPSAFE:0),
- cp_intr, bd, &bd->cp_intrhand);
+ NULL, cp_intr, bd, &bd->cp_intrhand);
if (error) {
cp_destroy = 1;
printf ("cp%d: cannot set up irq\n", unit);
diff --git a/sys/dev/cs/if_cs_isa.c b/sys/dev/cs/if_cs_isa.c
index 8064f4b..9c3bd30 100644
--- a/sys/dev/cs/if_cs_isa.c
+++ b/sys/dev/cs/if_cs_isa.c
@@ -99,7 +99,7 @@ cs_isa_attach(device_t dev)
cs_alloc_irq(dev, sc->irq_rid, 0);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- csintr, sc, &sc->irq_handle);
+ NULL, csintr, sc, &sc->irq_handle);
if (error) {
cs_release_resources(dev);
return (error);
diff --git a/sys/dev/cs/if_cs_pccard.c b/sys/dev/cs/if_cs_pccard.c
index 794f48d..fbb5587 100644
--- a/sys/dev/cs/if_cs_pccard.c
+++ b/sys/dev/cs/if_cs_pccard.c
@@ -91,7 +91,7 @@ cs_pccard_attach(device_t dev)
if (error != 0)
goto bad;
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- csintr, sc, &sc->irq_handle);
+ NULL, csintr, sc, &sc->irq_handle);
if (error != 0)
goto bad;
diff --git a/sys/dev/ct/ct_isa.c b/sys/dev/ct/ct_isa.c
index 7d6dad6..a1e3045 100644
--- a/sys/dev/ct/ct_isa.c
+++ b/sys/dev/ct/ct_isa.c
@@ -330,7 +330,7 @@ ct_isa_attach(device_t dev)
splx(s);
if (bus_setup_intr(dev, ct->irq_res, INTR_TYPE_CAM,
- (driver_intr_t *)ctintr, ct, &ct->sc_ih)) {
+ NULL, (driver_intr_t *)ctintr, ct, &ct->sc_ih)) {
ct_space_unmap(dev, ct);
return ENXIO;
}
diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c
index 7846334..079017b 100644
--- a/sys/dev/ctau/if_ct.c
+++ b/sys/dev/ctau/if_ct.c
@@ -682,7 +682,7 @@ static int ct_attach (device_t dev)
s = splimp ();
if (bus_setup_intr (dev, bd->irq_res,
INTR_TYPE_NET|(ct_mpsafenet?INTR_MPSAFE:0),
- ct_intr, bd, &bd->intrhand)) {
+ NULL, ct_intr, bd, &bd->intrhand)) {
printf ("ct%d: Can't setup irq %ld\n", unit, irq);
bd->board = 0;
adapter [unit] = 0;
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 4aa9829..7eedee7 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -780,7 +780,7 @@ static int cx_attach (device_t dev)
s = splhigh ();
if (bus_setup_intr (dev, bd->irq_res,
INTR_TYPE_NET|(cx_mpsafenet?INTR_MPSAFE:0),
- cx_intr, bd, &bd->intrhand)) {
+ NULL, cx_intr, bd, &bd->intrhand)) {
printf ("cx%d: Can't setup irq %ld\n", unit, irq);
bd->board = 0;
b->sys = 0;
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index c09bb1d..bfb83df 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -644,7 +644,7 @@ cyinput(struct com_s *com)
com->mcr_image |= com->mcr_rts);
}
-void
+int
cyintr(void *vcom)
{
struct com_s *basecom;
@@ -671,7 +671,7 @@ cyintr(void *vcom)
/* poll to see if it has any work */
status = cd_inb(iobase, CD1400_SVRR, cy_align);
if (status == 0)
- continue;
+ continue; // XXX - FILTER_STRAY?
#ifdef CyDebug
++cy_svrr_probes;
#endif
@@ -1111,6 +1111,7 @@ terminate_tx_service:
swi_sched(cy_slow_ih, SWI_DELAY);
COM_UNLOCK();
+ return (FILTER_HANDLED);
}
static void
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index a5203a7..390ccd2 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -133,8 +133,8 @@ cy_isa_attach(device_t dev)
device_printf(dev, "interrupt resource allocation failed\n");
goto fail;
}
- if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST, cyintr,
- vsc, &irq_cookie) != 0) {
+ if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY,
+ cyintr, NULL, vsc, &irq_cookie) != 0) {
device_printf(dev, "interrupt setup failed\n");
goto fail;
}
diff --git a/sys/dev/cy/cy_pci.c b/sys/dev/cy/cy_pci.c
index 2d07235..3cc3a3b 100644
--- a/sys/dev/cy/cy_pci.c
+++ b/sys/dev/cy/cy_pci.c
@@ -145,14 +145,14 @@ cy_pci_attach(dev)
goto fail;
}
#ifdef CY_PCI_FASTINTR
- irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY | INTR_FAST,
- cyintr, vsc, &irq_cookie);
+ irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY,
+ cyintr, NULL, vsc, &irq_cookie);
#else
irq_setup = ENXIO;
#endif
if (irq_setup != 0)
irq_setup = bus_setup_intr(dev, irq_res, INTR_TYPE_TTY,
- cyintr, vsc, &irq_cookie);
+ NULL, (driver_intr_t *)cyintr, vsc, &irq_cookie);
if (irq_setup != 0) {
device_printf(dev, "interrupt setup failed\n");
goto fail;
diff --git a/sys/dev/cy/cyvar.h b/sys/dev/cy/cyvar.h
index 15ee98c..6b770e8 100644
--- a/sys/dev/cy/cyvar.h
+++ b/sys/dev/cy/cyvar.h
@@ -32,5 +32,5 @@ extern devclass_t cy_devclass;
extern char cy_driver_name[];
void *cyattach_common(cy_addr cy_iobase, int cy_align);
-driver_intr_t cyintr;
+driver_filter_t cyintr;
int cy_units(cy_addr cy_iobase, int cy_align);
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index c699629..42474dc 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -2265,7 +2265,7 @@ dc_attach(device_t dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET | INTR_MPSAFE,
- dc_intr, sc, &sc->dc_intrhand);
+ NULL, dc_intr, sc, &sc->dc_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index c41efe3..2a51241 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -4890,7 +4890,7 @@ tulip_pci_attach(device_t dev)
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_SHAREABLE | RF_ACTIVE);
if (res == 0 || bus_setup_intr(dev, res, INTR_TYPE_NET |
- INTR_MPSAFE, intr_rtn, sc, &ih)) {
+ INTR_MPSAFE, NULL, intr_rtn, sc, &ih)) {
device_printf(dev, "couldn't map interrupt\n");
tulip_busdma_cleanup(sc);
ether_ifdetach(sc->tulip_ifp);
diff --git a/sys/dev/dpt/dpt_eisa.c b/sys/dev/dpt/dpt_eisa.c
index 742f9fa..431cf1e 100644
--- a/sys/dev/dpt/dpt_eisa.c
+++ b/sys/dev/dpt/dpt_eisa.c
@@ -155,7 +155,7 @@ dpt_eisa_attach (device_t dev)
splx(s);
if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- dpt_intr, dpt, &dpt->ih)) {
+ NULL, dpt_intr, dpt, &dpt->ih)) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto bad;
diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c
index e5bc6bc..9ca718c7b 100644
--- a/sys/dev/dpt/dpt_pci.c
+++ b/sys/dev/dpt/dpt_pci.c
@@ -163,7 +163,7 @@ dpt_pci_attach (device_t dev)
splx(s);
if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- dpt_intr, dpt, &dpt->ih)) {
+ NULL, dpt_intr, dpt, &dpt->ih)) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto bad;
diff --git a/sys/dev/drm/drm_irq.c b/sys/dev/drm/drm_irq.c
index 791f11c..580980e 100644
--- a/sys/dev/drm/drm_irq.c
+++ b/sys/dev/drm/drm_irq.c
@@ -110,7 +110,7 @@ int drm_irq_install(drm_device_t *dev)
dev->irq_handler, dev, &dev->irqh);
#else
retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY | INTR_MPSAFE,
- drm_irq_handler_wrap, dev, &dev->irqh);
+ NULL, drm_irq_handler_wrap, dev, &dev->irqh);
#endif
if (retcode != 0)
goto err;
diff --git a/sys/dev/ed/if_ed_cbus.c b/sys/dev/ed/if_ed_cbus.c
index cf78b55..dc4fabb 100644
--- a/sys/dev/ed/if_ed_cbus.c
+++ b/sys/dev/ed/if_ed_cbus.c
@@ -243,7 +243,7 @@ ed_cbus_attach(dev)
ed_alloc_irq(dev, sc->irq_rid, 0);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- edintr, sc, &sc->irq_handle);
+ NULL, edintr, sc, &sc->irq_handle);
if (error) {
ed_release_resources(dev);
return (error);
diff --git a/sys/dev/ed/if_ed_isa.c b/sys/dev/ed/if_ed_isa.c
index c0cd7ff..7d30614 100644
--- a/sys/dev/ed/if_ed_isa.c
+++ b/sys/dev/ed/if_ed_isa.c
@@ -170,7 +170,7 @@ ed_isa_attach(device_t dev)
ed_alloc_irq(dev, sc->irq_rid, 0);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- edintr, sc, &sc->irq_handle);
+ NULL, edintr, sc, &sc->irq_handle);
if (error) {
ed_release_resources(dev);
return (error);
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index 63877ef..a1e2938 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -478,7 +478,7 @@ ed_pccard_attach(device_t dev)
goto bad;
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- edintr, sc, &sc->irq_handle);
+ NULL, edintr, sc, &sc->irq_handle);
if (error) {
device_printf(dev, "setup intr failed %d \n", error);
goto bad;
diff --git a/sys/dev/ed/if_ed_pci.c b/sys/dev/ed/if_ed_pci.c
index 67a655f..68099ce 100644
--- a/sys/dev/ed/if_ed_pci.c
+++ b/sys/dev/ed/if_ed_pci.c
@@ -107,7 +107,7 @@ ed_pci_attach(device_t dev)
return (error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- edintr, sc, &sc->irq_handle);
+ NULL, edintr, sc, &sc->irq_handle);
if (error) {
ed_release_resources(dev);
return (error);
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c
index 47baffb..570b30d 100644
--- a/sys/dev/em/if_em.c
+++ b/sys/dev/em/if_em.c
@@ -275,7 +275,7 @@ static void em_add_int_delay_sysctl(struct adapter *, const char *,
static poll_handler_t em_poll;
static void em_intr(void *);
#else
-static void em_intr_fast(void *);
+static int em_intr_fast(void *);
static void em_add_int_process_limit(struct adapter *, const char *,
const char *, int *, int);
static void em_handle_rxtx(void *context, int pending);
@@ -1307,7 +1307,7 @@ em_handle_rxtx(void *context, int pending)
* Fast Interrupt Service routine
*
*********************************************************************/
-static void
+static int
em_intr_fast(void *arg)
{
struct adapter *adapter = arg;
@@ -1320,11 +1320,11 @@ em_intr_fast(void *arg)
/* Hot eject? */
if (reg_icr == 0xffffffff)
- return;
+ return (FILTER_STRAY);
/* Definitely not our interrupt. */
if (reg_icr == 0x0)
- return;
+ return (FILTER_STRAY);
/*
* Starting with the 82571 chip, bit 31 should be used to
@@ -1332,7 +1332,7 @@ em_intr_fast(void *arg)
*/
if (adapter->hw.mac_type >= em_82571 &&
(reg_icr & E1000_ICR_INT_ASSERTED) == 0)
- return;
+ return (FILTER_STRAY);
/*
* Mask interrupts until the taskqueue is finished running. This is
@@ -1348,6 +1348,7 @@ em_intr_fast(void *arg)
if (reg_icr & E1000_ICR_RXO)
adapter->rx_overruns++;
+ return (FILTER_HANDLED);
}
#endif /* ! DEVICE_POLLING */
@@ -2173,8 +2174,8 @@ em_allocate_intr(struct adapter *adapter)
#ifdef DEVICE_POLLING
if (adapter->int_handler_tag == NULL && (error = bus_setup_intr(dev,
- adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, em_intr, adapter,
- &adapter->int_handler_tag)) != 0) {
+ adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, NULL, em_intr,
+ adapter, &adapter->int_handler_tag)) != 0) {
device_printf(dev, "Failed to register interrupt handler");
return (error);
}
@@ -2190,7 +2191,7 @@ em_allocate_intr(struct adapter *adapter)
taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s taskq",
device_get_nameunit(adapter->dev));
if ((error = bus_setup_intr(dev, adapter->res_interrupt,
- INTR_TYPE_NET | INTR_FAST, em_intr_fast, adapter,
+ INTR_TYPE_NET, em_intr_fast, NULL, adapter,
&adapter->int_handler_tag)) != 0) {
device_printf(dev, "Failed to register fast interrupt "
"handler: %d\n", error);
diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c
index 61d77e7..09ba8bc 100644
--- a/sys/dev/en/if_en_pci.c
+++ b/sys/dev/en/if_en_pci.c
@@ -277,7 +277,7 @@ en_pci_attach(device_t dev)
* Do the interrupt SETUP last just before returning
*/
error = bus_setup_intr(dev, scp->irq, INTR_TYPE_NET,
- en_intr, sc, &scp->ih);
+ NULL, en_intr, sc, &scp->ih);
if (error) {
en_reset(sc);
atm_ifdetach(sc->ifp);
diff --git a/sys/dev/ep/if_ep_eisa.c b/sys/dev/ep/if_ep_eisa.c
index 123bad7..e25a531 100644
--- a/sys/dev/ep/if_ep_eisa.c
+++ b/sys/dev/ep/if_ep_eisa.c
@@ -217,8 +217,8 @@ ep_eisa_attach(device_t dev)
device_printf(dev, "ep_attach() failed! (%d)\n", error);
goto bad;
}
- if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, ep_intr,
- sc, &sc->ep_intrhand))) {
+ if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, ep_intr, sc, &sc->ep_intrhand))) {
device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
goto bad;
}
diff --git a/sys/dev/ep/if_ep_isa.c b/sys/dev/ep/if_ep_isa.c
index a1c6b5a..0455c40 100644
--- a/sys/dev/ep/if_ep_isa.c
+++ b/sys/dev/ep/if_ep_isa.c
@@ -336,8 +336,8 @@ ep_isa_attach(device_t dev)
device_printf(sc->dev, "Invalid EEPROM checksum!\n");
goto bad;
}
- if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, ep_intr,
- sc, &sc->ep_intrhand))) {
+ if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
+ NULL, ep_intr, sc, &sc->ep_intrhand))) {
device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
goto bad;
}
diff --git a/sys/dev/ep/if_ep_pccard.c b/sys/dev/ep/if_ep_pccard.c
index 37f494b..4309358 100644
--- a/sys/dev/ep/if_ep_pccard.c
+++ b/sys/dev/ep/if_ep_pccard.c
@@ -204,7 +204,7 @@ ep_pccard_attach(device_t dev)
goto bad;
}
if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- ep_intr, sc, &sc->ep_intrhand))) {
+ NULL, ep_intr, sc, &sc->ep_intrhand))) {
device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
goto bad;
}
diff --git a/sys/dev/esp/esp_sbus.c b/sys/dev/esp/esp_sbus.c
index 6e13c36..9c62d9b 100644
--- a/sys/dev/esp/esp_sbus.c
+++ b/sys/dev/esp/esp_sbus.c
@@ -691,7 +691,7 @@ espattach(struct esp_softc *esc, struct ncr53c9x_glue *gluep)
return (ENXIO);
}
if (bus_setup_intr(esc->sc_dev, esc->sc_irqres,
- INTR_TYPE_BIO|INTR_MPSAFE, ncr53c9x_intr, sc, &esc->sc_irq)) {
+ INTR_TYPE_BIO|INTR_MPSAFE, NULL, ncr53c9x_intr, sc, &esc->sc_irq)) {
device_printf(esc->sc_dev, "cannot set up interrupt\n");
error = ENXIO;
goto fail_ires;
diff --git a/sys/dev/ex/if_ex_isa.c b/sys/dev/ex/if_ex_isa.c
index 214a53e..84b71a2 100644
--- a/sys/dev/ex/if_ex_isa.c
+++ b/sys/dev/ex/if_ex_isa.c
@@ -314,7 +314,7 @@ ex_isa_attach(device_t dev)
}
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- ex_intr, (void *)sc, &sc->ih);
+ NULL, ex_intr, (void *)sc, &sc->ih);
if (error) {
device_printf(dev, "bus_setup_intr() failed!\n");
goto bad;
diff --git a/sys/dev/ex/if_ex_pccard.c b/sys/dev/ex/if_ex_pccard.c
index 3a3cb0b..1d16463 100644
--- a/sys/dev/ex/if_ex_pccard.c
+++ b/sys/dev/ex/if_ex_pccard.c
@@ -165,7 +165,7 @@ ex_pccard_attach(device_t dev)
}
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- ex_intr, (void *)sc, &sc->ih);
+ NULL, ex_intr, (void *)sc, &sc->ih);
if (error) {
device_printf(dev, "bus_setup_intr() failed!\n");
goto bad;
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c
index 6916c8c..8ba31c1 100644
--- a/sys/dev/fatm/if_fatm.c
+++ b/sys/dev/fatm/if_fatm.c
@@ -3060,7 +3060,7 @@ fatm_attach(device_t dev)
#endif
error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET | INTR_MPSAFE,
- fatm_intr, sc, &sc->ih);
+ NULL, fatm_intr, sc, &sc->ih);
if (error) {
if_printf(ifp, "couldn't setup irq\n");
goto fail;
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 4f48ead..c936951 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -261,6 +261,7 @@ struct fd_data {
#define FD_NOT_VALID -2
static driver_intr_t fdc_intr;
+static driver_filter_t fdc_intr_fast;
static void fdc_reset(struct fdc_data *);
SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver");
@@ -686,6 +687,14 @@ fdc_intr(void *arg)
wakeup(arg);
}
+static int
+fdc_intr_fast(void *arg)
+{
+
+ wakeup(arg);
+ return(FILTER_HANDLED);
+}
+
/*
* fdc_pio(): perform programmed IO read/write for YE PCMCIA floppy.
*/
@@ -1758,9 +1767,11 @@ fdc_attach(device_t dev)
return (error);
}
error = bus_setup_intr(dev, fdc->res_irq,
- INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE |
- ((fdc->flags & FDC_NOFAST) ? 0 : INTR_FAST),
- fdc_intr, fdc, &fdc->fdc_intr);
+ INTR_TYPE_BIO | INTR_ENTROPY |
+ ((fdc->flags & FDC_NOFAST) ? INTR_MPSAFE : 0),
+ ((fdc->flags & FDC_NOFAST) ? NULL : fdc_intr_fast),
+ ((fdc->flags & FDC_NOFAST) ? fdc_intr : NULL),
+ fdc, &fdc->fdc_intr);
if (error) {
device_printf(dev, "cannot setup interrupt\n");
return (error);
diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c
index fc0f2dc..14d3c46 100644
--- a/sys/dev/fe/if_fe.c
+++ b/sys/dev/fe/if_fe.c
@@ -741,7 +741,7 @@ fe_attach (device_t dev)
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- fe_intr, sc, &sc->irq_handle);
+ NULL, fe_intr, sc, &sc->irq_handle);
if (error) {
if_free(ifp);
fe_release_resource(dev);
diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c
index b5801f0..37bb2d8 100644
--- a/sys/dev/firewire/fwohci_pci.c
+++ b/sys/dev/firewire/fwohci_pci.c
@@ -342,7 +342,7 @@ fwohci_pci_attach(device_t self)
#else
INTR_TYPE_NET,
#endif
- (driver_intr_t *) fwohci_intr, sc, &sc->ih);
+ NULL, (driver_intr_t *) fwohci_intr, sc, &sc->ih);
#if defined(__DragonFly__) || __FreeBSD_version < 500000
/* XXX splcam() should mask this irq for sbp.c*/
err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_CAM,
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 630ffd7..a27d287 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -808,7 +808,7 @@ fxp_attach(device_t dev)
* Hook our interrupt after all initialization is complete.
*/
error = bus_setup_intr(dev, sc->fxp_res[1], INTR_TYPE_NET | INTR_MPSAFE,
- fxp_intr, sc, &sc->ih);
+ NULL, fxp_intr, sc, &sc->ih);
if (error) {
device_printf(dev, "could not setup irq\n");
ether_ifdetach(sc->ifp);
diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c
index bca56fe..cbc192c 100644
--- a/sys/dev/gem/if_gem_pci.c
+++ b/sys/dev/gem/if_gem_pci.c
@@ -210,7 +210,7 @@ gem_pci_attach(dev)
}
if (bus_setup_intr(dev, gsc->gsc_ires, INTR_TYPE_NET | INTR_MPSAFE,
- gem_intr, sc, &gsc->gsc_ih) != 0) {
+ NULL, gem_intr, sc, &gsc->gsc_ih) != 0) {
device_printf(dev, "failed to set up interrupt\n");
gem_detach(sc);
goto fail_ires;
diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c
index 37263f5..8532764 100644
--- a/sys/dev/hatm/if_hatm.c
+++ b/sys/dev/hatm/if_hatm.c
@@ -1951,7 +1951,7 @@ hatm_attach(device_t dev)
#endif
error = bus_setup_intr(dev, sc->irqres, sc->mpsafe | INTR_TYPE_NET,
- hatm_intr, &sc->irq_0, &sc->ih);
+ NULL, hatm_intr, &sc->irq_0, &sc->ih);
if (error != 0) {
device_printf(dev, "could not setup interrupt\n");
hatm_detach(dev);
diff --git a/sys/dev/hfa/hfa_pci.c b/sys/dev/hfa/hfa_pci.c
index fb28478..382f486 100644
--- a/sys/dev/hfa/hfa_pci.c
+++ b/sys/dev/hfa/hfa_pci.c
@@ -161,7 +161,7 @@ hfa_pci_attach (dev)
* Map interrupt in
*/
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- hfa_intr, sc, &sc->irq_ih);
+ NULL, hfa_intr, sc, &sc->irq_ih);
if (error) {
device_printf(dev, "Interrupt handler setup failed.\n");
goto fail;
diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c
index de92ce7..6f2666f 100644
--- a/sys/dev/hifn/hifn7751.c
+++ b/sys/dev/hifn/hifn7751.c
@@ -530,7 +530,7 @@ hifn_attach(device_t dev)
* so make sure the IRQ is marked appropriately.
*/
if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE,
- hifn_intr, sc, &sc->sc_intrhand)) {
+ NULL, hifn_intr, sc, &sc->sc_intrhand)) {
device_printf(dev, "could not setup interrupt\n");
goto fail_intr2;
}
diff --git a/sys/dev/hme/if_hme_pci.c b/sys/dev/hme/if_hme_pci.c
index ade6e19..ac77560 100644
--- a/sys/dev/hme/if_hme_pci.c
+++ b/sys/dev/hme/if_hme_pci.c
@@ -351,7 +351,7 @@ fail_children:
}
if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET |
- INTR_MPSAFE, hme_intr, sc, &hsc->hsc_ih)) != 0) {
+ INTR_MPSAFE, NULL, hme_intr, sc, &hsc->hsc_ih)) != 0) {
device_printf(dev, "couldn't establish interrupt\n");
hme_detach(sc);
goto fail_ires;
diff --git a/sys/dev/hme/if_hme_sbus.c b/sys/dev/hme/if_hme_sbus.c
index 300abc1..0e8eb45 100644
--- a/sys/dev/hme/if_hme_sbus.c
+++ b/sys/dev/hme/if_hme_sbus.c
@@ -269,7 +269,7 @@ hme_sbus_attach(device_t dev)
}
if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET |
- INTR_MPSAFE, hme_intr, sc, &hsc->hsc_ih)) != 0) {
+ INTR_MPSAFE, NULL, hme_intr, sc, &hsc->hsc_ih)) != 0) {
device_printf(dev, "couldn't establish interrupt\n");
hme_detach(sc);
goto fail_ires;
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c
index 5361f8b..0831743 100644
--- a/sys/dev/hptmv/entry.c
+++ b/sys/dev/hptmv/entry.c
@@ -1929,7 +1929,7 @@ hpt_attach(device_t dev)
return(ENXIO);
}
- if(bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, INTR_TYPE_CAM, hpt_intr, pAdapter, &pAdapter->hpt_intr))
+ if(bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, INTR_TYPE_CAM, NULL, hpt_intr, pAdapter, &pAdapter->hpt_intr))
{
hpt_printk(("can't set up interrupt\n"));
free(pAdapter, M_DEVBUF);
diff --git a/sys/dev/ichsmb/ichsmb.c b/sys/dev/ichsmb/ichsmb.c
index a12f287..9c60df7 100644
--- a/sys/dev/ichsmb/ichsmb.c
+++ b/sys/dev/ichsmb/ichsmb.c
@@ -125,7 +125,7 @@ ichsmb_attach(device_t dev)
/* Set up interrupt handler */
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC,
- ichsmb_device_intr, sc, &sc->irq_handle);
+ NULL, ichsmb_device_intr, sc, &sc->irq_handle);
if (error != 0) {
device_printf(dev, "can't setup irq\n");
goto fail;
diff --git a/sys/dev/ida/ida_eisa.c b/sys/dev/ida/ida_eisa.c
index 864b170..c1a0b40 100644
--- a/sys/dev/ida/ida_eisa.c
+++ b/sys/dev/ida/ida_eisa.c
@@ -324,7 +324,7 @@ ida_eisa_attach(device_t dev)
}
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY,
- ida_intr, ida, &ida->ih);
+ NULL, ida_intr, ida, &ida->ih);
if (error) {
device_printf(dev, "can't setup interrupt\n");
ida_free(ida);
diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c
index 3c98105..c33e235 100644
--- a/sys/dev/ida/ida_pci.c
+++ b/sys/dev/ida/ida_pci.c
@@ -298,7 +298,7 @@ ida_pci_attach(device_t dev)
return (ENOMEM);
}
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY,
- ida_intr, ida, &ida->ih);
+ NULL, ida_intr, ida, &ida->ih);
if (error) {
device_printf(dev, "can't setup interrupt\n");
ida_free(ida);
diff --git a/sys/dev/idt/idt_pci.c b/sys/dev/idt/idt_pci.c
index 1a77c4b..07c061d 100644
--- a/sys/dev/idt/idt_pci.c
+++ b/sys/dev/idt/idt_pci.c
@@ -160,7 +160,7 @@ idt_attach(device_t dev)
goto fail;
}
- error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, nicstar_intr,
+ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, NULL, nicstar_intr,
sc, &sc->irq_ih);
if (error) {
device_printf(dev, "could not setup irq.\n");
diff --git a/sys/dev/ie/if_ie_isa.c b/sys/dev/ie/if_ie_isa.c
index 811ea06..0b80fb6 100644
--- a/sys/dev/ie/if_ie_isa.c
+++ b/sys/dev/ie/if_ie_isa.c
@@ -270,7 +270,7 @@ ie_isa_3C507_attach (device_t dev)
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- ie_intr, sc, &sc->irq_ih);
+ NULL, ie_intr, sc, &sc->irq_ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
goto bad;
@@ -561,7 +561,7 @@ ie_isa_ee16_attach (device_t dev)
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- ie_intr, sc, &sc->irq_ih);
+ NULL, ie_intr, sc, &sc->irq_ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
goto bad;
@@ -773,7 +773,7 @@ ie_isa_sl_attach (device_t dev)
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- ie_intr, sc, &sc->irq_ih);
+ NULL, ie_intr, sc, &sc->irq_ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
goto bad;
diff --git a/sys/dev/iir/iir_pci.c b/sys/dev/iir/iir_pci.c
index daea1e7..dbeff0b 100644
--- a/sys/dev/iir/iir_pci.c
+++ b/sys/dev/iir/iir_pci.c
@@ -344,7 +344,7 @@ iir_pci_attach(device_t dev)
/* associate interrupt handler */
if (bus_setup_intr( dev, irq, INTR_TYPE_CAM,
- iir_intr, gdt, &ih )) {
+ NULL, iir_intr, gdt, &ih )) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto err;
diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c
index a82299c..12cf3f5 100644
--- a/sys/dev/ipmi/ipmi.c
+++ b/sys/dev/ipmi/ipmi.c
@@ -845,7 +845,7 @@ ipmi_attach(device_t dev)
if (sc->ipmi_irq_res != NULL && sc->ipmi_intr != NULL) {
error = bus_setup_intr(dev, sc->ipmi_irq_res, INTR_TYPE_MISC,
- sc->ipmi_intr, sc, &sc->ipmi_irq);
+ NULL, sc->ipmi_intr, sc, &sc->ipmi_irq);
if (error) {
device_printf(dev, "can't set up interrupt\n");
return (error);
diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c
index 167c08c..9ccaf37 100644
--- a/sys/dev/ips/ips_pci.c
+++ b/sys/dev/ips/ips_pci.c
@@ -130,7 +130,8 @@ static int ips_pci_attach(device_t dev)
device_printf(dev, "irq allocation failed\n");
goto error;
}
- if(bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO|INTR_MPSAFE, sc->ips_adapter_intr, sc, &sc->irqcookie)){
+ if(bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO|INTR_MPSAFE, NULL,
+ sc->ips_adapter_intr, sc, &sc->irqcookie)){
device_printf(dev, "irq setup failed\n");
goto error;
}
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c
index 7534949..d9cbaf5 100644
--- a/sys/dev/ipw/if_ipw.c
+++ b/sys/dev/ipw/if_ipw.c
@@ -348,7 +348,7 @@ ipw_attach(device_t dev)
* Hook our interrupt after all initialization is complete.
*/
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- ipw_intr, sc, &sc->sc_ih);
+ NULL, ipw_intr, sc, &sc->sc_ih);
if (error != 0) {
device_printf(dev, "could not set up interrupt\n");
goto fail;
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c
index 92b8527..64dcddf 100644
--- a/sys/dev/isp/isp_pci.c
+++ b/sys/dev/isp/isp_pci.c
@@ -1170,7 +1170,7 @@ isp_pci_attach(device_t dev)
locksetup++;
#endif
- if (bus_setup_intr(dev, irq, ISP_IFLAGS, isp_pci_intr, isp, &pcs->ih)) {
+ if (bus_setup_intr(dev, irq, ISP_IFLAGS, NULL, isp_pci_intr, isp, &pcs->ih)) {
device_printf(dev, "could not setup interrupt\n");
goto bad;
}
diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c
index c9a4294..6da80e5 100644
--- a/sys/dev/isp/isp_sbus.c
+++ b/sys/dev/isp/isp_sbus.c
@@ -312,7 +312,7 @@ isp_sbus_attach(device_t dev)
}
if (bus_setup_intr(dev, sbs->sbus_ires, ISP_IFLAGS,
- isp_sbus_intr, isp, &sbs->ih)) {
+ NULL, isp_sbus_intr, isp, &sbs->ih)) {
device_printf(dev, "could not setup interrupt\n");
goto bad;
}
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index e9c08c0..f504d80 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -452,7 +452,7 @@ iwi_attach(device_t dev)
* Hook our interrupt after all initialization is complete.
*/
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- iwi_intr, sc, &sc->sc_ih);
+ NULL, iwi_intr, sc, &sc->sc_ih);
if (error != 0) {
device_printf(dev, "could not set up interrupt\n");
goto fail;
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c
index 3886465..9b05c95 100644
--- a/sys/dev/ixgb/if_ixgb.c
+++ b/sys/dev/ixgb/if_ixgb.c
@@ -1268,7 +1268,7 @@ ixgb_allocate_pci_resources(struct adapter * adapter)
}
if (bus_setup_intr(dev, adapter->res_interrupt,
INTR_TYPE_NET | INTR_MPSAFE,
- (void (*) (void *))ixgb_intr, adapter,
+ NULL, (void (*) (void *))ixgb_intr, adapter,
&adapter->int_handler_tag)) {
printf("ixgb%d: Error registering interrupt handler!\n",
adapter->unit);
diff --git a/sys/dev/le/if_le_cbus.c b/sys/dev/le/if_le_cbus.c
index 63519d3..18026bd 100644
--- a/sys/dev/le/if_le_cbus.c
+++ b/sys/dev/le/if_le_cbus.c
@@ -377,7 +377,7 @@ le_cbus_attach(device_t dev)
}
error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE,
- am7990_intr, sc, &lesc->sc_ih);
+ NULL, am7990_intr, sc, &lesc->sc_ih);
if (error != 0) {
device_printf(dev, "cannot set up interrupt\n");
goto fail_am7990;
diff --git a/sys/dev/le/if_le_isa.c b/sys/dev/le/if_le_isa.c
index 957c49c..0519f5a 100644
--- a/sys/dev/le/if_le_isa.c
+++ b/sys/dev/le/if_le_isa.c
@@ -432,7 +432,7 @@ le_isa_attach(device_t dev)
}
error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE,
- am7990_intr, sc, &lesc->sc_ih);
+ NULL, am7990_intr, sc, &lesc->sc_ih);
if (error != 0) {
device_printf(dev, "cannot set up interrupt\n");
goto fail_am7990;
diff --git a/sys/dev/le/if_le_lebuffer.c b/sys/dev/le/if_le_lebuffer.c
index 6c3d367..0895598 100644
--- a/sys/dev/le/if_le_lebuffer.c
+++ b/sys/dev/le/if_le_lebuffer.c
@@ -341,7 +341,7 @@ le_lebuffer_attach(device_t dev)
}
error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE,
- am7990_intr, sc, &lesc->sc_ih);
+ NULL, am7990_intr, sc, &lesc->sc_ih);
if (error != 0) {
device_printf(dev, "cannot set up interrupt\n");
goto fail_am7990;
diff --git a/sys/dev/le/if_le_ledma.c b/sys/dev/le/if_le_ledma.c
index 5ca435e..affd5c8 100644
--- a/sys/dev/le/if_le_ledma.c
+++ b/sys/dev/le/if_le_ledma.c
@@ -419,7 +419,7 @@ le_dma_attach(device_t dev)
}
error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE,
- am7990_intr, sc, &lesc->sc_ih);
+ NULL, am7990_intr, sc, &lesc->sc_ih);
if (error != 0) {
device_printf(dev, "cannot set up interrupt\n");
goto fail_am7990;
diff --git a/sys/dev/le/if_le_pci.c b/sys/dev/le/if_le_pci.c
index 961f85f..841ab93 100644
--- a/sys/dev/le/if_le_pci.c
+++ b/sys/dev/le/if_le_pci.c
@@ -442,7 +442,7 @@ le_pci_attach(device_t dev)
}
error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE,
- am79900_intr, sc, &lesc->sc_ih);
+ NULL, am79900_intr, sc, &lesc->sc_ih);
if (error != 0) {
device_printf(dev, "cannot set up interrupt\n");
goto fail_am79900;
diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c
index 56731a8..e09134c 100644
--- a/sys/dev/lge/if_lge.c
+++ b/sys/dev/lge/if_lge.c
@@ -573,7 +573,7 @@ lge_attach(dev)
ether_ifattach(ifp, eaddr);
error = bus_setup_intr(dev, sc->lge_irq, INTR_TYPE_NET | INTR_MPSAFE,
- lge_intr, sc, &sc->lge_intrhand);
+ NULL, lge_intr, sc, &sc->lge_intrhand);
if (error) {
ether_ifdetach(ifp);
diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c
index f970d31..9165fae 100644
--- a/sys/dev/lmc/if_lmc.c
+++ b/sys/dev/lmc/if_lmc.c
@@ -5700,7 +5700,7 @@ fbsd_attach(device_t dev)
return ENXIO;
}
if ((error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
- bsd_interrupt, sc, &sc->irq_cookie)))
+ NULL, bsd_interrupt, sc, &sc->irq_cookie)))
{
printf("%s: bus_setup_intr() failed; error %d\n", NAME_UNIT, error);
fbsd_detach(dev);
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index b52e5d3..dcbfdd4 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -360,7 +360,7 @@ mfi_attach(struct mfi_softc *sc)
return (EINVAL);
}
if (bus_setup_intr(sc->mfi_dev, sc->mfi_irq, INTR_MPSAFE|INTR_TYPE_BIO,
- mfi_intr, sc, &sc->mfi_intr)) {
+ NULL, mfi_intr, sc, &sc->mfi_intr)) {
device_printf(sc->mfi_dev, "Cannot set up interrupt\n");
return (EINVAL);
}
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c
index d8cc79a..76205e1 100644
--- a/sys/dev/mlx/mlx.c
+++ b/sys/dev/mlx/mlx.c
@@ -364,7 +364,7 @@ mlx_attach(struct mlx_softc *sc)
device_printf(sc->mlx_dev, "can't allocate interrupt\n");
return(ENXIO);
}
- error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, mlx_intr, sc, &sc->mlx_intr);
+ error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, NULL, mlx_intr, sc, &sc->mlx_intr);
if (error) {
device_printf(sc->mlx_dev, "can't set up interrupt\n");
return(ENXIO);
diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c
index 72c8080..62052b0 100644
--- a/sys/dev/mly/mly.c
+++ b/sys/dev/mly/mly.c
@@ -380,7 +380,7 @@ mly_pci_attach(struct mly_softc *sc)
mly_printf(sc, "can't allocate interrupt\n");
goto fail;
}
- if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY, mly_intr, sc, &sc->mly_intr)) {
+ if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM | INTR_ENTROPY, NULL, mly_intr, sc, &sc->mly_intr)) {
mly_printf(sc, "can't set up interrupt\n");
goto fail;
}
diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c
index 47ce90b..2850d0b 100644
--- a/sys/dev/mpt/mpt_pci.c
+++ b/sys/dev/mpt/mpt_pci.c
@@ -563,7 +563,7 @@ mpt_pci_attach(device_t dev)
mpt_disable_ints(mpt);
/* Register the interrupt handler */
- if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, mpt_pci_intr,
+ if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, NULL, mpt_pci_intr,
mpt, &mpt->ih)) {
device_printf(dev, "could not setup interrupt\n");
goto bad;
diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c
index 28f6773..405be42 100644
--- a/sys/dev/mse/mse.c
+++ b/sys/dev/mse/mse.c
@@ -134,7 +134,7 @@ mse_common_attach(device_t dev)
}
if (bus_setup_intr(dev, sc->sc_intr,
- INTR_TYPE_TTY, mseintr, sc, &sc->sc_ih)) {
+ INTR_TYPE_TTY, NULL, mseintr, sc, &sc->sc_ih)) {
bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port);
bus_release_resource(dev, SYS_RES_IRQ, rid, sc->sc_intr);
return ENXIO;
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
index d6b10bff..d93a69f 100644
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -228,7 +228,7 @@ static int msk_attach(device_t);
static int msk_detach(device_t);
static void msk_tick(void *);
-static void msk_intr(void *);
+static int msk_intr(void *);
static void msk_int_task(void *, int);
static void msk_intr_phy(struct msk_if_softc *);
static void msk_intr_gmac(struct msk_if_softc *);
@@ -1784,7 +1784,7 @@ mskc_attach(device_t dev)
device_get_nameunit(sc->msk_dev));
/* Hook interrupt last to avoid having to lock softc. */
error = bus_setup_intr(dev, sc->msk_irq[0], INTR_TYPE_NET |
- INTR_MPSAFE | INTR_FAST, msk_intr, sc, &sc->msk_intrhand[0]);
+ INTR_MPSAFE, msk_intr, NULL, sc, &sc->msk_intrhand[0]);
if (error != 0) {
device_printf(dev, "couldn't set up interrupt handler\n");
@@ -3483,7 +3483,7 @@ msk_handle_events(struct msk_softc *sc)
return (sc->msk_stat_cons != CSR_READ_2(sc, STAT_PUT_IDX));
}
-static void
+static int
msk_intr(void *xsc)
{
struct msk_softc *sc;
@@ -3494,10 +3494,11 @@ msk_intr(void *xsc)
/* Reading B0_Y2_SP_ISRC2 masks further interrupts. */
if (status == 0 || status == 0xffffffff) {
CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
- return;
+ return (FILTER_STRAY);
}
taskqueue_enqueue(sc->msk_tq, &sc->msk_int_task);
+ return (FILTER_HANDLED);
}
static void
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index 6facddc..6323411 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -3024,7 +3024,7 @@ mxge_attach(device_t dev)
err = bus_setup_intr(sc->dev, sc->irq_res,
INTR_TYPE_NET | INTR_MPSAFE,
- mxge_intr, sc, &sc->ih);
+ NULL, mxge_intr, sc, &sc->ih);
if (err != 0) {
goto abort_with_rings;
}
diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c
index b17751c..e3e08a3 100644
--- a/sys/dev/my/if_my.c
+++ b/sys/dev/my/if_my.c
@@ -958,7 +958,7 @@ my_attach(device_t dev)
ether_ifattach(ifp, eaddr);
error = bus_setup_intr(dev, sc->my_irq, INTR_TYPE_NET | INTR_MPSAFE,
- my_intr, sc, &sc->my_intrhand);
+ NULL, my_intr, sc, &sc->my_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/dev/ncv/ncr53c500_pccard.c b/sys/dev/ncv/ncr53c500_pccard.c
index 1597d06..22dc827 100644
--- a/sys/dev/ncv/ncr53c500_pccard.c
+++ b/sys/dev/ncv/ncr53c500_pccard.c
@@ -246,7 +246,7 @@ ncv_pccard_attach(device_t dev)
return(ENXIO);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand);
+ NULL, ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand);
if (error) {
ncv_release_resource(dev);
return(error);
diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c
index 5ef9480..baeb090 100644
--- a/sys/dev/nfe/if_nfe.c
+++ b/sys/dev/nfe/if_nfe.c
@@ -409,7 +409,7 @@ nfe_attach(device_t dev)
ether_ifattach(ifp, sc->eaddr);
error = bus_setup_intr(dev, sc->nfe_irq, INTR_TYPE_NET | INTR_MPSAFE,
- nfe_intr, sc, &sc->nfe_intrhand);
+ NULL, nfe_intr, sc, &sc->nfe_intrhand);
if (error) {
printf("nfe%d: couldn't set up irq\n", unit);
diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c
index f74264f..79a8169 100644
--- a/sys/dev/nge/if_nge.c
+++ b/sys/dev/nge/if_nge.c
@@ -915,7 +915,7 @@ nge_attach(dev)
* Hookup IRQ last.
*/
error = bus_setup_intr(dev, sc->nge_irq, INTR_TYPE_NET | INTR_MPSAFE,
- nge_intr, sc, &sc->nge_intrhand);
+ NULL, nge_intr, sc, &sc->nge_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
goto fail;
diff --git a/sys/dev/nsp/nsp_pccard.c b/sys/dev/nsp/nsp_pccard.c
index 21141ae..718181b 100644
--- a/sys/dev/nsp/nsp_pccard.c
+++ b/sys/dev/nsp/nsp_pccard.c
@@ -187,7 +187,7 @@ nsp_pccard_attach(device_t dev)
return(ENXIO);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand);
+ NULL, nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand);
if (error) {
nsp_release_resource(dev);
return(error);
diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c
index 8b014c6..06ca4ba 100644
--- a/sys/dev/nve/if_nve.c
+++ b/sys/dev/nve/if_nve.c
@@ -536,7 +536,7 @@ nve_attach(device_t dev)
/* Activate our interrupt handler. - attach last to avoid lock */
error = bus_setup_intr(sc->dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- nve_intr, sc, &sc->sc_ih);
+ NULL, nve_intr, sc, &sc->sc_ih);
if (error) {
device_printf(sc->dev, "couldn't set up interrupt handler\n");
goto fail;
diff --git a/sys/dev/patm/if_patm_attach.c b/sys/dev/patm/if_patm_attach.c
index b0ab9c0..940d0ac 100644
--- a/sys/dev/patm/if_patm_attach.c
+++ b/sys/dev/patm/if_patm_attach.c
@@ -442,7 +442,7 @@ patm_attach(device_t dev)
patm_debug(sc, ATTACH, "attaching interrupt handler");
error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET | INTR_MPSAFE,
- patm_intr, sc, &sc->ih);
+ NULL, patm_intr, sc, &sc->ih);
if (error != 0) {
patm_printf(sc, "could not setup interrupt\n");
atm_ifdetach(sc->ifp);
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 45600ba..64e0a7c 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -118,10 +118,10 @@ static struct resource *pccard_alloc_resource(device_t dev,
static int pccard_release_resource(device_t dev, device_t child, int type,
int rid, struct resource *r);
static void pccard_child_detached(device_t parent, device_t dev);
-static void pccard_intr(void *arg);
+static int pccard_intr(void *arg);
static int pccard_setup_intr(device_t dev, device_t child,
- struct resource *irq, int flags, driver_intr_t *intr,
- void *arg, void **cookiep);
+ struct resource *irq, int flags, driver_filter_t *filt,
+ driver_intr_t *intr, void *arg, void **cookiep);
static int pccard_teardown_intr(device_t dev, device_t child,
struct resource *r, void *cookie);
@@ -1176,7 +1176,7 @@ pccard_child_detached(device_t parent, device_t dev)
pccard_function_disable(pf);
}
-static void
+static int
pccard_intr(void *arg)
{
struct pccard_function *pf = (struct pccard_function*) arg;
@@ -1207,13 +1207,19 @@ pccard_intr(void *arg)
else
doisr = 0;
}
- if (pf->intr_handler != NULL && doisr)
- pf->intr_handler(pf->intr_handler_arg);
+ if (doisr) {
+ if (pf->filt_handler != NULL)
+ pf->filt_handler(pf->intr_handler_arg);
+ else
+ pf->intr_handler(pf->intr_handler_arg);
+ }
+ return (FILTER_HANDLED);
}
static int
pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
struct pccard_softc *sc = PCCARD_SOFTC(dev);
struct pccard_ivar *ivar = PCCARD_IVAR(child);
@@ -1222,10 +1228,17 @@ pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
if (pf->intr_handler != NULL)
panic("Only one interrupt handler per function allowed");
- err = bus_generic_setup_intr(dev, child, irq, flags, pccard_intr,
- pf, cookiep);
+ if (filt != NULL && intr != NULL)
+ return (EINVAL);
+ if (filt != NULL)
+ err = bus_generic_setup_intr(dev, child, irq, flags,
+ pccard_intr, NULL, pf, cookiep);
+ else
+ err = bus_generic_setup_intr(dev, child, irq, flags,
+ NULL, (driver_intr_t *)pccard_intr, pf, cookiep);
if (err != 0)
return (err);
+ pf->filt_handler = filt;
pf->intr_handler = intr;
pf->intr_handler_arg = arg;
pf->intr_handler_cookie = *cookiep;
diff --git a/sys/dev/pccard/pccardvarp.h b/sys/dev/pccard/pccardvarp.h
index 66441c0..892a028 100644
--- a/sys/dev/pccard/pccardvarp.h
+++ b/sys/dev/pccard/pccardvarp.h
@@ -112,6 +112,7 @@ struct pccard_function {
bus_addr_t pf_mfc_iobase;
bus_addr_t pf_mfc_iomax;
int pf_flags;
+ driver_filter_t *filt_handler;
driver_intr_t *intr_handler;
void *intr_handler_arg;
void *intr_handler_cookie;
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index fd11678..d412e3a 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -358,7 +358,8 @@ cbb_detach(device_t brdev)
int
cbb_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
struct cbb_intrhand *ih;
struct cbb_softc *sc = device_get_softc(dev);
@@ -370,7 +371,7 @@ cbb_setup_intr(device_t dev, device_t child, struct resource *irq,
* least common denominator until the base system supports mixing
* and matching better.
*/
- if ((flags & INTR_FAST) != 0)
+ if (filt != NULL)
return (EINVAL);
ih = malloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_NOWAIT);
if (ih == NULL)
@@ -384,7 +385,7 @@ cbb_setup_intr(device_t dev, device_t child, struct resource *irq,
* XXX for now that's all we need to do.
*/
err = BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags,
- cbb_func_intr, ih, &ih->cookie);
+ NULL, cbb_func_intr, ih, &ih->cookie);
if (err != 0) {
free(ih, M_DEVBUF);
return (err);
diff --git a/sys/dev/pccbb/pccbb_pci.c b/sys/dev/pccbb/pccbb_pci.c
index ec72767..65b28f7 100644
--- a/sys/dev/pccbb/pccbb_pci.c
+++ b/sys/dev/pccbb/pccbb_pci.c
@@ -400,7 +400,7 @@ cbb_pci_attach(device_t brdev)
}
if (bus_setup_intr(brdev, sc->irq_res, INTR_TYPE_AV | INTR_MPSAFE,
- cbb_pci_intr, sc, &sc->intrhand)) {
+ NULL, cbb_pci_intr, sc, &sc->intrhand)) {
device_printf(brdev, "couldn't establish interrupt\n");
goto err;
}
diff --git a/sys/dev/pccbb/pccbbvar.h b/sys/dev/pccbb/pccbbvar.h
index 32bd0fe..15ea0a0 100644
--- a/sys/dev/pccbb/pccbbvar.h
+++ b/sys/dev/pccbb/pccbbvar.h
@@ -136,7 +136,8 @@ int cbb_release_resource(device_t brdev, device_t child,
int type, int rid, struct resource *r);
int cbb_resume(device_t self);
int cbb_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg, void **cookiep);
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
+ void **cookiep);
int cbb_suspend(device_t self);
int cbb_teardown_intr(device_t dev, device_t child, struct resource *irq,
void *cookie);
diff --git a/sys/dev/pcf/envctrl.c b/sys/dev/pcf/envctrl.c
index a567cb7..868c553 100644
--- a/sys/dev/pcf/envctrl.c
+++ b/sys/dev/pcf/envctrl.c
@@ -135,7 +135,7 @@ envctrl_attach(device_t dev)
rv = bus_setup_intr(dev, sc->res_irq,
INTR_TYPE_NET /* | INTR_ENTROPY */,
- pcf_intr, sc, &sc->intr_cookie);
+ NULL, pcf_intr, sc, &sc->intr_cookie);
if (rv) {
device_printf(dev, "could not setup IRQ\n");
goto error;
diff --git a/sys/dev/pcf/pcf_ebus.c b/sys/dev/pcf/pcf_ebus.c
index 46511a0..14deff8 100644
--- a/sys/dev/pcf/pcf_ebus.c
+++ b/sys/dev/pcf/pcf_ebus.c
@@ -194,7 +194,7 @@ pcf_ebus_attach(device_t dev)
if (sc->res_irq) {
rv = bus_setup_intr(dev, sc->res_irq,
- INTR_TYPE_NET /* | INTR_ENTROPY */, pcf_intr, sc,
+ INTR_TYPE_NET /* | INTR_ENTROPY */, NULL, pcf_intr, sc,
&sc->intr_cookie);
if (rv) {
device_printf(dev, "could not setup IRQ\n");
diff --git a/sys/dev/pcf/pcf_isa.c b/sys/dev/pcf/pcf_isa.c
index 34ce67d..2850d54 100644
--- a/sys/dev/pcf/pcf_isa.c
+++ b/sys/dev/pcf/pcf_isa.c
@@ -155,7 +155,7 @@ pcf_isa_attach(device_t dev)
if (sc->res_irq) {
rv = bus_setup_intr(dev, sc->res_irq,
INTR_TYPE_NET /* | INTR_ENTROPY */,
- pcf_intr, sc, &sc->intr_cookie);
+ NULL, pcf_intr, sc, &sc->intr_cookie);
if (rv) {
device_printf(dev, "could not setup IRQ\n");
goto error;
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index 7d94eea..dfee00d 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -358,7 +358,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
/* attach our interrupt handler, later detached when the bus is released */
if ((error = bus_setup_intr(dev, sc->res_irq,
- INTR_TYPE_NET, lp_intr, dev, &ih))) {
+ INTR_TYPE_NET, NULL, lp_intr, dev, &ih))) {
ppb_release_bus(ppbus, dev);
return (error);
}
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index e968aa5..1986d56 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -760,7 +760,7 @@ lptwrite(struct cdev *dev, struct uio *uio, int ioflag)
if (sc->sc_irq & LP_USE_IRQ) {
/* register our interrupt handler */
err = bus_setup_intr(lptdev, sc->intr_resource,
- INTR_TYPE_TTY, lpt_intr, lptdev,
+ INTR_TYPE_TTY, NULL, lpt_intr, lptdev,
&sc->intr_cookie);
if (err) {
device_printf(lptdev, "handler registration failed, polled mode.\n");
diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c
index 53421a2..40851d6 100644
--- a/sys/dev/ppbus/ppbconf.c
+++ b/sys/dev/ppbus/ppbconf.c
@@ -417,7 +417,7 @@ ppbus_detach(device_t dev)
static int
ppbus_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
- void (*ihand)(void *), void *arg, void **cookiep)
+ driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep)
{
int error;
struct ppb_data *ppb = DEVTOSOFTC(bus);
@@ -428,7 +428,7 @@ ppbus_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
return (EINVAL);
if ((error = BUS_SETUP_INTR(device_get_parent(bus), child, r, flags,
- ihand, arg, cookiep)))
+ filt, ihand, arg, cookiep)))
return (error);
/* store the resource and the cookie for eventually forcing
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index 37c785e..e491ed2 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -51,7 +51,7 @@ struct pps_data {
void *intr_cookie; /* interrupt registration cookie */
};
-static void ppsintr(void *arg);
+static int ppsintr(void *arg);
static void ppshcpoll(void *arg);
#define DEVTOSOFTC(dev) \
@@ -205,7 +205,7 @@ ppsopen(struct cdev *dev, int flags, int fmt, struct thread *td)
/* attach the interrupt handler */
if ((error = bus_setup_intr(ppsdev, sc->intr_resource,
- (INTR_TYPE_TTY | INTR_MPSAFE | INTR_FAST), ppsintr,
+ (INTR_TYPE_TTY | INTR_MPSAFE), ppsintr, NULL,
sc, &sc->intr_cookie))) {
ppb_release_bus(ppbus, ppsdev);
return (error);
@@ -276,14 +276,14 @@ ppshcpoll(void *arg)
mtx_unlock_spin(&sc->mtx);
}
-static void
+static int
ppsintr(void *arg)
{
struct pps_data *sc = (struct pps_data *)arg;
pps_capture(&sc->pps[0]);
if (!(ppb_rstr(sc->ppbus) & nACK))
- return;
+ return (FILTER_STRAY);
if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT)
ppb_wctr(sc->ppbus, IRQENABLE | AUTOFEED);
mtx_lock_spin(&sc->mtx);
@@ -291,6 +291,7 @@ ppsintr(void *arg)
mtx_unlock_spin(&sc->mtx);
if (sc->pps[0].ppsparam.mode & PPS_ECHOASSERT)
ppb_wctr(sc->ppbus, IRQENABLE);
+ return (FILTER_HANDLED);
}
static int
diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c
index 5d4e68d..4cb1b2a 100644
--- a/sys/dev/ppc/ppc.c
+++ b/sys/dev/ppc/ppc.c
@@ -1822,7 +1822,7 @@ ppc_attach(device_t dev)
if (ppc->res_irq) {
/* default to the tty mask for registration */ /* XXX */
if (bus_setup_intr(dev, ppc->res_irq, INTR_TYPE_TTY,
- ppcintr, dev, &ppc->intr_cookie) == 0) {
+ NULL, ppcintr, dev, &ppc->intr_cookie) == 0) {
/* remember the ppcintr is registered */
ppc->ppc_registered = 1;
@@ -1963,7 +1963,7 @@ ppc_read_ivar(device_t bus, device_t dev, int index, uintptr_t *val)
*/
int
ppc_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
- void (*ihand)(void *), void *arg, void **cookiep)
+ driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep)
{
int error;
struct ppc_data *ppc = DEVTOSOFTC(bus);
@@ -1985,7 +1985,7 @@ ppc_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
/* pass registration to the upper layer, ignore the incoming resource */
return (BUS_SETUP_INTR(device_get_parent(bus), child,
- r, flags, ihand, arg, cookiep));
+ r, flags, filt, ihand, arg, cookiep));
}
/*
@@ -2006,7 +2006,7 @@ ppc_teardown_intr(device_t bus, device_t child, struct resource *r, void *ih)
/* default to the tty mask for registration */ /* XXX */
if (ppc->ppc_irq &&
!(error = BUS_SETUP_INTR(parent, bus, ppc->res_irq,
- INTR_TYPE_TTY, ppcintr, bus, &ppc->intr_cookie))) {
+ INTR_TYPE_TTY, NULL, ppcintr, bus, &ppc->intr_cookie))) {
/* remember the ppcintr is registered */
ppc->ppc_registered = 1;
diff --git a/sys/dev/ppc/ppcvar.h b/sys/dev/ppc/ppcvar.h
index b7d1643..b8723bc 100644
--- a/sys/dev/ppc/ppcvar.h
+++ b/sys/dev/ppc/ppcvar.h
@@ -40,7 +40,7 @@ u_char ppc_io(device_t, int, u_char *, int, u_char);
int ppc_exec_microseq(device_t, struct ppb_microseq **);
int ppc_setup_intr(device_t, device_t, struct resource *, int,
- void (*)(void *), void *, void **);
+ driver_filter_t *filt, void (*)(void *), void *, void **);
int ppc_teardown_intr(device_t, device_t, struct resource *, void *);
void ppc_reset_epp(device_t);
void ppc_ecp_sync(device_t);
diff --git a/sys/dev/pst/pst-iop.c b/sys/dev/pst/pst-iop.c
index 1b017fd..d4e83f0 100644
--- a/sys/dev/pst/pst-iop.c
+++ b/sys/dev/pst/pst-iop.c
@@ -159,7 +159,7 @@ iop_attach(void *arg)
/* setup and enable interrupts */
bus_setup_intr(sc->dev, sc->r_irq, INTR_TYPE_BIO|INTR_ENTROPY|INTR_MPSAFE,
- iop_intr, sc, &sc->handle);
+ NULL, iop_intr, sc, &sc->handle);
sc->reg->oqueue_intr_mask = 0x0;
}
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
index a3da606..042cbe8 100644
--- a/sys/dev/puc/puc.c
+++ b/sys/dev/puc/puc.c
@@ -59,7 +59,7 @@ struct puc_port {
int p_hasintr:1;
- driver_intr_t *p_ih;
+ driver_filter_t *p_ih;
serdev_intr_t *p_ihsrc[PUC_ISRCCNT];
void *p_iharg;
@@ -125,7 +125,7 @@ puc_get_bar(struct puc_softc *sc, int rid)
return (bar);
}
-static void
+static int
puc_intr(void *arg)
{
struct puc_port *port;
@@ -183,7 +183,9 @@ puc_intr(void *arg)
if (port->p_ihsrc[i] != NULL)
(*port->p_ihsrc[i])(port->p_iharg);
}
+ return (FILTER_HANDLED);
}
+ return (FILTER_STRAY);
}
int
@@ -312,11 +314,11 @@ puc_bfe_attach(device_t dev)
RF_ACTIVE|RF_SHAREABLE);
if (sc->sc_ires != NULL) {
error = bus_setup_intr(dev, sc->sc_ires,
- INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->sc_icookie);
+ INTR_TYPE_TTY, puc_intr, NULL, sc, &sc->sc_icookie);
if (error)
error = bus_setup_intr(dev, sc->sc_ires,
- INTR_TYPE_TTY | INTR_MPSAFE, puc_intr, sc,
- &sc->sc_icookie);
+ INTR_TYPE_TTY | INTR_MPSAFE, NULL,
+ (driver_intr_t *)puc_intr, sc, &sc->sc_icookie);
else
sc->sc_fastintr = 1;
@@ -583,7 +585,7 @@ puc_bus_get_resource(device_t dev, device_t child, int type, int rid,
int
puc_bus_setup_intr(device_t dev, device_t child, struct resource *res,
- int flags, void (*ihand)(void *), void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep)
{
struct puc_port *port;
struct puc_softc *sc;
@@ -602,7 +604,7 @@ puc_bus_setup_intr(device_t dev, device_t child, struct resource *res,
port = device_get_ivars(child);
KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
- if (ihand == NULL || cookiep == NULL || res != port->p_ires)
+ if (filt == NULL || cookiep == NULL || res != port->p_ires)
return (EINVAL);
if (rman_get_device(port->p_ires) != originator)
return (ENXIO);
@@ -624,16 +626,16 @@ puc_bus_setup_intr(device_t dev, device_t child, struct resource *res,
}
if (!serdev)
return (BUS_SETUP_INTR(device_get_parent(dev), originator,
- sc->sc_ires, flags, ihand, arg, cookiep));
+ sc->sc_ires, flags, filt, ihand, arg, cookiep));
/* We demand that serdev devices use fast interrupts. */
- if (!(flags & INTR_FAST))
+ if (filt == NULL)
return (ENXIO);
sc->sc_serdevs |= 1UL << (port->p_nr - 1);
port->p_hasintr = 1;
- port->p_ih = ihand;
+ port->p_ih = filt;
port->p_iharg = arg;
*cookiep = port;
diff --git a/sys/dev/puc/puc_bfe.h b/sys/dev/puc/puc_bfe.h
index 199ba53..f6d69c4 100644
--- a/sys/dev/puc/puc_bfe.h
+++ b/sys/dev/puc/puc_bfe.h
@@ -88,7 +88,7 @@ int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int puc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int puc_bus_setup_intr(device_t, device_t, struct resource *, int,
- driver_intr_t *, void *, void **);
+ driver_filter_t *, driver_intr_t *, void *, void **);
int puc_bus_teardown_intr(device_t, device_t, struct resource *, void *);
#endif /* _DEV_PUC_BFE_H_ */
diff --git a/sys/dev/ral/if_ral_pci.c b/sys/dev/ral/if_ral_pci.c
index f1cc23c..3d9976d 100644
--- a/sys/dev/ral/if_ral_pci.c
+++ b/sys/dev/ral/if_ral_pci.c
@@ -209,7 +209,7 @@ ral_pci_attach(device_t dev)
* Hook our interrupt after all initialization is complete.
*/
error = bus_setup_intr(dev, psc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- psc->sc_opns->intr, psc, &psc->sc_ih);
+ NULL, psc->sc_opns->intr, psc, &psc->sc_ih);
if (error != 0) {
device_printf(dev, "could not set up interrupt\n");
return error;
diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c
index 8b7d140..1477c84 100644
--- a/sys/dev/ray/if_ray.c
+++ b/sys/dev/ray/if_ray.c
@@ -3749,7 +3749,7 @@ ray_res_alloc_irq(struct ray_softc *sc)
return (ENOMEM);
}
if ((error = bus_setup_intr(sc->dev, sc->irq_res, INTR_TYPE_NET,
- ray_intr, sc, &sc->irq_handle)) != 0) {
+ NULL, ray_intr, sc, &sc->irq_handle)) != 0) {
RAY_PRINTF(sc, "Failed to setup irq");
return (error);
}
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 1da5067..0c11358 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -304,8 +304,8 @@ rc_attach(device_t dev)
ttycreate(tp, TS_CALLOUT, "m%d", chan + base);
}
- error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_TTY, rc_intr, sc,
- &sc->sc_hwicookie);
+ error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_TTY, NULL, rc_intr,
+ sc, &sc->sc_hwicookie);
if (error) {
device_printf(dev, "failed to register interrupt handler\n");
goto fail;
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 6ac6519..d3328e0 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -241,7 +241,7 @@ static void re_txeof (struct rl_softc *);
static void re_poll (struct ifnet *, enum poll_cmd, int);
static void re_poll_locked (struct ifnet *, enum poll_cmd, int);
#endif
-static void re_intr (void *);
+static int re_intr (void *);
static void re_tick (void *);
static void re_tx_task (void *, int);
static void re_int_task (void *, int);
@@ -1318,8 +1318,8 @@ re_attach(dev)
#endif
/* Hook interrupt last to avoid having to lock softc */
- error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE |
- INTR_FAST, re_intr, sc, &sc->rl_intrhand);
+ error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE,
+ re_intr, NULL, sc, &sc->rl_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
ether_ifdetach(ifp);
@@ -1927,7 +1927,7 @@ re_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
}
#endif /* DEVICE_POLLING */
-static void
+static int
re_intr(arg)
void *arg;
{
@@ -1938,12 +1938,12 @@ re_intr(arg)
status = CSR_READ_2(sc, RL_ISR);
if (status == 0xFFFF || (status & RL_INTRS_CPLUS) == 0)
- return;
+ return (FILTER_STRAY);
CSR_WRITE_2(sc, RL_IMR, 0);
taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_inttask);
- return;
+ return (FILTER_HANDLED);
}
static void
diff --git a/sys/dev/rr232x/osm_bsd.c b/sys/dev/rr232x/osm_bsd.c
index e93b9ba..1e77fbf 100644
--- a/sys/dev/rr232x/osm_bsd.c
+++ b/sys/dev/rr232x/osm_bsd.c
@@ -1131,7 +1131,7 @@ static void hpt_final_init(void *dummy)
}
if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM,
- hpt_pci_intr, vbus_ext, &hba->irq_handle))
+ NULL, hpt_pci_intr, vbus_ext, &hba->irq_handle))
{
os_printk("can't set up interrupt");
return ;
diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c
index ff0a029..7551e14 100644
--- a/sys/dev/safe/safe.c
+++ b/sys/dev/safe/safe.c
@@ -265,7 +265,7 @@ safe_attach(device_t dev)
* so make sure the IRQ is mapped appropriately.
*/
if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE,
- safe_intr, sc, &sc->sc_ih)) {
+ NULL, safe_intr, sc, &sc->sc_ih)) {
device_printf(dev, "could not establish interrupt\n");
goto bad2;
}
diff --git a/sys/dev/sbni/if_sbni_isa.c b/sys/dev/sbni/if_sbni_isa.c
index 3565829..cacb94f 100644
--- a/sys/dev/sbni/if_sbni_isa.c
+++ b/sys/dev/sbni/if_sbni_isa.c
@@ -123,7 +123,7 @@ sbni_attach_isa(device_t dev)
printf(" irq %ld\n", rman_get_start(sc->irq_res));
error = bus_setup_intr(
dev, sc->irq_res, INTR_TYPE_NET,
- sbni_intr, sc, &sc->irq_handle);
+ NULL, sbni_intr, sc, &sc->irq_handle);
if (error) {
printf("sbni%d: bus_setup_intr\n", next_sbni_unit);
bus_release_resource(
diff --git a/sys/dev/sbni/if_sbni_pci.c b/sys/dev/sbni/if_sbni_pci.c
index 92e864e..6aac792 100644
--- a/sys/dev/sbni/if_sbni_pci.c
+++ b/sys/dev/sbni/if_sbni_pci.c
@@ -137,7 +137,7 @@ sbni_pci_attach(device_t dev)
if (sc->irq_res) {
printf(" irq %ld\n", rman_get_start(sc->irq_res));
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- sbni_intr, sc, &sc->irq_handle);
+ NULL, sbni_intr, sc, &sc->irq_handle);
if (error) {
printf("sbni%d: bus_setup_intr\n", next_sbni_unit);
goto attach_failed;
diff --git a/sys/dev/sbsh/if_sbsh.c b/sys/dev/sbsh/if_sbsh.c
index c23f889..3c515f5 100644
--- a/sys/dev/sbsh/if_sbsh.c
+++ b/sys/dev/sbsh/if_sbsh.c
@@ -256,7 +256,7 @@ sbsh_attach(device_t dev)
init_card(sc);
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
- sbsh_intr, sc, &sc->intr_hand);
+ NULL, sbsh_intr, sc, &sc->intr_hand);
if (error) {
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
bus_release_resource(dev, SYS_RES_MEMORY,
diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h
index 0107eae..5e7cc83 100644
--- a/sys/dev/scc/scc_bfe.h
+++ b/sys/dev/scc/scc_bfe.h
@@ -76,7 +76,7 @@ struct scc_mode {
int m_probed:1;
int m_sysdev:1;
- driver_intr_t *ih;
+ driver_filter_t *ih;
serdev_intr_t *ih_src[SCC_ISRCCNT];
void *ih_arg;
};
@@ -146,7 +146,7 @@ int scc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
int scc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int scc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int scc_bus_setup_intr(device_t, device_t, struct resource *, int,
- void (*)(void *), void *, void **);
+ driver_filter_t *, void (*)(void *), void *, void **);
int scc_bus_teardown_intr(device_t, device_t, struct resource *, void *);
#endif /* _DEV_SCC_BFE_H_ */
diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c
index 17be686..1aa7549 100644
--- a/sys/dev/scc/scc_core.c
+++ b/sys/dev/scc/scc_core.c
@@ -50,7 +50,7 @@ char scc_driver_name[] = "scc";
MALLOC_DEFINE(M_SCC, "SCC", "SCC driver");
-static void
+static int
scc_bfe_intr(void *arg)
{
struct scc_softc *sc = arg;
@@ -88,7 +88,9 @@ scc_bfe_intr(void *arg)
else
SCC_ICLEAR(sc, ch);
}
+ return (FILTER_HANDLED);
}
+ return (FILTER_STRAY);
}
int
@@ -217,12 +219,12 @@ scc_bfe_attach(device_t dev)
if (ch->ch_ires == NULL)
continue;
error = bus_setup_intr(dev, ch->ch_ires,
- INTR_TYPE_TTY | INTR_FAST, scc_bfe_intr, sc,
+ INTR_TYPE_TTY, scc_bfe_intr, NULL, sc,
&ch->ch_icookie);
if (error) {
error = bus_setup_intr(dev, ch->ch_ires,
- INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc,
- &ch->ch_icookie);
+ INTR_TYPE_TTY | INTR_MPSAFE, NULL,
+ (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie);
} else
sc->sc_fastintr = 1;
@@ -495,7 +497,7 @@ scc_bus_release_resource(device_t dev, device_t child, int type, int rid,
int
scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags,
- void (*ihand)(void *), void *arg, void **cookiep)
+ driver_filter_t *filt, void (*ihand)(void *), void *arg, void **cookiep)
{
struct scc_chan *ch;
struct scc_mode *m;
@@ -506,14 +508,14 @@ scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags,
return (EINVAL);
/* Interrupt handlers must be FAST or MPSAFE. */
- if ((flags & (INTR_FAST|INTR_MPSAFE)) == 0)
+ if (filt == NULL && !(flags & INTR_MPSAFE))
return (EINVAL);
sc = device_get_softc(dev);
if (sc->sc_polled)
return (ENXIO);
- if (sc->sc_fastintr && !(flags & INTR_FAST)) {
+ if (sc->sc_fastintr && filt == NULL) {
sc->sc_fastintr = 0;
for (c = 0; c < sc->sc_class->cl_channels; c++) {
ch = &sc->sc_chan[c];
@@ -521,15 +523,15 @@ scc_bus_setup_intr(device_t dev, device_t child, struct resource *r, int flags,
continue;
bus_teardown_intr(dev, ch->ch_ires, ch->ch_icookie);
bus_setup_intr(dev, ch->ch_ires,
- INTR_TYPE_TTY | INTR_MPSAFE, scc_bfe_intr, sc,
- &ch->ch_icookie);
+ INTR_TYPE_TTY | INTR_MPSAFE, NULL,
+ (driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie);
}
}
m = device_get_ivars(child);
m->m_hasintr = 1;
- m->m_fastintr = (flags & INTR_FAST) ? 1 : 0;
- m->ih = ihand;
+ m->m_fastintr = (filt != NULL) ? 1 : 0;
+ m->ih = (filt != NULL) ? filt : (driver_filter_t *)ihand;
m->ih_arg = arg;
i = 0, isrc = SER_INT_OVERRUN;
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c
index a308e40..c76f4d3 100644
--- a/sys/dev/sf/if_sf.c
+++ b/sys/dev/sf/if_sf.c
@@ -784,7 +784,7 @@ sf_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->sf_irq, INTR_TYPE_NET | INTR_MPSAFE,
- sf_intr, sc, &sc->sf_intrhand);
+ NULL, sf_intr, sc, &sc->sf_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 834e8eb..006eefc 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -263,7 +263,7 @@ static void comclose(struct tty *tp);
static int comopen(struct tty *tp, struct cdev *dev);
static void sioinput(struct com_s *com);
static void siointr1(struct com_s *com);
-static void siointr(void *arg);
+static int siointr(void *arg);
static int commodem(struct tty *tp, int sigon, int sigoff);
static int comparam(struct tty *tp, struct termios *t);
static void siopoll(void *);
@@ -1075,12 +1075,13 @@ determined_type: ;
com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
if (com->irqres) {
ret = bus_setup_intr(dev, com->irqres,
- INTR_TYPE_TTY | INTR_FAST,
- siointr, com, &com->cookie);
+ INTR_TYPE_TTY,
+ siointr, NULL, com,
+ &com->cookie);
if (ret) {
ret = bus_setup_intr(dev,
com->irqres, INTR_TYPE_TTY,
- siointr, com, &com->cookie);
+ NULL, (driver_intr_t *)siointr, com, &com->cookie);
if (ret == 0)
device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n");
}
@@ -1378,7 +1379,7 @@ sioinput(com)
outb(com->modem_ctl_port, com->mcr_image |= MCR_RTS);
}
-static void
+static int
siointr(arg)
void *arg;
{
@@ -1422,6 +1423,7 @@ siointr(arg)
} while (possibly_more_intrs);
mtx_unlock_spin(&sio_lock);
#endif /* COM_MULTIPORT */
+ return(FILTER_HANDLED);
}
static struct timespec siots[8];
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index 861707f..83ec4b7 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -1799,7 +1799,7 @@ vpdfailed:
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->sk_res[1], INTR_TYPE_NET|INTR_MPSAFE,
- sk_intr, sc, &sc->sk_intrhand);
+ NULL, sk_intr, sc, &sc->sk_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c
index 3845bf3..42da0dd 100644
--- a/sys/dev/sn/if_sn.c
+++ b/sys/dev/sn/if_sn.c
@@ -218,7 +218,8 @@ sn_attach(device_t dev)
* during startup to avoid LORs in the network layer.
*/
if ((err = bus_setup_intr(dev, sc->irq_res,
- INTR_TYPE_NET | INTR_MPSAFE, sn_intr, sc, &sc->intrhand)) != 0) {
+ INTR_TYPE_NET | INTR_MPSAFE, NULL, sn_intr, sc,
+ &sc->intrhand)) != 0) {
sn_detach(dev);
return err;
}
diff --git a/sys/dev/snc/if_snc_cbus.c b/sys/dev/snc/if_snc_cbus.c
index 1b9ef3e..f280de3 100644
--- a/sys/dev/snc/if_snc_cbus.c
+++ b/sys/dev/snc/if_snc_cbus.c
@@ -190,7 +190,7 @@ snc_isa_attach(dev)
snc_alloc_irq(dev, 0, 0);
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- sncintr, sc, &sc->irq_handle);
+ NULL, sncintr, sc, &sc->irq_handle);
if (error) {
printf("snc_isa_attach: bus_setup_intr() failed\n");
snc_release_resources(dev);
diff --git a/sys/dev/snc/if_snc_pccard.c b/sys/dev/snc/if_snc_pccard.c
index ccc0760..5a0a2d5 100644
--- a/sys/dev/snc/if_snc_pccard.c
+++ b/sys/dev/snc/if_snc_pccard.c
@@ -135,7 +135,7 @@ snc_pccard_attach(device_t dev)
snc_alloc_irq(dev, 0, 0);
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- sncintr, sc, &sc->irq_handle);
+ NULL, sncintr, sc, &sc->irq_handle);
if (error) {
printf("snc_isa_attach: bus_setup_intr() failed\n");
snc_release_resources(dev);
diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c
index 36adec4..27aa649 100644
--- a/sys/dev/sound/isa/gusc.c
+++ b/sys/dev/sound/isa/gusc.c
@@ -316,7 +316,7 @@ gusc_attach(device_t dev)
}
if (scp->irq != NULL)
- bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, gusc_intr, scp, &ih);
+ bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, NULL, gusc_intr, scp, &ih);
bus_generic_attach(dev);
return (0);
@@ -419,11 +419,15 @@ gusc_release_resource(device_t bus, device_t child, int type, int rid,
static int
gusc_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep)
{
sc_p scp = (sc_p)device_get_softc(dev);
devclass_t devclass;
+ if (filter != NULL) {
+ printf("gusc.c: we cannot use a filter here\n");
+ return (EINVAL);
+ }
devclass = device_get_devclass(child);
if (strcmp(devclass_get_name(devclass), "midi") == 0) {
scp->midi_intr.intr = intr;
@@ -434,7 +438,7 @@ gusc_setup_intr(device_t dev, device_t child, struct resource *irq,
scp->pcm_intr.arg = arg;
return 0;
}
- return bus_generic_setup_intr(dev, child, irq, flags, intr,
+ return bus_generic_setup_intr(dev, child, irq, flags, filter, intr,
arg, cookiep);
}
diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c
index c311ed7..d8787a1 100644
--- a/sys/dev/sound/isa/sbc.c
+++ b/sys/dev/sound/isa/sbc.c
@@ -80,8 +80,8 @@ static struct resource *sbc_alloc_resource(device_t bus, device_t child, int typ
static int sbc_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg,
- void **cookiep);
+ int flags, driver_filter_t *filter, driver_intr_t *intr,
+ void *arg, void **cookiep);
static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq,
void *cookie);
@@ -503,13 +503,17 @@ sbc_intr(void *p)
static int
sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg,
- void **cookiep)
+ int flags, driver_filter_t *filter, driver_intr_t *intr,
+ void *arg, void **cookiep)
{
struct sbc_softc *scp = device_get_softc(dev);
struct sbc_ihl *ihl = NULL;
int i, ret;
+ if (filter != NULL) {
+ printf("sbc.c: we cannot use a filter here\n");
+ return (EINVAL);
+ }
sbc_lock(scp);
i = 0;
while (i < IRQ_MAX) {
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
index 1e38295..ee3e33e 100644
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -82,7 +82,8 @@ static int csa_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
static int csa_setup_intr(device_t bus, device_t child,
struct resource *irq, int flags,
- driver_intr_t *intr, void *arg, void **cookiep);
+ driver_filter_t *filter, driver_intr_t *intr,
+ void *arg, void **cookiep);
static int csa_teardown_intr(device_t bus, device_t child,
struct resource *irq, void *cookie);
static driver_intr_t csa_intr;
@@ -439,12 +440,17 @@ csa_release_resource(device_t bus, device_t child, int type, int rid,
static int
csa_setup_intr(device_t bus, device_t child,
struct resource *irq, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ driver_filter_t *filter, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
sc_p scp;
csa_res *resp;
struct sndcard_func *func;
+ if (filter != NULL) {
+ printf("ata-csa.c: we cannot use a filter here\n");
+ return (EINVAL);
+ }
scp = device_get_softc(bus);
resp = &scp->res;
diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c
index 2519285..00ce0ec 100644
--- a/sys/dev/sound/pci/emu10kx.c
+++ b/sys/dev/sound/pci/emu10kx.c
@@ -2834,7 +2834,7 @@ emu_pci_attach(device_t dev)
i = 0;
sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE);
- if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, emu_intr, sc, &sc->ih)) {
+ if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, NULL, emu_intr, sc, &sc->ih)) {
device_printf(dev, "unable to map interrupt\n");
goto bad;
}
diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c
index 823f5f9..87629e3 100644
--- a/sys/dev/sound/pci/vibes.c
+++ b/sys/dev/sound/pci/vibes.c
@@ -762,7 +762,7 @@ sv_attach(device_t dev) {
sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
- bus_setup_intr(dev, sc->irq, INTR_TYPE_AV, sv_intr, sc, &sc->ih)) {
+ bus_setup_intr(dev, sc->irq, INTR_TYPE_AV, NULL, sv_intr, sc, &sc->ih)) {
device_printf(dev, "sv_attach: Unable to map interrupt\n");
goto fail;
}
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index aed3f57..4aa2ec6 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -129,7 +129,7 @@ snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand
#else
flags = INTR_TYPE_AV;
#endif
- return bus_setup_intr(dev, res, flags, hand, param, cookiep);
+ return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep);
}
#ifndef PCM_DEBUG_MTX
diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c
index 45c764e..1b6b4f3 100644
--- a/sys/dev/sr/if_sr.c
+++ b/sys/dev/sr/if_sr.c
@@ -390,7 +390,7 @@ sr_attach(device_t device)
sr_init_sca(hc);
if (bus_setup_intr(device, hc->res_irq,
- INTR_TYPE_NET, srintr, hc, &hc->intr_cookie) != 0)
+ INTR_TYPE_NET, NULL, srintr, hc, &hc->intr_cookie) != 0)
goto errexit;
/*
diff --git a/sys/dev/stg/tmc18c30_isa.c b/sys/dev/stg/tmc18c30_isa.c
index 7165a81..6d90613 100644
--- a/sys/dev/stg/tmc18c30_isa.c
+++ b/sys/dev/stg/tmc18c30_isa.c
@@ -97,7 +97,7 @@ stg_isa_attach(device_t dev)
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- stg_intr, (void *)sc, &sc->stg_intrhand);
+ NULL, stg_intr, (void *)sc, &sc->stg_intrhand);
if (error) {
stg_release_resource(dev);
return(error);
diff --git a/sys/dev/stg/tmc18c30_pccard.c b/sys/dev/stg/tmc18c30_pccard.c
index 5e1be11..079cfed 100644
--- a/sys/dev/stg/tmc18c30_pccard.c
+++ b/sys/dev/stg/tmc18c30_pccard.c
@@ -108,7 +108,7 @@ stg_pccard_attach(device_t dev)
return(ENXIO);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- stg_intr, (void *)sc, &sc->stg_intrhand);
+ NULL, stg_intr, (void *)sc, &sc->stg_intrhand);
if (error) {
stg_release_resource(dev);
return(error);
diff --git a/sys/dev/stg/tmc18c30_pci.c b/sys/dev/stg/tmc18c30_pci.c
index 1edda5a..08443d0 100644
--- a/sys/dev/stg/tmc18c30_pci.c
+++ b/sys/dev/stg/tmc18c30_pci.c
@@ -101,7 +101,7 @@ stg_pci_attach(device_t dev)
/* XXXX remove INTR_ENTROPY below for MFC */
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- stg_intr, (void *)sc, &sc->stg_intrhand);
+ NULL, stg_intr, (void *)sc, &sc->stg_intrhand);
if (error) {
stg_release_resource(dev);
return(error);
diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c
index 61b5357..451ee12 100644
--- a/sys/dev/stge/if_stge.c
+++ b/sys/dev/stge/if_stge.c
@@ -809,7 +809,7 @@ stge_attach(device_t dev)
* Hookup IRQ
*/
error = bus_setup_intr(dev, sc->sc_res[1], INTR_TYPE_NET | INTR_MPSAFE,
- stge_intr, sc, &sc->sc_ih);
+ NULL, stge_intr, sc, &sc->sc_ih);
if (error != 0) {
ether_ifdetach(ifp);
device_printf(sc->sc_dev, "couldn't set up IRQ\n");
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c
index 0b258fd..0317a52 100644
--- a/sys/dev/sym/sym_hipd.c
+++ b/sys/dev/sym/sym_hipd.c
@@ -8954,7 +8954,7 @@ static int sym_cam_attach(hcb_p np)
* Establish our interrupt handler.
*/
err = bus_setup_intr(np->device, np->irq_res,
- INTR_TYPE_CAM | INTR_ENTROPY, sym_intr, np,
+ INTR_TYPE_CAM | INTR_ENTROPY, NULL, sym_intr, np,
&np->intr);
if (err) {
device_printf(np->device, "bus_setup_intr() failed: %d\n",
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index b479811..634e611 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.c
@@ -2547,7 +2547,7 @@ ti_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->ti_irq, INTR_TYPE_NET|INTR_MPSAFE,
- ti_intr, sc, &sc->ti_intrhand);
+ NULL, ti_intr, sc, &sc->ti_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c
index 10f5470..31cad43 100644
--- a/sys/dev/trm/trm.c
+++ b/sys/dev/trm/trm.c
@@ -3596,7 +3596,7 @@ trm_attach(device_t dev)
RF_SHAREABLE | RF_ACTIVE);
if (pACB->irq == NULL ||
bus_setup_intr(dev, pACB->irq,
- INTR_TYPE_CAM, trm_Interrupt, pACB, &pACB->ih)) {
+ INTR_TYPE_CAM, NULL, trm_Interrupt, pACB, &pACB->ih)) {
printf("trm%d: register Interrupt handler error!\n", unit);
goto bad;
}
diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c
index f8d972a..1bf3b7a 100644
--- a/sys/dev/twa/tw_osl_freebsd.c
+++ b/sys/dev/twa/tw_osl_freebsd.c
@@ -174,9 +174,11 @@ static TW_INT32 twa_attach(device_t dev);
static TW_INT32 twa_detach(device_t dev);
static TW_INT32 twa_shutdown(device_t dev);
static TW_VOID twa_busdma_lock(TW_VOID *lock_arg, bus_dma_lock_op_t op);
-static TW_VOID twa_pci_intr(TW_VOID *arg);
#ifdef TW_OSLI_DEFERRED_INTR_USED
+static int twa_pci_intr_fast(TW_VOID *arg);
static TW_VOID twa_deferred_intr(TW_VOID *context, TW_INT32 pending);
+#else
+static TW_VOID twa_pci_intr(TW_VOID *arg);
#endif /* TW_OSLI_DEFERRED_INTR_USED */
static TW_INT32 tw_osli_alloc_mem(struct twa_softc *sc);
@@ -357,12 +359,13 @@ twa_attach(device_t dev)
return(ENXIO);
}
if ((error = bus_setup_intr(sc->bus_dev, sc->irq_res,
- ((mp_ncpus > 1) ? (INTR_MPSAFE
+ INTR_TYPE_CAM | INTR_MPSAFE,
#ifdef TW_OSLI_DEFERRED_INTR_USED
- | INTR_FAST
-#endif /* TW_OSLI_DEFERRED_INTR_USED */
- ) : 0) | INTR_TYPE_CAM,
- twa_pci_intr, sc, &sc->intr_handle))) {
+ twa_pci_intr_fast, NULL,
+#else
+ NULL, twa_pci_intr,
+#endif
+ sc, &sc->intr_handle))) {
tw_osli_printf(sc, "error = %d",
TW_CL_SEVERITY_ERROR_STRING,
TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER,
@@ -977,7 +980,28 @@ twa_busdma_lock(TW_VOID *lock_arg, bus_dma_lock_op_t op)
}
+#ifdef TW_OSLI_DEFERRED_INTR_USED
+/*
+ * Function name: twa_pci_intr_fast
+ * Description: Interrupt handler. Wrapper for twa_interrupt.
+ *
+ * Input: arg -- ptr to OSL internal ctlr context
+ * Output: FILTER_HANDLED or FILTER_STRAY
+ * Return value: None
+ */
+static int
+twa_pci_intr_fast(TW_VOID *arg)
+{
+ struct twa_softc *sc = (struct twa_softc *)arg;
+ tw_osli_dbg_dprintf(10, sc, "entered");
+ if (tw_cl_interrupt(&(sc->ctlr_handle))) {
+ tw_cl_deferred_interrupt(&(sc->ctlr_handle));
+ return(FILTER_HANDLED);
+ }
+ return(FILTER_STRAY);
+}
+#else
/*
* Function name: twa_pci_intr
* Description: Interrupt handler. Wrapper for twa_interrupt.
@@ -993,15 +1017,9 @@ twa_pci_intr(TW_VOID *arg)
tw_osli_dbg_dprintf(10, sc, "entered");
if (tw_cl_interrupt(&(sc->ctlr_handle)))
-#ifdef TW_OSLI_DEFERRED_INTR_USED
- taskqueue_enqueue_fast(taskqueue_fast,
- &(sc->deferred_intr_callback));
-#else /* TW_OSLI_DEFERRED_INTR_USED */
tw_cl_deferred_interrupt(&(sc->ctlr_handle));
-#endif /* TW_OSLI_DEFERRED_INTR_USED */
}
-
-
+#endif
#ifdef TW_OSLI_DEFERRED_INTR_USED
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index aab15fb..7e03883 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -254,7 +254,8 @@ twe_attach(device_t dev)
twe_free(sc);
return(ENXIO);
}
- if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY, twe_pci_intr, sc, &sc->twe_intr)) {
+ if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY,
+ NULL, twe_pci_intr, sc, &sc->twe_intr)) {
twe_printf(sc, "can't set up interrupt\n");
twe_free(sc);
return(ENXIO);
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c
index 3d3440d..ed1bf7e 100644
--- a/sys/dev/tx/if_tx.c
+++ b/sys/dev/tx/if_tx.c
@@ -418,7 +418,7 @@ epic_attach(device_t dev)
/* Activate our interrupt handler. */
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- epic_intr, sc, &sc->sc_ih);
+ NULL, epic_intr, sc, &sc->sc_ih);
if (error) {
device_printf(dev, "couldn't set up irq\n");
goto fail;
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c
index 86519fe..dfa261f 100644
--- a/sys/dev/txp/if_txp.c
+++ b/sys/dev/txp/if_txp.c
@@ -340,7 +340,7 @@ txp_attach(dev)
ether_ifattach(ifp, eaddr);
error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE,
- txp_intr, sc, &sc->sc_intrhand);
+ NULL, txp_intr, sc, &sc->sc_intrhand);
if (error) {
ether_ifdetach(ifp);
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index 3c7c191..07d87d0 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
@@ -227,13 +227,14 @@ uart_intr_txidle(void *arg)
return (0);
}
-static void
+static int
uart_intr(void *arg)
{
struct uart_softc *sc = arg;
- int ipend;
+ int flag = 0, ipend;
while (!sc->sc_leaving && (ipend = UART_IPEND(sc)) != 0) {
+ flag = 1;
if (ipend & SER_INT_OVERRUN)
uart_intr_overrun(sc);
if (ipend & SER_INT_BREAK)
@@ -243,8 +244,9 @@ uart_intr(void *arg)
if (ipend & SER_INT_SIGCHG)
uart_intr_sigchg(sc);
if (ipend & SER_INT_TXIDLE)
- uart_intr_txidle(sc);
+ uart_intr_txidle(sc);
}
+ return((flag)?FILTER_HANDLED:FILTER_STRAY);
}
serdev_intr_t *
@@ -401,12 +403,12 @@ uart_bus_attach(device_t dev)
RF_ACTIVE | RF_SHAREABLE);
if (sc->sc_ires != NULL) {
error = bus_setup_intr(dev,
- sc->sc_ires, INTR_TYPE_TTY | INTR_FAST, uart_intr,
- sc, &sc->sc_icookie);
+ sc->sc_ires, INTR_TYPE_TTY,
+ uart_intr, NULL, sc, &sc->sc_icookie);
if (error)
error = bus_setup_intr(dev,
sc->sc_ires, INTR_TYPE_TTY | INTR_MPSAFE,
- uart_intr, sc, &sc->sc_icookie);
+ NULL, (driver_intr_t *)uart_intr, sc, &sc->sc_icookie);
else
sc->sc_fastintr = 1;
diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c
index 902fd6f..8cd2f74 100644
--- a/sys/dev/ubsec/ubsec.c
+++ b/sys/dev/ubsec/ubsec.c
@@ -345,7 +345,7 @@ ubsec_attach(device_t dev)
* so make sure the IRQ is mapped appropriately.
*/
if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET | INTR_MPSAFE,
- ubsec_intr, sc, &sc->sc_ih)) {
+ NULL, ubsec_intr, sc, &sc->sc_ih)) {
device_printf(dev, "could not establish interrupt\n");
goto bad2;
}
diff --git a/sys/dev/usb/ehci_pci.c b/sys/dev/usb/ehci_pci.c
index 212f2bf..5805447 100644
--- a/sys/dev/usb/ehci_pci.c
+++ b/sys/dev/usb/ehci_pci.c
@@ -370,7 +370,7 @@ ehci_pci_attach(device_t self)
}
err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO,
- (driver_intr_t *) ehci_intr, sc, &sc->ih);
+ NULL, (driver_intr_t *)ehci_intr, sc, &sc->ih);
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->ih = NULL;
diff --git a/sys/dev/usb/ohci_pci.c b/sys/dev/usb/ohci_pci.c
index 78bc401..914342d 100644
--- a/sys/dev/usb/ohci_pci.c
+++ b/sys/dev/usb/ohci_pci.c
@@ -297,8 +297,8 @@ ohci_pci_attach(device_t self)
sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
}
- err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, ohci_intr, sc,
- &sc->ih);
+ err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, NULL, ohci_intr,
+ sc, &sc->ih);
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->ih = NULL;
diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c
index 6ca2037..dd4af7f 100644
--- a/sys/dev/usb/uhci_pci.c
+++ b/sys/dev/usb/uhci_pci.c
@@ -330,7 +330,7 @@ uhci_pci_attach(device_t self)
}
err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO,
- (driver_intr_t *) uhci_intr, sc, &sc->ih);
+ NULL, (driver_intr_t *) uhci_intr, sc, &sc->ih);
if (err) {
device_printf(self, "Could not setup irq, %d\n", err);
sc->ih = NULL;
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index bfe9da4..ab94094 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -1037,7 +1037,7 @@ vge_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->vge_irq, INTR_TYPE_NET|INTR_MPSAFE,
- vge_intr, sc, &sc->vge_intrhand);
+ NULL, vge_intr, sc, &sc->vge_intrhand);
if (error) {
printf("vge%d: couldn't set up irq\n", unit);
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c
index be38015..45374c3 100644
--- a/sys/dev/vr/if_vr.c
+++ b/sys/dev/vr/if_vr.c
@@ -764,7 +764,7 @@ vr_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->vr_irq, INTR_TYPE_NET | INTR_MPSAFE,
- vr_intr, sc, &sc->vr_intrhand);
+ NULL, vr_intr, sc, &sc->vr_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/dev/vx/if_vx_eisa.c b/sys/dev/vx/if_vx_eisa.c
index 459e348..9eb41a4 100644
--- a/sys/dev/vx/if_vx_eisa.c
+++ b/sys/dev/vx/if_vx_eisa.c
@@ -152,8 +152,8 @@ vx_eisa_attach(device_t dev)
if (vx_attach(dev) == 0)
goto bad;
- if (bus_setup_intr(dev, irq, INTR_TYPE_NET | INTR_MPSAFE, vx_intr, sc,
- &sc->vx_intrhand))
+ if (bus_setup_intr(dev, irq, INTR_TYPE_NET | INTR_MPSAFE, NULL,
+ vx_intr, sc, &sc->vx_intrhand))
goto bad_mtx;
return (0);
diff --git a/sys/dev/vx/if_vx_pci.c b/sys/dev/vx/if_vx_pci.c
index dc0fea7..194887f 100644
--- a/sys/dev/vx/if_vx_pci.c
+++ b/sys/dev/vx/if_vx_pci.c
@@ -148,7 +148,7 @@ vx_pci_attach(device_t dev)
goto bad;
if (bus_setup_intr(dev, sc->vx_irq, INTR_TYPE_NET | INTR_MPSAFE,
- vx_intr, sc, &sc->vx_intrhand))
+ NULL, vx_intr, sc, &sc->vx_intrhand))
goto bad_mtx;
/* defect check for 3C590 */
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 82d69ec..0a8da06 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -264,7 +264,7 @@ wi_attach(device_t dev)
* unless you can prove it!
*/
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE,
- wi_intr, sc, &sc->wi_intrhand);
+ NULL, wi_intr, sc, &sc->wi_intrhand);
if (error) {
device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c
index ec8bb01..accaafe 100644
--- a/sys/dev/xe/if_xe.c
+++ b/sys/dev/xe/if_xe.c
@@ -1925,8 +1925,8 @@ xe_activate(device_t dev)
xe_deactivate(dev);
return ENOMEM;
}
- if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, xe_intr, sc,
- &sc->intrhand)) != 0) {
+ if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL,
+ xe_intr, sc, &sc->intrhand)) != 0) {
xe_deactivate(dev);
return err;
}
diff --git a/sys/i386/i386/intr_machdep.c b/sys/i386/i386/intr_machdep.c
index e6e21bf..40ca4bc 100644
--- a/sys/i386/i386/intr_machdep.c
+++ b/sys/i386/i386/intr_machdep.c
@@ -149,8 +149,8 @@ intr_lookup_source(int vector)
}
int
-intr_add_handler(const char *name, int vector, driver_intr_t handler,
- void *arg, enum intr_type flags, void **cookiep)
+intr_add_handler(const char *name, int vector, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
{
struct intsrc *isrc;
int error;
@@ -158,8 +158,8 @@ intr_add_handler(const char *name, int vector, driver_intr_t handler,
isrc = intr_lookup_source(vector);
if (isrc == NULL)
return (EINVAL);
- error = intr_event_add_handler(isrc->is_event, name, handler, arg,
- intr_priority(flags), flags, cookiep);
+ error = intr_event_add_handler(isrc->is_event, name, filter, handler,
+ arg, intr_priority(flags), flags, cookiep);
if (error == 0) {
intrcnt_updatename(isrc);
mtx_lock_spin(&intr_table_lock);
@@ -257,7 +257,7 @@ intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)
thread = 0;
critical_enter();
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST)) {
+ if (ih->ih_filter == NULL) {
thread = 1;
continue;
}
@@ -265,7 +265,7 @@ intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame)
ih->ih_handler, ih->ih_argument == NULL ? frame :
ih->ih_argument, ih->ih_name);
if (ih->ih_argument == NULL)
- ih->ih_handler(frame);
+ ih->ih_filter(frame);
else
ih->ih_handler(ih->ih_argument);
}
diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c
index 5012fc2..02a7b92 100644
--- a/sys/i386/i386/nexus.c
+++ b/sys/i386/i386/nexus.c
@@ -102,7 +102,8 @@ static int nexus_deactivate_resource(device_t, device_t, int, int,
static int nexus_release_resource(device_t, device_t, int, int,
struct resource *);
static int nexus_setup_intr(device_t, device_t, struct resource *, int flags,
- void (*)(void *), void *, void **);
+ driver_filter_t filter, void (*)(void *), void *,
+ void **);
static int nexus_teardown_intr(device_t, device_t, struct resource *,
void *);
static struct resource_list *nexus_get_reslist(device_t dev, device_t child);
@@ -472,7 +473,8 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
*/
static int
nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
- int flags, void (*ihand)(void *), void *arg, void **cookiep)
+ int flags, driver_filter_t filter, void (*ihand)(void *),
+ void *arg, void **cookiep)
{
int error;
@@ -492,7 +494,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
return (error);
error = intr_add_handler(device_get_nameunit(child),
- rman_get_start(irq), ihand, arg, flags, cookiep);
+ rman_get_start(irq), filter, ihand, arg, flags, cookiep);
return (error);
}
diff --git a/sys/i386/include/intr_machdep.h b/sys/i386/include/intr_machdep.h
index aa37fdf..253027e 100644
--- a/sys/i386/include/intr_machdep.h
+++ b/sys/i386/include/intr_machdep.h
@@ -132,8 +132,8 @@ void intr_add_cpu(u_int apic_id);
#else
#define intr_add_cpu(apic_id)
#endif
-int intr_add_handler(const char *name, int vector, driver_intr_t handler,
- void *arg, enum intr_type flags, void **cookiep);
+int intr_add_handler(const char *name, int vector, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
int intr_config_intr(int vector, enum intr_trigger trig,
enum intr_polarity pol);
void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index 29ddd39..1535338 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -142,7 +142,7 @@ static struct timecounter i8254_timecounter = {
0 /* quality */
};
-static void
+static int
clkintr(struct trapframe *frame)
{
@@ -164,6 +164,7 @@ clkintr(struct trapframe *frame)
if (MCA_system)
outb(0x61, inb(0x61) | 0x80);
#endif
+ return (FILTER_HANDLED);
}
int
@@ -218,7 +219,7 @@ release_timer2()
* Stat clock ticks can still be lost, causing minor loss of accuracy
* in the statistics, but the stat clock will no longer stop.
*/
-static void
+static int
rtcintr(struct trapframe *frame)
{
@@ -231,6 +232,7 @@ rtcintr(struct trapframe *frame)
if (pscnt == psdiv)
statclock(TRAPF_USERMODE(frame));
}
+ return (FILTER_HANDLED);
}
#include "opt_ddb.h"
@@ -758,8 +760,8 @@ cpu_initclocks()
* timecounter to user a simpler algorithm.
*/
if (!using_lapic_timer) {
- intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL,
+ INTR_TYPE_CLK, NULL);
i8254_intsrc = intr_lookup_source(0);
if (i8254_intsrc != NULL)
i8254_pending =
@@ -792,8 +794,8 @@ cpu_initclocks()
/* Enable periodic interrupts from the RTC. */
rtc_statusb |= RTCSB_PINTR;
- intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL,
+ INTR_TYPE_CLK, NULL);
writertc(RTC_STATUSB, rtc_statusb);
rtcin(RTC_INTR);
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index 110b7b4..b4abe7a 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -262,10 +262,11 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
*/
int
isa_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
- void (*ihand)(void *), void *arg, void **cookiep)
+ driver_filter_t filter, void (*ihand)(void *), void *arg,
+ void **cookiep)
{
return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags,
- ihand, arg, cookiep));
+ filter, ihand, arg, cookiep));
}
int
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index ba202fc..e9ba8b0 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -149,7 +149,7 @@ static void fpusave(union savefpu *);
static void fpurstor(union savefpu *);
static int npx_attach(device_t dev);
static void npx_identify(driver_t *driver, device_t parent);
-static void npx_intr(void *);
+static int npx_intr(void *);
static int npx_probe(device_t dev);
#ifdef I586_CPU_XXX
static long timezero(const char *funcname,
@@ -201,7 +201,7 @@ npx_identify(driver, parent)
/*
* Do minimal handling of npx interrupts to convert them to traps.
*/
-static void
+static int
npx_intr(dummy)
void *dummy;
{
@@ -234,6 +234,7 @@ npx_intr(dummy)
td->td_flags |= TDF_ASTPENDING;
mtx_unlock_spin(&sched_lock);
}
+ return (FILTER_HANDLED);
}
/*
@@ -279,8 +280,8 @@ npx_probe(dev)
irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num,
irq_num, 1, RF_ACTIVE);
if (irq_res != NULL) {
- if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST,
- npx_intr, NULL, &irq_cookie) != 0)
+ if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC,
+ npx_intr, NULL, NULL, &irq_cookie) != 0)
panic("npx: can't create intr");
}
diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c
index fefb2e2..61d1bdc 100644
--- a/sys/ia64/ia64/interrupt.c
+++ b/sys/ia64/ia64/interrupt.c
@@ -283,8 +283,9 @@ ia64_send_eoi(uintptr_t vector)
}
int
-ia64_setup_intr(const char *name, int irq, driver_intr_t handler, void *arg,
- enum intr_type flags, void **cookiep, volatile long *cntp)
+ia64_setup_intr(const char *name, int irq, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags,
+ void **cookiep, volatile long *cntp)
{
struct ia64_intr *i;
int errcode;
@@ -331,7 +332,7 @@ ia64_setup_intr(const char *name, int irq, driver_intr_t handler, void *arg,
}
/* Second, add this handler. */
- errcode = intr_event_add_handler(i->event, name, handler, arg,
+ errcode = intr_event_add_handler(i->event, name, filter, handler, arg,
intr_priority(flags), flags, cookiep);
if (errcode)
return errcode;
@@ -381,13 +382,13 @@ ia64_dispatch_intr(void *frame, unsigned long vector)
thread = 0;
critical_enter();
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST)) {
+ if (ih->ih_filter == NULL) {
thread = 1;
continue;
}
CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__,
- ih->ih_handler, ih->ih_argument, ih->ih_name);
- ih->ih_handler(ih->ih_argument);
+ ih->ih_filter, ih->ih_argument, ih->ih_name);
+ ih->ih_filter(ih->ih_argument);
}
critical_exit();
diff --git a/sys/ia64/ia64/nexus.c b/sys/ia64/ia64/nexus.c
index 7eb4801..166a3ba 100644
--- a/sys/ia64/ia64/nexus.c
+++ b/sys/ia64/ia64/nexus.c
@@ -89,7 +89,8 @@ static int nexus_deactivate_resource(device_t, device_t, int, int,
static int nexus_release_resource(device_t, device_t, int, int,
struct resource *);
static int nexus_setup_intr(device_t, device_t, struct resource *, int flags,
- void (*)(void *), void *, void **);
+ driver_filter_t filter, void (*)(void *), void *,
+ void **);
static int nexus_teardown_intr(device_t, device_t, struct resource *,
void *);
static struct resource_list *nexus_get_reslist(device_t dev, device_t child);
@@ -422,7 +423,8 @@ nexus_release_resource(device_t bus, device_t child, int type, int rid,
*/
static int
nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
- int flags, void (*ihand)(void *), void *arg, void **cookiep)
+ int flags, driver_filter_t filter, void (*ihand)(void *),
+ void *arg, void **cookiep)
{
driver_t *driver;
int error;
@@ -445,7 +447,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
return (error);
error = ia64_setup_intr(device_get_nameunit(child),
- rman_get_start(irq), ihand, arg, flags, cookiep, 0);
+ rman_get_start(irq), filter, ihand, arg, flags, cookiep, 0);
return (error);
}
diff --git a/sys/ia64/include/intr.h b/sys/ia64/include/intr.h
index 90e0974..841d66c 100644
--- a/sys/ia64/include/intr.h
+++ b/sys/ia64/include/intr.h
@@ -51,9 +51,9 @@ extern u_int64_t ia64_lapic_address;
struct sapic;
void ia64_add_sapic(struct sapic *sa);
-int ia64_setup_intr(const char *name, int irq, driver_intr_t handler,
- void *arg, enum intr_type flags, void **cookiep,
- volatile long *cntp);
+int ia64_setup_intr(const char *name, int irq, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags,
+ void **cookiep, volatile long *cntp);
int ia64_teardown_intr(void *cookie);
void ia64_dispatch_intr(void *frame, unsigned long vector);
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index 29ddd39..1535338 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -142,7 +142,7 @@ static struct timecounter i8254_timecounter = {
0 /* quality */
};
-static void
+static int
clkintr(struct trapframe *frame)
{
@@ -164,6 +164,7 @@ clkintr(struct trapframe *frame)
if (MCA_system)
outb(0x61, inb(0x61) | 0x80);
#endif
+ return (FILTER_HANDLED);
}
int
@@ -218,7 +219,7 @@ release_timer2()
* Stat clock ticks can still be lost, causing minor loss of accuracy
* in the statistics, but the stat clock will no longer stop.
*/
-static void
+static int
rtcintr(struct trapframe *frame)
{
@@ -231,6 +232,7 @@ rtcintr(struct trapframe *frame)
if (pscnt == psdiv)
statclock(TRAPF_USERMODE(frame));
}
+ return (FILTER_HANDLED);
}
#include "opt_ddb.h"
@@ -758,8 +760,8 @@ cpu_initclocks()
* timecounter to user a simpler algorithm.
*/
if (!using_lapic_timer) {
- intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL,
+ INTR_TYPE_CLK, NULL);
i8254_intsrc = intr_lookup_source(0);
if (i8254_intsrc != NULL)
i8254_pending =
@@ -792,8 +794,8 @@ cpu_initclocks()
/* Enable periodic interrupts from the RTC. */
rtc_statusb |= RTCSB_PINTR;
- intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL,
+ INTR_TYPE_CLK, NULL);
writertc(RTC_STATUSB, rtc_statusb);
rtcin(RTC_INTR);
diff --git a/sys/isa/isa_common.h b/sys/isa/isa_common.h
index 3f29807..4d61d46 100644
--- a/sys/isa/isa_common.h
+++ b/sys/isa/isa_common.h
@@ -70,7 +70,8 @@ extern int isa_release_resource(device_t bus, device_t child,
int type, int rid, struct resource *r);
extern int isa_setup_intr(device_t bus, device_t child, struct resource *r,
- int flags, void (*ihand)(void *), void *arg, void **cookiep);
+ int flags, driver_filter_t *filter, void (*ihand)(void *), void *arg,
+ void **cookiep);
extern int isa_teardown_intr(device_t bus, device_t child, struct resource *r,
void *cookie);
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index 529b506..59838db 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -326,6 +326,7 @@ METHOD int setup_intr {
device_t _child;
struct resource *_irq;
int _flags;
+ driver_filter_t *_filter;
driver_intr_t *_intr;
void *_arg;
void **_cookiep;
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 5560a3f..96bdd4e 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -324,25 +324,24 @@ ithread_destroy(struct intr_thread *ithread)
int
intr_event_add_handler(struct intr_event *ie, const char *name,
- driver_intr_t handler, void *arg, u_char pri, enum intr_type flags,
- void **cookiep)
+ driver_filter_t filter, driver_intr_t handler, void *arg, u_char pri,
+ enum intr_type flags, void **cookiep)
{
struct intr_handler *ih, *temp_ih;
struct intr_thread *it;
- if (ie == NULL || name == NULL || handler == NULL)
+ if (ie == NULL || name == NULL || (handler == NULL && filter == NULL))
return (EINVAL);
/* Allocate and populate an interrupt handler structure. */
ih = malloc(sizeof(struct intr_handler), M_ITHREAD, M_WAITOK | M_ZERO);
+ ih->ih_filter = filter;
ih->ih_handler = handler;
ih->ih_argument = arg;
ih->ih_name = name;
ih->ih_event = ie;
ih->ih_pri = pri;
- if (flags & INTR_FAST)
- ih->ih_flags = IH_FAST;
- else if (flags & INTR_EXCL)
+ if (flags & INTR_EXCL)
ih->ih_flags = IH_EXCLUSIVE;
if (flags & INTR_MPSAFE)
ih->ih_flags |= IH_MPSAFE;
@@ -372,7 +371,7 @@ intr_event_add_handler(struct intr_event *ie, const char *name,
intr_event_update(ie);
/* Create a thread if we need one. */
- while (ie->ie_thread == NULL && !(flags & INTR_FAST)) {
+ while (ie->ie_thread == NULL && handler != NULL) {
if (ie->ie_flags & IE_ADDING_THREAD)
msleep(ie, &ie->ie_lock, 0, "ithread", 0);
else {
@@ -589,7 +588,7 @@ swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
if (eventp != NULL)
*eventp = ie;
}
- return (intr_event_add_handler(ie, name, handler, arg,
+ return (intr_event_add_handler(ie, name, NULL, handler, arg,
(pri * RQ_PPQ) + PI_SOFT, flags, cookiep));
/* XXKSE.. think of a better way to get separate queues */
}
@@ -669,10 +668,6 @@ ithread_execute_handlers(struct proc *p, struct intr_event *ie)
atomic_store_rel_int(&ih->ih_need, 0);
}
- /* Fast handlers are handled in primary interrupt context. */
- if (ih->ih_flags & IH_FAST)
- continue;
-
/* Execute this handler. */
CTR6(KTR_INTR, "%s: pid %d exec %p(%p) for %s flg=%x",
__func__, p->p_pid, (void *)ih->ih_handler, ih->ih_argument,
@@ -828,14 +823,10 @@ db_dump_intrhand(struct intr_handler *ih)
db_printsym((uintptr_t)ih->ih_handler, DB_STGY_PROC);
db_printf("(%p)", ih->ih_argument);
if (ih->ih_need ||
- (ih->ih_flags & (IH_FAST | IH_EXCLUSIVE | IH_ENTROPY | IH_DEAD |
+ (ih->ih_flags & (IH_EXCLUSIVE | IH_ENTROPY | IH_DEAD |
IH_MPSAFE)) != 0) {
db_printf(" {");
comma = 0;
- if (ih->ih_flags & IH_FAST) {
- db_printf("FAST");
- comma = 1;
- }
if (ih->ih_flags & IH_EXCLUSIVE) {
if (comma)
db_printf(", ");
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 75b179d..e8c00b9 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/bus.h>
+#include <sys/interrupt.h>
#include <machine/stdarg.h>
@@ -3095,12 +3096,13 @@ bus_generic_driver_added(device_t dev, driver_t *driver)
*/
int
bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent)
return (BUS_SETUP_INTR(dev->parent, child, irq, flags,
- intr, arg, cookiep));
+ filter, intr, arg, cookiep));
return (EINVAL);
}
@@ -3457,7 +3459,7 @@ bus_release_resource(device_t dev, int type, int rid, struct resource *r)
*/
int
bus_setup_intr(device_t dev, struct resource *r, int flags,
- driver_intr_t handler, void *arg, void **cookiep)
+ driver_filter_t filter, driver_intr_t handler, void *arg, void **cookiep)
{
int error;
@@ -3466,14 +3468,19 @@ bus_setup_intr(device_t dev, struct resource *r, int flags,
!debug_mpsafenet)
flags &= ~INTR_MPSAFE;
error = BUS_SETUP_INTR(dev->parent, dev, r, flags,
- handler, arg, cookiep);
+ filter, handler, arg, cookiep);
if (error == 0) {
- if (!(flags & (INTR_MPSAFE | INTR_FAST)))
+ if (handler != NULL && !(flags & INTR_MPSAFE))
device_printf(dev, "[GIANT-LOCKED]\n");
if (bootverbose && (flags & INTR_MPSAFE))
device_printf(dev, "[MPSAFE]\n");
- if (flags & INTR_FAST)
- device_printf(dev, "[FAST]\n");
+ if (filter != NULL) {
+ if (handler == NULL)
+ device_printf(dev, "[FILTER]\n");
+ else
+ device_printf(dev, "[FILTER+ITHREAD]\n");
+ } else
+ device_printf(dev, "[ITHREAD]\n");
}
} else
error = EINVAL;
diff --git a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
index 2687c0e..b244b30 100644
--- a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
+++ b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
@@ -635,7 +635,7 @@ bt3c_pccard_attach(device_t dev)
}
sc->irq_cookie = NULL;
- if (bus_setup_intr(dev, sc->irq, INTR_TYPE_TTY, bt3c_intr, sc,
+ if (bus_setup_intr(dev, sc->irq, INTR_TYPE_TTY, NULL, bt3c_intr, sc,
&sc->irq_cookie) != 0) {
device_printf(dev, "Could not setup ISR\n");
goto bad;
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c
index 1570572..0ebd31a 100644
--- a/sys/pc98/cbus/clock.c
+++ b/sys/pc98/cbus/clock.c
@@ -139,7 +139,7 @@ static struct timecounter i8254_timecounter = {
0 /* quality */
};
-static void
+static int
clkintr(struct trapframe *frame)
{
@@ -156,6 +156,7 @@ clkintr(struct trapframe *frame)
}
KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer"));
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+ return (FILTER_HANDLED);
}
int
@@ -700,8 +701,8 @@ cpu_initclocks()
* timecounter to user a simpler algorithm.
*/
if (!using_lapic_timer) {
- intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL,
+ NULL, INTR_TYPE_CLK | INTR_FAST, NULL);
i8254_intsrc = intr_lookup_source(0);
if (i8254_intsrc != NULL)
i8254_pending =
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c
index b653a52..980622e 100644
--- a/sys/pc98/cbus/fdc.c
+++ b/sys/pc98/cbus/fdc.c
@@ -822,7 +822,7 @@ fdc_attach(device_t dev)
fdc = device_get_softc(dev);
fdc->fdc_dev = dev;
error = bus_setup_intr(dev, fdc->res_irq,
- INTR_TYPE_BIO | INTR_ENTROPY, fdc_intr, fdc,
+ INTR_TYPE_BIO | INTR_ENTROPY, NULL, fdc_intr, fdc,
&fdc->fdc_intr);
if (error) {
device_printf(dev, "cannot setup interrupt\n");
diff --git a/sys/pc98/cbus/pckbd.c b/sys/pc98/cbus/pckbd.c
index b22ced3..0b3d1d7 100644
--- a/sys/pc98/cbus/pckbd.c
+++ b/sys/pc98/cbus/pckbd.c
@@ -137,7 +137,7 @@ pckbdattach(device_t dev)
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
if (res == NULL)
return ENXIO;
- bus_setup_intr(dev, res, INTR_TYPE_TTY, pckbd_isa_intr, kbd, &ih);
+ bus_setup_intr(dev, res, INTR_TYPE_TTY, NULL, pckbd_isa_intr, kbd, &ih);
return 0;
}
diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c
index 1570572..0ebd31a 100644
--- a/sys/pc98/cbus/pcrtc.c
+++ b/sys/pc98/cbus/pcrtc.c
@@ -139,7 +139,7 @@ static struct timecounter i8254_timecounter = {
0 /* quality */
};
-static void
+static int
clkintr(struct trapframe *frame)
{
@@ -156,6 +156,7 @@ clkintr(struct trapframe *frame)
}
KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer"));
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
+ return (FILTER_HANDLED);
}
int
@@ -700,8 +701,8 @@ cpu_initclocks()
* timecounter to user a simpler algorithm.
*/
if (!using_lapic_timer) {
- intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL,
- INTR_TYPE_CLK | INTR_FAST, NULL);
+ intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL,
+ NULL, INTR_TYPE_CLK | INTR_FAST, NULL);
i8254_intsrc = intr_lookup_source(0);
if (i8254_intsrc != NULL)
i8254_pending =
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index d2b78da..fcab170 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -350,7 +350,7 @@ static void comclose(struct tty *tp);
static int comopen(struct tty *tp, struct cdev *dev);
static void sioinput(struct com_s *com);
static void siointr1(struct com_s *com);
-static void siointr(void *arg);
+static int siointr(void *arg);
static int commodem(struct tty *tp, int sigon, int sigoff);
static int comparam(struct tty *tp, struct termios *t);
static void siopoll(void *);
@@ -1739,12 +1739,13 @@ determined_type: ;
com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
if (com->irqres) {
ret = bus_setup_intr(dev, com->irqres,
- INTR_TYPE_TTY | INTR_FAST,
- siointr, com, &com->cookie);
+ INTR_TYPE_TTY,
+ siointr, NULL, com, &com->cookie);
if (ret) {
ret = bus_setup_intr(dev,
com->irqres, INTR_TYPE_TTY,
- siointr, com, &com->cookie);
+ NULL, (driver_intr_t *)siointr,
+ com, &com->cookie);
if (ret == 0)
device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n");
}
@@ -2155,7 +2156,7 @@ sioinput(com)
#endif
}
-static void
+static int
siointr(arg)
void *arg;
{
@@ -2221,6 +2222,7 @@ siointr(arg)
} while (possibly_more_intrs);
mtx_unlock_spin(&sio_lock);
#endif /* COM_MULTIPORT */
+ return (FILTER_HANDLED);
}
static struct timespec siots[8];
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index bd1827f..8298502 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -670,7 +670,7 @@ pcn_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->pcn_irq, INTR_TYPE_NET | INTR_MPSAFE,
- pcn_intr, sc, &sc->pcn_intrhand);
+ NULL, pcn_intr, sc, &sc->pcn_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 66abf6a..ce2f1bb 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -972,7 +972,7 @@ rl_attach(device_t dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE,
- rl_intr, sc, &sc->rl_intrhand);
+ NULL, rl_intr, sc, &sc->rl_intrhand);
if (error) {
device_printf(sc->rl_dev, "couldn't set up irq\n");
ether_ifdetach(ifp);
diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c
index a308e40..c76f4d3 100644
--- a/sys/pci/if_sf.c
+++ b/sys/pci/if_sf.c
@@ -784,7 +784,7 @@ sf_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->sf_irq, INTR_TYPE_NET | INTR_MPSAFE,
- sf_intr, sc, &sc->sf_intrhand);
+ NULL, sf_intr, sc, &sc->sf_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 400ad27..606788c 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -1226,7 +1226,7 @@ sis_attach(device_t dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->sis_res[1], INTR_TYPE_NET | INTR_MPSAFE,
- sis_intr, sc, &sc->sis_intrhand);
+ NULL, sis_intr, sc, &sc->sis_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index 23331d5..ad3586e 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -1113,7 +1113,7 @@ ste_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->ste_irq, INTR_TYPE_NET | INTR_MPSAFE,
- ste_intr, sc, &sc->ste_intrhand);
+ NULL, ste_intr, sc, &sc->ste_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c
index 8384b2c..5d23767 100644
--- a/sys/pci/if_tl.c
+++ b/sys/pci/if_tl.c
@@ -1303,7 +1303,7 @@ tl_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->tl_irq, INTR_TYPE_NET | INTR_MPSAFE,
- tl_intr, sc, &sc->tl_intrhand);
+ NULL, tl_intr, sc, &sc->tl_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
index be38015..45374c3 100644
--- a/sys/pci/if_vr.c
+++ b/sys/pci/if_vr.c
@@ -764,7 +764,7 @@ vr_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->vr_irq, INTR_TYPE_NET | INTR_MPSAFE,
- vr_intr, sc, &sc->vr_intrhand);
+ NULL, vr_intr, sc, &sc->vr_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c
index 1a59713..671a0b3 100644
--- a/sys/pci/if_wb.c
+++ b/sys/pci/if_wb.c
@@ -872,7 +872,7 @@ wb_attach(dev)
/* Hook interrupt last to avoid having to lock softc */
error = bus_setup_intr(dev, sc->wb_irq, INTR_TYPE_NET | INTR_MPSAFE,
- wb_intr, sc, &sc->wb_intrhand);
+ NULL, wb_intr, sc, &sc->wb_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index e470f7a..55e4f7d 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -1606,7 +1606,7 @@ done:
ether_ifattach(ifp, eaddr);
error = bus_setup_intr(dev, sc->xl_irq, INTR_TYPE_NET | INTR_MPSAFE,
- xl_intr, sc, &sc->xl_intrhand);
+ NULL, xl_intr, sc, &sc->xl_intrhand);
if (error) {
device_printf(dev, "couldn't set up irq\n");
ether_ifdetach(ifp);
diff --git a/sys/pci/intpm.c b/sys/pci/intpm.c
index dee1a71..ab83e75 100644
--- a/sys/pci/intpm.c
+++ b/sys/pci/intpm.c
@@ -159,8 +159,8 @@ intsmb_attach(device_t dev)
goto fail;
}
- error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, intsmb_rawintr,
- sc, &sc->irq_hand);
+ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, NULL,
+ intsmb_rawintr, sc, &sc->irq_hand);
if (error) {
device_printf(dev, "Failed to map intr\n");
goto fail;
diff --git a/sys/powerpc/include/intr_machdep.h b/sys/powerpc/include/intr_machdep.h
index 3336dea..6c9778a 100644
--- a/sys/powerpc/include/intr_machdep.h
+++ b/sys/powerpc/include/intr_machdep.h
@@ -45,8 +45,8 @@ struct ppc_intr_handler {
void intr_init(void (*)(void), int, void (*)(uintptr_t), void (*)(uintptr_t));
void intr_setup(u_int, ih_func_t *, void *, u_int);
-int inthand_add(const char *, u_int, void (*)(void *), void *, int,
- void **);
+int inthand_add(const char *, u_int, driver_filter_t *filter,
+ void (*)(void *), void *, int, void **);
int inthand_remove(u_int, void *);
void intr_handle(u_int);
diff --git a/sys/powerpc/include/openpicvar.h b/sys/powerpc/include/openpicvar.h
index 850580e..5095036 100644
--- a/sys/powerpc/include/openpicvar.h
+++ b/sys/powerpc/include/openpicvar.h
@@ -58,8 +58,8 @@ int openpic_attach(device_t);
struct resource *openpic_allocate_intr(device_t, device_t, int *,
u_long, u_int);
int openpic_setup_intr(device_t, device_t,
- struct resource *, int, driver_intr_t, void *,
- void **);
+ struct resource *, int, driver_filter_t,
+ driver_intr_t, void *, void **);
int openpic_teardown_intr(device_t, device_t,
struct resource *, void *);
int openpic_release_intr(device_t dev, device_t, int,
diff --git a/sys/powerpc/powermac/hrowpic.c b/sys/powerpc/powermac/hrowpic.c
index 0900890..d6e5e25 100644
--- a/sys/powerpc/powermac/hrowpic.c
+++ b/sys/powerpc/powermac/hrowpic.c
@@ -79,8 +79,8 @@ static int hrowpic_attach(device_t);
static struct resource *hrowpic_allocate_intr(device_t, device_t, int *,
u_long, u_int);
static int hrowpic_setup_intr(device_t, device_t,
- struct resource *, int, driver_intr_t, void *,
- void **);
+ struct resource *, int, driver_filter_t,
+ driver_intr_t, void *, void **);
static int hrowpic_teardown_intr(device_t, device_t,
struct resource *, void *);
static int hrowpic_release_intr(device_t dev, device_t, int,
@@ -221,7 +221,8 @@ hrowpic_allocate_intr(device_t picdev, device_t child, int *rid, u_long intr,
static int
hrowpic_setup_intr(device_t picdev, device_t child, struct resource *res,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
struct hrowpic_softc *sc;
u_long start;
@@ -240,7 +241,7 @@ hrowpic_setup_intr(device_t picdev, device_t child, struct resource *res,
if (error)
return (error);
- error = inthand_add(device_get_nameunit(child), start, intr, arg,
+ error = inthand_add(device_get_nameunit(child), start, filt, intr, arg,
flags, cookiep);
if (!error) {
diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c
index 93e81be..f493147 100644
--- a/sys/powerpc/powerpc/intr_machdep.c
+++ b/sys/powerpc/powerpc/intr_machdep.c
@@ -133,8 +133,8 @@ intr_init(void (*handler)(void), int nirq, void (*irq_e)(uintptr_t),
}
int
-inthand_add(const char *name, u_int irq, void (*handler)(void *), void *arg,
- int flags, void **cookiep)
+inthand_add(const char *name, u_int irq, driver_filter_t *filter,
+ void (*handler)(void *), void *arg, int flags, void **cookiep)
{
struct ppc_intr *i, *orphan;
u_int idx;
@@ -178,7 +178,7 @@ inthand_add(const char *name, u_int irq, void (*handler)(void *), void *arg,
}
}
- error = intr_event_add_handler(i->event, name, handler, arg,
+ error = intr_event_add_handler(i->event, name, filter, handler, arg,
intr_priority(flags), flags, cookiep);
if (!error)
intrcnt_setname(i->event->ie_fullname, i->cntidx);
@@ -219,13 +219,13 @@ intr_handle(u_int irq)
sched = 0;
critical_enter();
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST)) {
+ if (ih->ih_filter == NULL) {
sched = 1;
continue;
}
CTR4(KTR_INTR, "%s: exec %p(%p) for %s", __func__,
- ih->ih_handler, ih->ih_argument, ih->ih_name);
- ih->ih_handler(ih->ih_argument);
+ ih->ih_filter, ih->ih_argument, ih->ih_name);
+ ih->ih_filter(ih->ih_argument);
}
critical_exit();
diff --git a/sys/powerpc/powerpc/openpic.c b/sys/powerpc/powerpc/openpic.c
index 754b1ae..3afc5b9 100644
--- a/sys/powerpc/powerpc/openpic.c
+++ b/sys/powerpc/powerpc/openpic.c
@@ -228,7 +228,8 @@ openpic_allocate_intr(device_t dev, device_t child, int *rid, u_long intr,
int
openpic_setup_intr(device_t dev, device_t child, struct resource *res,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
struct openpic_softc *sc;
u_long start;
@@ -253,7 +254,7 @@ openpic_setup_intr(device_t dev, device_t child, struct resource *res,
if (error)
return (error);
- error = inthand_add(device_get_nameunit(child), start, intr, arg,
+ error = inthand_add(device_get_nameunit(child), start, filt, intr, arg,
flags, cookiep);
if (sc->sc_hwprobed)
diff --git a/sys/sparc64/fhc/fhc.c b/sys/sparc64/fhc/fhc.c
index 53497a7..a7972c8 100644
--- a/sys/sparc64/fhc/fhc.c
+++ b/sys/sparc64/fhc/fhc.c
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sparc64/sbus/ofw_sbus.h>
struct fhc_clr {
- driver_intr_t *fc_func;
+ driver_filter_t *fc_func;
void *fc_arg;
void *fc_cookie;
bus_space_tag_t fc_bt;
@@ -62,7 +62,7 @@ struct fhc_devinfo {
struct resource_list fdi_rl;
};
-static void fhc_intr_stub(void *);
+static int fhc_intr_stub(void *);
static void fhc_led_func(void *, int);
static int fhc_print_res(struct fhc_devinfo *);
@@ -206,7 +206,7 @@ fhc_probe_nomatch(device_t dev, device_t child)
int
fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
- driver_intr_t *func, void *arg, void **cookiep)
+ driver_filter_t *filt, driver_intr_t *func, void *arg, void **cookiep)
{
struct fhc_softc *sc;
struct fhc_clr *fc;
@@ -217,6 +217,9 @@ fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
long vec;
uint32_t inr;
+ if (filt != NULL && func != NULL)
+ return (EINVAL);
+
sc = device_get_softc(bus);
vec = rman_get_start(r);
@@ -238,7 +241,7 @@ fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
fc = malloc(sizeof(*fc), M_DEVBUF, M_WAITOK | M_ZERO);
if (fc == NULL)
return (0);
- fc->fc_func = func;
+ fc->fc_func = (filt != NULL) ? filt : (driver_filter_t *)func;
fc->fc_arg = arg;
fc->fc_bt = bt;
fc->fc_bh = bh;
@@ -246,8 +249,12 @@ fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags,
bus_space_write_4(bt, bh, FHC_IMAP, inr);
bus_space_read_4(bt, bh, FHC_IMAP);
- error = bus_generic_setup_intr(bus, child, r, flags, fhc_intr_stub,
- fc, cookiep);
+ if (filt != NULL)
+ error = bus_generic_setup_intr(bus, child, r, flags,
+ fhc_intr_stub, NULL, fc, cookiep);
+ else
+ error = bus_generic_setup_intr(bus, child, r, flags,
+ NULL, (driver_intr_t *)fhc_intr_stub, fc, cookiep);
if (error != 0) {
free(fc, M_DEVBUF);
return (error);
@@ -276,7 +283,7 @@ fhc_teardown_intr(device_t bus, device_t child, struct resource *r,
return (error);
}
-static void
+static int
fhc_intr_stub(void *arg)
{
struct fhc_clr *fc = arg;
@@ -285,6 +292,7 @@ fhc_intr_stub(void *arg)
bus_space_write_4(fc->fc_bt, fc->fc_bh, FHC_ICLR, 0x0);
bus_space_read_4(fc->fc_bt, fc->fc_bh, FHC_ICLR);
+ return (FILTER_HANDLED);
}
struct resource *
diff --git a/sys/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h
index a4aace2..339586f 100644
--- a/sys/sparc64/include/intr_machdep.h
+++ b/sys/sparc64/include/intr_machdep.h
@@ -81,8 +81,8 @@ void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
void *iva);
void intr_init1(void);
void intr_init2(void);
-int inthand_add(const char *name, int vec, void (*handler)(void *),
- void *arg, int flags, void **cookiep);
+int inthand_add(const char *name, int vec, int (*filt)(void *),
+ void (*handler)(void *), void *arg, int flags, void **cookiep);
int inthand_remove(int vec, void *cookie);
ih_func_t intr_fast;
diff --git a/sys/sparc64/isa/isa.c b/sys/sparc64/isa/isa.c
index d30e3d3..37ec63a 100644
--- a/sys/sparc64/isa/isa.c
+++ b/sys/sparc64/isa/isa.c
@@ -387,8 +387,8 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
int
isa_setup_intr(device_t dev, device_t child,
- struct resource *irq, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ struct resource *irq, int flags, driver_filter_t *filter,
+ driver_intr_t *intr, void *arg, void **cookiep)
{
/*
@@ -397,8 +397,8 @@ isa_setup_intr(device_t dev, device_t child,
* The interrupt had been routed before it was added to the
* resource list of the child.
*/
- return (BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags, intr,
- arg, cookiep));
+ return (BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags,
+ filter, intr, arg, cookiep));
}
int
diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c
index 8e21d3b..8d5ae04 100644
--- a/sys/sparc64/pci/psycho.c
+++ b/sys/sparc64/pci/psycho.c
@@ -81,20 +81,20 @@ static const struct psycho_desc *psycho_find_desc(const struct psycho_desc *,
const char *);
static const struct psycho_desc *psycho_get_desc(phandle_t, const char *);
static void psycho_set_intr(struct psycho_softc *, int, bus_addr_t, int,
- driver_intr_t);
+ driver_filter_t);
static int psycho_find_intrmap(struct psycho_softc *, int, bus_addr_t *,
bus_addr_t *, u_long *);
-static void psycho_intr_stub(void *);
+static int psycho_intr_stub(void *);
static bus_space_tag_t psycho_alloc_bus_tag(struct psycho_softc *, int);
/* Interrupt handlers */
-static void psycho_ue(void *);
-static void psycho_ce(void *);
-static void psycho_pci_bus(void *);
-static void psycho_powerfail(void *);
-static void psycho_overtemp(void *);
+static int psycho_ue(void *);
+static int psycho_ce(void *);
+static int psycho_pci_bus(void *);
+static int psycho_powerfail(void *);
+static int psycho_overtemp(void *);
#ifdef PSYCHO_MAP_WAKEUP
-static void psycho_wakeup(void *);
+static int psycho_wakeup(void *);
#endif
/* IOMMU support */
@@ -170,7 +170,7 @@ SLIST_HEAD(, psycho_softc) psycho_softcs =
struct psycho_clr {
struct psycho_softc *pci_sc;
bus_addr_t pci_clr; /* clear register */
- driver_intr_t *pci_handler; /* handler to call */
+ driver_filter_t *pci_handler; /* handler to call */
void *pci_arg; /* argument for the handler */
void *pci_cookie; /* parent bus int. cookie */
device_t pci_ppb; /* farest PCI-PCI bridge */
@@ -216,8 +216,11 @@ struct psycho_clr {
* On UltraII machines, there can be any number of "Psycho+" ICs, each
* providing two PCI buses.
*/
+
+#define FAST 0x66600000
+
#ifdef DEBUGGER_ON_POWERFAIL
-#define PSYCHO_PWRFAIL_INT_FLAGS INTR_FAST
+#define PSYCHO_PWRFAIL_INT_FLAGS FAST
#else
#define PSYCHO_PWRFAIL_INT_FLAGS 0
#endif
@@ -507,7 +510,7 @@ psycho_attach(device_t dev)
* interrupt but they are also only used for PCI bus A.
*/
psycho_set_intr(sc, 0, sc->sc_half == 0 ? PSR_PCIAERR_INT_MAP :
- PSR_PCIBERR_INT_MAP, INTR_FAST, psycho_pci_bus);
+ PSR_PCIBERR_INT_MAP, FAST, psycho_pci_bus);
/*
* If we're a Hummingbird/Sabre or the first of a pair of Psycho's to
@@ -523,7 +526,7 @@ psycho_attach(device_t dev)
* XXX Not all controllers have these, but installing them
* is better than trying to sort through this mess.
*/
- psycho_set_intr(sc, 1, PSR_UE_INT_MAP, INTR_FAST, psycho_ue);
+ psycho_set_intr(sc, 1, PSR_UE_INT_MAP, FAST, psycho_ue);
psycho_set_intr(sc, 2, PSR_CE_INT_MAP, 0, psycho_ce);
psycho_set_intr(sc, 3, PSR_POWER_INT_MAP,
PSYCHO_PWRFAIL_INT_FLAGS, psycho_powerfail);
@@ -538,7 +541,7 @@ psycho_attach(device_t dev)
* The spare hardware interrupt is used for the
* over-temperature interrupt.
*/
- psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, INTR_FAST,
+ psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, FAST,
psycho_overtemp);
#ifdef PSYCHO_MAP_WAKEUP
/*
@@ -678,19 +681,30 @@ psycho_attach(device_t dev)
static void
psycho_set_intr(struct psycho_softc *sc, int index, bus_addr_t map, int iflags,
- driver_intr_t handler)
+ driver_filter_t handler)
{
- int rid, vec;
+ int rid, vec, res;
uint64_t mr;
+ res = EINVAL;
rid = index;
mr = PSYCHO_READ8(sc, map);
vec = INTVEC(mr);
sc->sc_irq_res[index] = bus_alloc_resource(sc->sc_dev, SYS_RES_IRQ,
&rid, vec, vec, 1, RF_ACTIVE);
- if (sc->sc_irq_res[index] == NULL ||
- bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index], INTR_TYPE_MISC |
- iflags, handler, sc, &sc->sc_ihand[index]) != 0)
+ if (sc->sc_irq_res[index] != NULL) {
+ if (iflags & FAST) {
+ iflags &= ~FAST;
+ res = bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
+ INTR_TYPE_MISC | iflags, handler, NULL, sc,
+ &sc->sc_ihand[index]);
+ } else
+ res = bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
+ INTR_TYPE_MISC | iflags, NULL,
+ (driver_intr_t *)handler, sc,
+ &sc->sc_ihand[index]);
+ }
+ if (res)
panic("%s: failed to set up interrupt", __func__);
PSYCHO_WRITE8(sc, map, INTMAP_ENABLE(mr, PCPU_GET(mid)));
}
@@ -749,7 +763,7 @@ psycho_find_intrmap(struct psycho_softc *sc, int ino, bus_addr_t *intrmapptr,
/*
* Interrupt handlers
*/
-static void
+static int
psycho_ue(void *arg)
{
struct psycho_softc *sc = arg;
@@ -767,9 +781,10 @@ psycho_ue(void *arg)
iommu_decode_fault(sc->sc_is, afar);
panic("%s: uncorrectable DMA error AFAR %#lx AFSR %#lx",
device_get_name(sc->sc_dev), (u_long)afar, (u_long)afsr);
+ return (FILTER_HANDLED);
}
-static void
+static int
psycho_ce(void *arg)
{
struct psycho_softc *sc = arg;
@@ -782,9 +797,10 @@ psycho_ce(void *arg)
/* Clear the error bits that we caught. */
PSYCHO_WRITE8(sc, PSR_CE_AFS, afsr & CEAFSR_ERRMASK);
PSYCHO_WRITE8(sc, PSR_CE_INT_CLR, 0);
+ return (FILTER_HANDLED);
}
-static void
+static int
psycho_pci_bus(void *arg)
{
struct psycho_softc *sc = arg;
@@ -795,9 +811,10 @@ psycho_pci_bus(void *arg)
panic("%s: PCI bus %c error AFAR %#lx AFSR %#lx",
device_get_name(sc->sc_dev), 'A' + sc->sc_half, (u_long)afar,
(u_long)afsr);
+ return (FILTER_HANDLED);
}
-static void
+static int
psycho_powerfail(void *arg)
{
@@ -810,18 +827,20 @@ psycho_powerfail(void *arg)
printf("Power Failure Detected: Shutting down NOW.\n");
shutdown_nice(0);
#endif
+ return (FILTER_HANDLED);
}
-static void
+static int
psycho_overtemp(void *arg)
{
printf("DANGER: OVER TEMPERATURE detected.\nShutting down NOW.\n");
shutdown_nice(RB_POWEROFF);
+ return (FILTER_HANDLED);
}
#ifdef PSYCHO_MAP_WAKEUP
-static void
+static int
psycho_wakeup(void *arg)
{
struct psycho_softc *sc = arg;
@@ -829,6 +848,7 @@ psycho_wakeup(void *arg)
PSYCHO_WRITE8(sc, PSR_PWRMGT_INT_CLR, 0);
/* Gee, we don't really have a framework to deal with this properly. */
device_printf(sc->sc_dev, "power management wakeup\n");
+ return (FILTER_HANDLED);
}
#endif /* PSYCHO_MAP_WAKEUP */
@@ -988,7 +1008,7 @@ psycho_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
}
/* Write to the correct clr register, and call the actual handler. */
-static void
+static int
psycho_intr_stub(void *arg)
{
struct psycho_clr *pc = arg;
@@ -1000,11 +1020,13 @@ psycho_intr_stub(void *arg)
}
pc->pci_handler(pc->pci_arg);
PSYCHO_WRITE8(pc->pci_sc, pc->pci_clr, 0);
+ return (FILTER_HANDLED);
}
static int
psycho_setup_intr(device_t dev, device_t child, struct resource *ires,
- int flags, driver_intr_t *intr, void *arg, void **cookiep)
+ int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
+ void **cookiep)
{
struct {
int apb:1;
@@ -1019,6 +1041,9 @@ psycho_setup_intr(device_t dev, device_t child, struct resource *ires,
uint64_t mr;
int error, ino;
+ if (filt != NULL && intr != NULL)
+ return (EINVAL);
+
sc = device_get_softc(dev);
pc = malloc(sizeof(*pc), M_DEVBUF, M_NOWAIT | M_ZERO);
if (pc == NULL)
@@ -1048,7 +1073,7 @@ psycho_setup_intr(device_t dev, device_t child, struct resource *ires,
pc->pci_sc = sc;
pc->pci_arg = arg;
- pc->pci_handler = intr;
+ pc->pci_handler = (filt != NULL) ? filt : (driver_filter_t *)intr;
pc->pci_clr = intrclrptr;
/*
@@ -1104,8 +1129,12 @@ psycho_setup_intr(device_t dev, device_t child, struct resource *ires,
/* Disable the interrupt while we fiddle with it. */
mr = PSYCHO_READ8(sc, intrmapptr);
PSYCHO_WRITE8(sc, intrmapptr, mr & ~INTMAP_V);
- error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
- psycho_intr_stub, pc, cookiep);
+ if (filt != NULL)
+ error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
+ psycho_intr_stub, NULL, pc, cookiep);
+ else
+ error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
+ NULL, (driver_intr_t *)psycho_intr_stub, pc, cookiep);
if (error != 0) {
free(pc, M_DEVBUF);
return (error);
diff --git a/sys/sparc64/sbus/sbus.c b/sys/sparc64/sbus/sbus.c
index a904fe9..5c96a3c 100644
--- a/sys/sparc64/sbus/sbus.c
+++ b/sys/sparc64/sbus/sbus.c
@@ -181,7 +181,7 @@ struct sbus_softc {
struct sbus_clr {
struct sbus_softc *scl_sc;
bus_addr_t scl_clr; /* clear register */
- driver_intr_t *scl_handler; /* handler to call */
+ driver_filter_t *scl_handler; /* handler to call */
void *scl_arg; /* argument for the handler */
void *scl_cookie; /* parent bus int. cookie */
};
@@ -209,10 +209,10 @@ static int sbus_inlist(const char *, const char **);
static struct sbus_devinfo * sbus_setup_dinfo(device_t, struct sbus_softc *,
phandle_t);
static void sbus_destroy_dinfo(struct sbus_devinfo *);
-static void sbus_intr_stub(void *);
+static int sbus_intr_stub(void *);
static bus_space_tag_t sbus_alloc_bustag(struct sbus_softc *);
-static void sbus_overtemp(void *);
-static void sbus_pwrfail(void *);
+static int sbus_overtemp(void *);
+static int sbus_pwrfail(void *);
static int sbus_print_res(struct sbus_devinfo *);
static device_method_t sbus_methods[] = {
@@ -433,8 +433,8 @@ sbus_attach(device_t dev)
sc->sc_ot_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, vec,
vec, 1, RF_ACTIVE);
if (sc->sc_ot_ires == NULL ||
- bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_FAST,
- sbus_overtemp, sc, &sc->sc_ot_ihand) != 0)
+ bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC,
+ sbus_overtemp, NULL, sc, &sc->sc_ot_ihand) != 0)
panic("%s: failed to set up temperature interrupt", __func__);
SYSIO_WRITE8(sc, SBR_THERM_INT_MAP, INTMAP_ENABLE(mr, PCPU_GET(mid)));
rid = 0;
@@ -443,8 +443,8 @@ sbus_attach(device_t dev)
sc->sc_pf_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, vec,
vec, 1, RF_ACTIVE);
if (sc->sc_pf_ires == NULL ||
- bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_FAST,
- sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0)
+ bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC,
+ sbus_pwrfail, NULL, sc, &sc->sc_pf_ihand) != 0)
panic("%s: failed to set up power fail interrupt", __func__);
SYSIO_WRITE8(sc, SBR_POWER_INT_MAP, INTMAP_ENABLE(mr, PCPU_GET(mid)));
@@ -637,7 +637,7 @@ sbus_get_resource_list(device_t dev, device_t child)
}
/* Write to the correct clr register, and call the actual handler. */
-static void
+static int
sbus_intr_stub(void *arg)
{
struct sbus_clr *scl;
@@ -645,11 +645,12 @@ sbus_intr_stub(void *arg)
scl = (struct sbus_clr *)arg;
scl->scl_handler(scl->scl_arg);
SYSIO_WRITE8(scl->scl_sc, scl->scl_clr, 0);
+ return (FILTER_HANDLED);
}
static int
sbus_setup_intr(device_t dev, device_t child, struct resource *ires, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
struct sbus_softc *sc;
struct sbus_clr *scl;
@@ -659,6 +660,8 @@ sbus_setup_intr(device_t dev, device_t child, struct resource *ires, int flags,
int error, i;
long vec;
+ if (filt != NULL && intr != NULL)
+ return (EINVAL);
sc = device_get_softc(dev);
scl = (struct sbus_clr *)malloc(sizeof(*scl), M_DEVBUF, M_NOWAIT);
if (scl == NULL)
@@ -697,12 +700,17 @@ sbus_setup_intr(device_t dev, device_t child, struct resource *ires, int flags,
scl->scl_sc = sc;
scl->scl_arg = arg;
- scl->scl_handler = intr;
+ scl->scl_handler = (filt != NULL) ? filt : (driver_filter_t *)intr;
scl->scl_clr = intrclrptr;
/* Disable the interrupt while we fiddle with it */
SYSIO_WRITE8(sc, intrmapptr, intrmap & ~INTMAP_V);
- error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
- sbus_intr_stub, scl, cookiep);
+ if (filt != NULL)
+ error = BUS_SETUP_INTR(device_get_parent(dev), child, ires,
+ flags, sbus_intr_stub, NULL, scl, cookiep);
+ else
+ error = BUS_SETUP_INTR(device_get_parent(dev), child, ires,
+ flags, NULL, (driver_intr_t *)sbus_intr_stub, scl,
+ cookiep);
if (error != 0) {
free(scl, M_DEVBUF);
return (error);
@@ -913,21 +921,23 @@ sbus_get_devinfo(device_t bus, device_t child)
* This handles the interrupt and powers off the machine.
* The same needs to be done to PCI controller drivers.
*/
-static void
+static int
sbus_overtemp(void *arg)
{
printf("DANGER: OVER TEMPERATURE detected\nShutting down NOW.\n");
shutdown_nice(RB_POWEROFF);
+ return (FILTER_HANDLED);
}
/* Try to shut down in time in case of power failure. */
-static void
+static int
sbus_pwrfail(void *arg)
{
printf("Power failure detected\nShutting down NOW.\n");
shutdown_nice(0);
+ return (FILTER_HANDLED);
}
static bus_space_tag_t
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c
index 27166c4..66c9ab7 100644
--- a/sys/sparc64/sparc64/intr_machdep.c
+++ b/sys/sparc64/sparc64/intr_machdep.c
@@ -248,14 +248,14 @@ intr_execute_handlers(void *cookie)
/* Execute fast interrupt handlers directly. */
thread = 0;
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST)) {
+ if (ih->ih_filter == NULL) {
thread = 1;
continue;
}
- MPASS(ih->ih_flags & IH_FAST && ih->ih_argument != NULL);
+ MPASS(ih->ih_filter != NULL && ih->ih_argument != NULL);
CTR3(KTR_INTR, "%s: executing handler %p(%p)", __func__,
- ih->ih_handler, ih->ih_argument);
- ih->ih_handler(ih->ih_argument);
+ ih->ih_filter, ih->ih_argument);
+ ih->ih_filter(ih->ih_argument);
}
/* Schedule a heavyweight interrupt process. */
@@ -270,8 +270,8 @@ intr_execute_handlers(void *cookie)
}
int
-inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
- int flags, void **cookiep)
+inthand_add(const char *name, int vec, driver_filter_t *filt,
+ void (*handler)(void *), void *arg, int flags, void **cookiep)
{
struct intr_vector *iv;
struct intr_event *ie; /* descriptor for the IRQ */
@@ -303,12 +303,12 @@ inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
}
}
- errcode = intr_event_add_handler(ie, name, handler, arg,
+ errcode = intr_event_add_handler(ie, name, filt, handler, arg,
intr_priority(flags), flags, cookiep);
if (errcode)
return (errcode);
- intr_setup(flags & INTR_FAST ? PIL_FAST : PIL_ITHREAD, intr_fast, vec,
+ intr_setup(filt != NULL ? PIL_FAST : PIL_ITHREAD, intr_fast, vec,
intr_execute_handlers, iv);
intr_stray_count[vec] = 0;
diff --git a/sys/sparc64/sparc64/nexus.c b/sys/sparc64/sparc64/nexus.c
index 4f4a8c8..d3dcb80 100644
--- a/sys/sparc64/sparc64/nexus.c
+++ b/sys/sparc64/sparc64/nexus.c
@@ -313,7 +313,7 @@ nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
int error;
@@ -329,7 +329,7 @@ nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
return (error);
error = inthand_add(device_get_nameunit(child), rman_get_start(res),
- intr, arg, flags, cookiep);
+ filt, intr, arg, flags, cookiep);
return (error);
}
diff --git a/sys/sparc64/sparc64/upa.c b/sys/sparc64/sparc64/upa.c
index 975203f..aef6e3b 100644
--- a/sys/sparc64/sparc64/upa.c
+++ b/sys/sparc64/sparc64/upa.c
@@ -401,7 +401,7 @@ upa_alloc_resource(device_t dev, device_t child, int type, int *rid,
static int
upa_setup_intr(device_t dev, device_t child, struct resource *ires, int flags,
- driver_intr_t *func, void *arg, void **cookiep)
+ driver_filter_t *filt, driver_intr_t *func, void *arg, void **cookiep)
{
struct upa_softc *sc;
uint64_t intrmap;
@@ -427,7 +427,7 @@ upa_setup_intr(device_t dev, device_t child, struct resource *ires, int flags,
UPA_WRITE(sc, imr, 0x0, intrmap & ~INTMAP_V);
(void)UPA_READ(sc, imr, 0x0);
- error = bus_generic_setup_intr(dev, child, ires, flags, func, arg,
+ error = bus_generic_setup_intr(dev, child, ires, flags, filt, func, arg,
cookiep);
if (error != 0)
return (error);
diff --git a/sys/sun4v/include/intr_machdep.h b/sys/sun4v/include/intr_machdep.h
index 9788e39..e933c8a 100644
--- a/sys/sun4v/include/intr_machdep.h
+++ b/sys/sun4v/include/intr_machdep.h
@@ -80,8 +80,8 @@ extern struct intr_vector intr_vectors[];
void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
void *iva);
-int inthand_add(const char *name, int vec, void (*handler)(void *),
- void *arg, int flags, void **cookiep);
+int inthand_add(const char *name, int vec, int (*filt)(void *),
+ void (*handler)(void *), void *arg, int flags, void **cookiep);
int inthand_remove(int vec, void *cookie);
void cpu_intrq_init(void);
diff --git a/sys/sun4v/sun4v/hvcons.c b/sys/sun4v/sun4v/hvcons.c
index ca75ed6..201b22c 100644
--- a/sys/sun4v/sun4v/hvcons.c
+++ b/sys/sun4v/sun4v/hvcons.c
@@ -390,7 +390,7 @@ hvcn_dev_attach(device_t dev)
goto fail;
}
- error = bus_setup_intr(dev, hvcn_irq, INTR_TYPE_TTY, hvcn_intr, hvcn_tp,
+ error = bus_setup_intr(dev, hvcn_irq, INTR_TYPE_TTY, NULL, hvcn_intr, hvcn_tp,
hvcn_intrhand);
if (error)
diff --git a/sys/sun4v/sun4v/intr_machdep.c b/sys/sun4v/sun4v/intr_machdep.c
index 6f17a69..0596b5a 100644
--- a/sys/sun4v/sun4v/intr_machdep.c
+++ b/sys/sun4v/sun4v/intr_machdep.c
@@ -145,7 +145,7 @@ static struct mtx intr_table_lock;
static void intr_execute_handlers(void *);
static void intr_stray_level(struct trapframe *);
-static void intr_stray_vector(void *);
+static void intr_stray_vector(void *);
static int intrcnt_setname(const char *, int);
static void intrcnt_updatename(int, const char *, int);
static void cpu_intrq_alloc(void);
@@ -294,14 +294,14 @@ intr_execute_handlers(void *cookie)
thread = 0;
TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) {
- if (!(ih->ih_flags & IH_FAST)) {
+ if (ih->ih_filter == NULL) {
thread = 1;
continue;
}
- MPASS(ih->ih_flags & IH_FAST && ih->ih_argument != NULL);
+ MPASS(ih->ih_filter == NULL && ih->ih_argument != NULL);
CTR3(KTR_INTR, "%s: executing handler %p(%p)", __func__,
- ih->ih_handler, ih->ih_argument);
- ih->ih_handler(ih->ih_argument);
+ ih->ih_filter, ih->ih_argument);
+ ih->ih_filter(ih->ih_argument);
}
/* Schedule a heavyweight interrupt process. */
@@ -315,7 +315,7 @@ intr_execute_handlers(void *cookie)
}
}
-static void
+static int
ithread_wrapper(void *arg)
{
struct ithread_vector_handler *ivh = (struct ithread_vector_handler *)arg;
@@ -323,12 +323,12 @@ ithread_wrapper(void *arg)
ivh->ivh_handler(ivh->ivh_arg);
/* re-enable interrupt */
hv_intr_setstate(ivh->ivh_vec, HV_INTR_IDLE_STATE);
-
+ return (FILTER_HANDLED);
}
int
-inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
- int flags, void **cookiep)
+inthand_add(const char *name, int vec, driver_filter_t *filt,
+ void (*handler)(void *), void *arg, int flags, void **cookiep)
{
struct intr_vector *iv;
struct intr_event *ie; /* descriptor for the IRQ */
@@ -336,6 +336,8 @@ inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
struct ithread_vector_handler *ivh;
int errcode, pil;
+ if (filt != NULL && handler != NULL)
+ return (EINVAL);
/*
* Work around a race where more than one CPU may be registering
* handlers on the same IRQ at the same time.
@@ -361,17 +363,17 @@ inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
}
}
- if (!(flags & INTR_FAST)) {
+ if (filt != NULL) {
ivh = (struct ithread_vector_handler *)
malloc(sizeof(struct ithread_vector_handler), M_DEVBUF, M_WAITOK);
- ivh->ivh_handler = handler;
+ ivh->ivh_handler = (driver_intr_t *)filt;
ivh->ivh_arg = arg;
ivh->ivh_vec = vec;
- errcode = intr_event_add_handler(ie, name, ithread_wrapper, ivh,
+ errcode = intr_event_add_handler(ie, name, ithread_wrapper, NULL, ivh,
intr_priority(flags), flags, cookiep);
} else {
ivh = NULL;
- errcode = intr_event_add_handler(ie, name, handler, arg,
+ errcode = intr_event_add_handler(ie, name, NULL, handler, arg,
intr_priority(flags), flags,
cookiep);
}
@@ -381,7 +383,7 @@ inthand_add(const char *name, int vec, void (*handler)(void *), void *arg,
free(ivh, M_DEVBUF);
return (errcode);
}
- pil = (flags & INTR_FAST) ? PIL_FAST : PIL_ITHREAD;
+ pil = (filt != NULL) ? PIL_FAST : PIL_ITHREAD;
intr_setup(pil, intr_fast, vec, intr_execute_handlers, iv);
diff --git a/sys/sun4v/sun4v/nexus.c b/sys/sun4v/sun4v/nexus.c
index af16e67..e100f82 100644
--- a/sys/sun4v/sun4v/nexus.c
+++ b/sys/sun4v/sun4v/nexus.c
@@ -306,7 +306,7 @@ nexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
struct nexus_devinfo *ndi;
device_t ichild;
@@ -346,7 +346,7 @@ nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
goto fail;
error = inthand_add(device_get_nameunit(child), ihdl,
- intr, arg, flags, cookiep);
+ filt, intr, arg, flags, cookiep);
cpuid = 0;
if (hv_intr_settarget(ihdl, cpuid) != H_EOK) {
diff --git a/sys/sun4v/sun4v/vnex.c b/sys/sun4v/sun4v/vnex.c
index 7e8b17a..5a36e64 100644
--- a/sys/sun4v/sun4v/vnex.c
+++ b/sys/sun4v/sun4v/vnex.c
@@ -249,7 +249,7 @@ vnex_probe_nomatch(device_t dev, device_t child)
static int
vnex_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
- driver_intr_t *intr, void *arg, void **cookiep)
+ driver_filter_t *filt,driver_intr_t *intr, void *arg, void **cookiep)
{
uint64_t reg, nreg;
@@ -298,7 +298,7 @@ vnex_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
goto fail;
error = inthand_add(device_get_nameunit(child), ihdl,
- intr, arg, flags, cookiep);
+ filt, intr, arg, flags, cookiep);
printf("inthandler added\n");
fail:
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index fef1df9..18f246e 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -122,8 +122,43 @@ typedef struct devclass *devclass_t;
#define device_method_t kobj_method_t
/**
- * @brief A driver interrupt service routine
+ * @brief Driver interrupt filter return values
+ *
+ * If a driver provides an interrupt filter routine it must return an
+ * integer consisting of oring together zero or more of the following
+ * flags:
+ *
+ * FILTER_STRAY - this device did not trigger the interrupt
+ * FILTER_HANDLED - the interrupt has been fully handled and can be EOId
+ * FILTER_SCHEDULE_THREAD - the threaded interrupt handler should be
+ * scheduled to execute
+ *
+ * If the driver does not provide a filter, then the interrupt code will
+ * act is if the filter had returned FILTER_SCHEDULE_THREAD. Note that it
+ * is illegal to specify any other flag with FILTER_STRAY and that it is
+ * illegal to not specify either of FILTER_HANDLED or FILTER_SCHEDULE_THREAD
+ * if FILTER_STRAY is not specified.
+ */
+#define FILTER_STRAY 0x01
+#define FILTER_HANDLED 0x02
+#define FILTER_SCHEDULE_THREAD 0x04
+
+/**
+ * @brief Driver interrupt service routines
+ *
+ * The filter routine is run in primary interrupt context and may not
+ * block or use regular mutexes. It may only use spin mutexes for
+ * synchronization. The filter may either completely handle the
+ * interrupt or it may perform some of the work and defer more
+ * expensive work to the regular interrupt handler. If a filter
+ * routine is not registered by the driver, then the regular interrupt
+ * handler is always used to handle interrupts from this device.
+ *
+ * The regular interrupt handler executes in its own thread context
+ * and may use regular mutexes. However, it is prohibited from
+ * sleeping on a sleep queue.
*/
+typedef int driver_filter_t(void*);
typedef void driver_intr_t(void*);
/**
@@ -272,7 +307,8 @@ int bus_generic_release_resource(device_t bus, device_t child,
int bus_generic_resume(device_t dev);
int bus_generic_setup_intr(device_t dev, device_t child,
struct resource *irq, int flags,
- driver_intr_t *intr, void *arg, void **cookiep);
+ driver_filter_t *filter, driver_intr_t *intr,
+ void *arg, void **cookiep);
struct resource *
bus_generic_rl_alloc_resource (device_t, device_t, int, int *,
@@ -318,7 +354,8 @@ int bus_release_resource(device_t dev, int type, int rid,
struct resource *r);
int bus_free_resource(device_t dev, int type, struct resource *r);
int bus_setup_intr(device_t dev, struct resource *r, int flags,
- driver_intr_t handler, void *arg, void **cookiep);
+ driver_filter_t filter, driver_intr_t handler,
+ void *arg, void **cookiep);
int bus_teardown_intr(device_t dev, struct resource *r, void *cookie);
int bus_set_resource(device_t dev, int type, int rid,
u_long start, u_long count);
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index 0e73976..cfbb28f 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -34,6 +34,7 @@
struct intr_event;
struct intr_thread;
+struct trapframe;
/*
* Describe a hardware interrupt handler.
@@ -42,6 +43,7 @@ struct intr_thread;
* together.
*/
struct intr_handler {
+ driver_filter_t *ih_filter; /* Filter function. */
driver_intr_t *ih_handler; /* Handler function. */
void *ih_argument; /* Argument to pass to handler. */
int ih_flags;
@@ -53,7 +55,6 @@ struct intr_handler {
};
/* Interrupt handle flags kept in ih_flags */
-#define IH_FAST 0x00000001 /* Fast interrupt. */
#define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */
#define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */
#define IH_DEAD 0x00000008 /* Handler should be removed. */
@@ -111,10 +112,11 @@ extern char intrnames[]; /* string table containing device names */
#ifdef DDB
void db_dump_intr_event(struct intr_event *ie, int handlers);
#endif
+int intr_event_handle(struct intr_event *ie, struct trapframe *frame);
u_char intr_priority(enum intr_type flags);
int intr_event_add_handler(struct intr_event *ie, const char *name,
- driver_intr_t handler, void *arg, u_char pri, enum intr_type flags,
- void **cookiep);
+ driver_filter_t filter, driver_intr_t handler, void *arg,
+ u_char pri, enum intr_type flags, void **cookiep);
int intr_event_create(struct intr_event **event, void *source,
int flags, void (*enable)(void *), const char *fmt, ...)
__printflike(5, 6);
OpenPOWER on IntegriCloud