o break newbus api: add a new argument of type driver_filter_t to

bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
This commit is contained in:
Paolo Pisati 2007-02-23 12:19:07 +00:00
parent 68cb865905
commit ef544f6312
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166901
255 changed files with 781 additions and 575 deletions

View File

@ -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);
}
/*

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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));

View File

@ -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;

View File

@ -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

View File

@ -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);
}
/*

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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);
}

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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++)

View File

@ -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));

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}
/*

View File

@ -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);

View File

@ -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;
}

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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",

View File

@ -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)

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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));

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -2505,7 +2505,7 @@ bge_attach(device_t dev)
* 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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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 @@ cyintr(void *vcom)
swi_sched(cy_slow_ih, SWI_DELAY);
COM_UNLOCK();
return (FILTER_HANDLED);
}
static void

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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");

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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,

Some files were not shown because too many files have changed in this diff Show More