From e9cb6d995373cab0661e6e4f3f2cd2c8b6459c11 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 24 May 2005 20:59:05 +0000 Subject: [PATCH] Get rid of bus_{disable,enable}_intr(), it wasn't generic enough for our needs. Implement some generic atomic.h functions to aid in the implementation of a low level mutex. Implement a generic low level sleep-mutex serializer, kern/lwkt_serialize.c. The serializer is designed to be a replacement for SPL calls but may also be used for other very low level work (e.g. lockmgr interlocks). Add a serializer argument to BUS_SETUP_INTR(). When non-NULL, the interrupt handler will no longer be protected by an SPL so e.g. spl*() will no longer protect against that device's interrupts. The IF queueing and dequeueing mechanisms may no longer depend on outside SPL state because network driver interrupt handlers are no longer required to enter splnet(). Use critical sections for the moment. The IFQ and IFF_OACTIVE interactions are not yet MP safe. --- sys/bus/firewire/fwohci_pci.c | 10 +- sys/bus/iicbus/i386/pcf.c | 7 +- sys/bus/isa/i386/isa.c | 7 +- sys/bus/isa/i386/isa_compat.c | 4 +- sys/bus/isa/isa_common.h | 5 +- sys/bus/pccard/pccard.c | 9 +- sys/bus/pci/pci_compat.c | 6 +- sys/bus/ppbus/ppbconf.c | 7 +- sys/bus/usb/ehci_pci.c | 4 +- sys/bus/usb/ohci_pci.c | 4 +- sys/bus/usb/uhci_pci.c | 4 +- sys/conf/files | 3 +- sys/contrib/dev/oltr/if_oltr.c | 5 +- sys/cpu/i386/include/atomic.h | 128 ++++++++++++++++++++++- sys/dev/acpica/Osd/OsdInterrupt.c | 7 +- sys/dev/acpica5/Osd/OsdInterrupt.c | 4 +- sys/dev/crypto/hifn/hifn7751.c | 5 +- sys/dev/crypto/ubsec/ubsec.c | 5 +- sys/dev/disk/advansys/adv_eisa.c | 4 +- sys/dev/disk/advansys/adv_isa.c | 4 +- sys/dev/disk/advansys/adv_pci.c | 4 +- sys/dev/disk/advansys/adwcam.c | 4 +- sys/dev/disk/aha/aha_isa.c | 4 +- sys/dev/disk/aha/aha_mca.c | 5 +- sys/dev/disk/ahb/ahb.c | 4 +- sys/dev/disk/aic/aic_cbus.c | 4 +- sys/dev/disk/aic/aic_isa.c | 4 +- sys/dev/disk/aic/aic_pccard.c | 4 +- sys/dev/disk/aic7xxx/aic79xx_osm.c | 4 +- sys/dev/disk/aic7xxx/aic7xxx_osm.c | 4 +- sys/dev/disk/amd/amd.c | 5 +- sys/dev/disk/ata/ata-all.c | 4 +- sys/dev/disk/ata/ata-pci.c | 8 +- sys/dev/disk/buslogic/bt.c | 4 +- sys/dev/disk/ct/ct_isa.c | 5 +- sys/dev/disk/fd/fd.c | 5 +- sys/dev/disk/isp/isp_pci.c | 4 +- sys/dev/disk/mpt/mpt_pci.c | 4 +- sys/dev/disk/ncr/ncr.c | 4 +- sys/dev/disk/ncv/ncr53c500_pccard.c | 5 +- sys/dev/disk/nsp/nsp_pccard.c | 5 +- sys/dev/disk/stg/tmc18c30_isa.c | 5 +- sys/dev/disk/stg/tmc18c30_pccard.c | 5 +- sys/dev/disk/sym/sym_hipd.c | 4 +- sys/dev/disk/trm/trm.c | 5 +- sys/dev/drm/drm_dma.h | 6 +- sys/dev/misc/atkbd/atkbd_isa.c | 4 +- sys/dev/misc/lpt/lpt.c | 4 +- sys/dev/misc/mse/mse.c | 4 +- sys/dev/misc/musycc/musycc.c | 5 +- sys/dev/misc/ppc/ppc.c | 18 ++-- sys/dev/misc/ppi/ppi.c | 8 +- sys/dev/misc/pps/pps.c | 4 +- sys/dev/misc/psm/psm.c | 4 +- sys/dev/misc/puc/puc.c | 14 ++- sys/dev/netif/an/if_an_isa.c | 4 +- sys/dev/netif/an/if_an_pccard.c | 4 +- sys/dev/netif/an/if_an_pci.c | 4 +- sys/dev/netif/ar/if_ar.c | 9 +- sys/dev/netif/awi/if_awi_pccard.c | 5 +- sys/dev/netif/bfe/if_bfe.c | 4 +- sys/dev/netif/bge/if_bge.c | 4 +- sys/dev/netif/cm/if_cm_isa.c | 4 +- sys/dev/netif/cs/if_cs_isa.c | 4 +- sys/dev/netif/cs/if_cs_pccard.c | 4 +- sys/dev/netif/dc/if_dc.c | 4 +- sys/dev/netif/de/if_de.c | 4 +- sys/dev/netif/ed/if_ed_cbus.c | 4 +- sys/dev/netif/ed/if_ed_isa.c | 4 +- sys/dev/netif/ed/if_ed_pccard.c | 4 +- sys/dev/netif/ed/if_ed_pci.c | 4 +- sys/dev/netif/em/if_em.c | 4 +- sys/dev/netif/em/if_em.h | 2 +- sys/dev/netif/ep/if_ep_eisa.c | 4 +- sys/dev/netif/ep/if_ep_isa.c | 4 +- sys/dev/netif/ep/if_ep_mca.c | 4 +- sys/dev/netif/ep/if_ep_pccard.c | 4 +- sys/dev/netif/ex/if_ex_isa.c | 5 +- sys/dev/netif/ex/if_ex_pccard.c | 4 +- sys/dev/netif/fe/if_fe.c | 4 +- sys/dev/netif/fea/if_fea.c | 4 +- sys/dev/netif/fxp/if_fxp.c | 4 +- sys/dev/netif/gx/if_gx.c | 4 +- sys/dev/netif/ipw/if_ipw.c | 4 +- sys/dev/netif/iwi/if_iwi.c | 4 +- sys/dev/netif/lge/if_lge.c | 4 +- sys/dev/netif/lnc/if_lnc_isa.c | 4 +- sys/dev/netif/lnc/if_lnc_pci.c | 4 +- sys/dev/netif/mn/if_mn.c | 5 +- sys/dev/netif/my/if_my.c | 4 +- sys/dev/netif/ndis/if_ndis.c | 5 +- sys/dev/netif/nge/if_nge.c | 4 +- sys/dev/netif/nv/if_nv.c | 4 +- sys/dev/netif/owi/if_owi.c | 4 +- sys/dev/netif/pcn/if_pcn.c | 4 +- sys/dev/netif/plip/if_plip.c | 7 +- sys/dev/netif/ray/if_ray.c | 7 +- sys/dev/netif/re/if_re.c | 4 +- sys/dev/netif/rl/if_rl.c | 4 +- sys/dev/netif/sbni/if_sbni_isa.c | 8 +- sys/dev/netif/sbni/if_sbni_pci.c | 5 +- sys/dev/netif/sbsh/if_sbsh.c | 4 +- sys/dev/netif/sf/if_sf.c | 4 +- sys/dev/netif/sis/if_sis.c | 5 +- sys/dev/netif/sk/if_sk.c | 5 +- sys/dev/netif/sn/if_sn.c | 7 +- sys/dev/netif/snc/if_snc_cbus.c | 4 +- sys/dev/netif/snc/if_snc_pccard.c | 4 +- sys/dev/netif/sr/if_sr.c | 5 +- sys/dev/netif/ste/if_ste.c | 4 +- sys/dev/netif/ti/if_ti.c | 4 +- sys/dev/netif/tl/if_tl.c | 4 +- sys/dev/netif/tx/if_tx.c | 4 +- sys/dev/netif/txp/if_txp.c | 4 +- sys/dev/netif/vr/if_vr.c | 4 +- sys/dev/netif/vx/if_vx_eisa.c | 4 +- sys/dev/netif/vx/if_vx_pci.c | 4 +- sys/dev/netif/wb/if_wb.c | 4 +- sys/dev/netif/wi/if_wi.c | 4 +- sys/dev/netif/xe/if_xe.c | 7 +- sys/dev/netif/xl/if_xl.c | 4 +- sys/dev/pccard/cardbus/cardbus.c | 9 +- sys/dev/pccard/pccbb/pccbb.c | 12 ++- sys/dev/powermng/i386/intpm/intpm.c | 6 +- sys/dev/powermng/i386/viapm/viapm.c | 9 +- sys/dev/powermng/ichsmb/ichsmb_pci.c | 5 +- sys/dev/raid/aac/aac_pci.c | 4 +- sys/dev/raid/amr/amr_pci.c | 7 +- sys/dev/raid/asr/asr.c | 11 +- sys/dev/raid/ciss/ciss.c | 8 +- sys/dev/raid/dpt/dpt_eisa.c | 6 +- sys/dev/raid/dpt/dpt_pci.c | 6 +- sys/dev/raid/ida/ida_eisa.c | 4 +- sys/dev/raid/ida/ida_pci.c | 4 +- sys/dev/raid/iir/iir_pci.c | 7 +- sys/dev/raid/ips/ips_pci.c | 9 +- sys/dev/raid/mlx/mlx.c | 6 +- sys/dev/raid/mly/mly_pci.c | 6 +- sys/dev/raid/pst/pst-iop.c | 5 +- sys/dev/raid/twa/twa_freebsd.c | 4 +- sys/dev/raid/twe/twe_freebsd.c | 7 +- sys/dev/serial/digi/digi_pci.c | 5 +- sys/dev/serial/si/si_eisa.c | 5 +- sys/dev/serial/si/si_isa.c | 5 +- sys/dev/serial/si/si_pci.c | 4 +- sys/dev/serial/sio/sio.c | 6 +- sys/dev/sound/isa/ad1816.c | 7 +- sys/dev/sound/isa/ess.c | 6 +- sys/dev/sound/isa/gusc.c | 15 +-- sys/dev/sound/isa/mss.c | 8 +- sys/dev/sound/isa/sb16.c | 6 +- sys/dev/sound/isa/sb8.c | 6 +- sys/dev/sound/isa/sbc.c | 12 ++- sys/dev/sound/pci/als4000.c | 6 +- sys/dev/sound/pci/aureal.c | 6 +- sys/dev/sound/pci/cmi.c | 6 +- sys/dev/sound/pci/cs4281.c | 6 +- sys/dev/sound/pci/csa.c | 14 ++- sys/dev/sound/pci/csapcm.c | 6 +- sys/dev/sound/pci/ds1.c | 6 +- sys/dev/sound/pci/emu10k1.c | 6 +- sys/dev/sound/pci/es137x.c | 6 +- sys/dev/sound/pci/fm801.c | 6 +- sys/dev/sound/pci/ich.c | 6 +- sys/dev/sound/pci/maestro.c | 6 +- sys/dev/sound/pci/maestro3.c | 6 +- sys/dev/sound/pci/neomagic.c | 6 +- sys/dev/sound/pci/solo.c | 6 +- sys/dev/sound/pci/t4dwave.c | 6 +- sys/dev/sound/pci/via8233.c | 6 +- sys/dev/sound/pci/via82c686.c | 6 +- sys/dev/sound/pci/vibes.c | 6 +- sys/dev/sound/pcm/sound.c | 14 ++- sys/dev/sound/pcm/sound.h | 5 +- sys/dev/video/bktr/bktr_os.c | 4 +- sys/dev/video/tga/tga_pci.c | 4 +- sys/i386/i386/nexus.c | 26 ++--- sys/i386/include/atomic.h | 128 ++++++++++++++++++++++- sys/i386/isa/clock.c | 11 +- sys/i386/isa/intr_machdep.c | 58 +++++----- sys/i386/isa/intr_machdep.h | 12 ++- sys/i386/isa/npx.c | 4 +- sys/kern/bus_if.m | 12 ++- sys/kern/subr_bus.c | 25 +++-- sys/net/altq/altq_cbq.c | 29 +++-- sys/net/altq/altq_hfsc.c | 21 +++- sys/net/altq/altq_priq.c | 40 +++++-- sys/net/altq/altq_subr.c | 9 +- sys/net/i4b/capi/iavc/iavc_isa.c | 11 +- sys/net/i4b/capi/iavc/iavc_pci.c | 10 +- sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c | 5 +- sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c | 5 +- sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c | 7 +- sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c | 9 +- sys/net/i4b/layer1/isic/i4b_avm_a1.c | 4 +- sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c | 6 +- sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c | 6 +- sys/net/i4b/layer1/isic/i4b_isic_pnp.c | 6 +- sys/net/i4b/layer1/isic/i4b_itk_ix1.c | 7 +- sys/net/i4b/layer1/isic/i4b_tel_s016.c | 8 +- sys/net/i4b/layer1/isic/i4b_tel_s0163.c | 8 +- sys/net/i4b/layer1/isic/i4b_tel_s08.c | 4 +- sys/net/i4b/layer1/isic/i4b_usr_sti.c | 4 +- sys/net/i4b/layer1/itjc/i4b_itjc_pci.c | 4 +- sys/net/i4b/layer1/iwic/i4b_iwic_pci.c | 6 +- sys/net/if.c | 15 ++- sys/platform/pc32/i386/nexus.c | 26 ++--- sys/platform/pc32/isa/clock.c | 11 +- sys/platform/pc32/isa/intr_machdep.c | 58 +++++----- sys/platform/pc32/isa/intr_machdep.h | 12 ++- sys/platform/pc32/isa/npx.c | 4 +- sys/sys/bus.h | 13 ++- sys/sys/serialize.h | 37 +++++++ 213 files changed, 1080 insertions(+), 657 deletions(-) create mode 100644 sys/sys/serialize.h diff --git a/sys/bus/firewire/fwohci_pci.c b/sys/bus/firewire/fwohci_pci.c index 61ee30c0f1..5c1e666b65 100644 --- a/sys/bus/firewire/fwohci_pci.c +++ b/sys/bus/firewire/fwohci_pci.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/fwohci_pci.c,v 1.38 2004/01/23 17:37:09 simokawa Exp $ - * $DragonFly: src/sys/bus/firewire/fwohci_pci.c,v 1.16 2004/11/08 16:50:33 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/fwohci_pci.c,v 1.17 2005/05/24 20:58:45 dillon Exp $ */ #define BOUNCE_BUFFER_TEST 0 @@ -326,14 +326,16 @@ fwohci_pci_attach(device_t self) #else INTR_TYPE_NET, #endif - (driver_intr_t *) fwohci_intr, sc, &sc->ih); + (driver_intr_t *) fwohci_intr, sc, &sc->ih, NULL); #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, - (driver_intr_t *) fwohci_dummy_intr, sc, &sc->ih_cam); + (driver_intr_t *) fwohci_dummy_intr, sc, + &sc->ih_cam, NULL); /* XXX splbio() should mask this irq for physio()/fwmem_strategy() */ err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, - (driver_intr_t *) fwohci_dummy_intr, sc, &sc->ih_bio); + (driver_intr_t *) fwohci_dummy_intr, sc, + &sc->ih_bio, NULL); #endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); diff --git a/sys/bus/iicbus/i386/pcf.c b/sys/bus/iicbus/i386/pcf.c index 416e5f506e..09444efb17 100644 --- a/sys/bus/iicbus/i386/pcf.c +++ b/sys/bus/iicbus/i386/pcf.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/pcf.c,v 1.14 2000/01/14 00:18:05 nsouch Exp $ - * $DragonFly: src/sys/bus/iicbus/i386/pcf.c,v 1.4 2005/02/17 13:59:35 joerg Exp $ + * $DragonFly: src/sys/bus/iicbus/i386/pcf.c,v 1.5 2005/05/24 20:58:47 dillon Exp $ * */ #include @@ -194,8 +194,9 @@ pcf_attach(device_t pcfdev) if (pcf->res_irq) { /* default to the tty mask for registration */ /* XXX */ - error = BUS_SETUP_INTR(parent, pcfdev, pcf->res_irq, INTR_TYPE_NET, - pcfintr, pcfdev, &pcf->intr_cookie); + error = BUS_SETUP_INTR(parent, pcfdev, pcf->res_irq, + INTR_TYPE_NET, pcfintr, pcfdev, + &pcf->intr_cookie, NULL); if (error) return (error); } diff --git a/sys/bus/isa/i386/isa.c b/sys/bus/isa/i386/isa.c index dd7ea636a1..586bb2ef25 100644 --- a/sys/bus/isa/i386/isa.c +++ b/sys/bus/isa/i386/isa.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/isa.c,v 1.132.2.5 2002/03/03 05:42:50 nyan Exp $ - * $DragonFly: src/sys/bus/isa/i386/isa.c,v 1.5 2004/04/07 05:54:35 dillon Exp $ + * $DragonFly: src/sys/bus/isa/i386/isa.c,v 1.6 2005/05/24 20:58:50 dillon Exp $ */ /* @@ -254,10 +254,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) + void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer) { return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags, - ihand, arg, cookiep)); + ihand, arg, cookiep, serializer)); } int diff --git a/sys/bus/isa/i386/isa_compat.c b/sys/bus/isa/i386/isa_compat.c index 9db861a6e4..e284817a61 100644 --- a/sys/bus/isa/i386/isa_compat.c +++ b/sys/bus/isa/i386/isa_compat.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/isa_compat.c,v 1.18.2.1 2001/05/17 23:05:06 imp Exp $ - * $DragonFly: src/sys/bus/isa/i386/isa_compat.c,v 1.8 2004/04/01 07:33:18 joerg Exp $ + * $DragonFly: src/sys/bus/isa/i386/isa_compat.c,v 1.9 2005/05/24 20:58:50 dillon Exp $ */ #include @@ -260,7 +260,7 @@ isa_compat_attach(device_t dev) res.irq, op->type, dvp->id_intr, (void *)(uintptr_t)dvp->id_unit, - &ih); + &ih, NULL); if (error) printf("isa_compat_attach: failed to setup intr: %d\n", error); diff --git a/sys/bus/isa/isa_common.h b/sys/bus/isa/isa_common.h index ecbd34c217..367868a28d 100644 --- a/sys/bus/isa/isa_common.h +++ b/sys/bus/isa/isa_common.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/isa_common.h,v 1.5 1999/09/07 08:42:47 dfr Exp $ - * $DragonFly: src/sys/bus/isa/isa_common.h,v 1.3 2005/04/30 23:04:21 swildner Exp $ + * $DragonFly: src/sys/bus/isa/isa_common.h,v 1.4 2005/05/24 20:58:48 dillon Exp $ */ /* @@ -75,6 +75,7 @@ extern int isa_release_resource(device_t bus, device_t child, 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); + void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer); extern int isa_teardown_intr(device_t bus, device_t child, struct resource *r, void *cookie); diff --git a/sys/bus/pccard/pccard.c b/sys/bus/pccard/pccard.c index d57cd43b69..ad2956480c 100644 --- a/sys/bus/pccard/pccard.c +++ b/sys/bus/pccard/pccard.c @@ -1,6 +1,6 @@ /* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */ /* $FreeBSD: src/sys/dev/pccard/pccard.c,v 1.70 2002/11/14 14:02:32 mux Exp $ */ -/* $DragonFly: src/sys/bus/pccard/pccard.c,v 1.12 2004/07/10 16:25:58 dillon Exp $ */ +/* $DragonFly: src/sys/bus/pccard/pccard.c,v 1.13 2005/05/24 20:58:51 dillon Exp $ */ /* * Copyright (c) 1997 Marc Horowitz. All rights reserved. @@ -122,7 +122,7 @@ static void pccard_child_detached(device_t parent, device_t dev); static void 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); + void *arg, void **cookiep, lwkt_serialize_t serializer); static int pccard_teardown_intr(device_t dev, device_t child, struct resource *r, void *cookie); @@ -1211,7 +1211,8 @@ 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) + int flags, driver_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer) { struct pccard_softc *sc = PCCARD_SOFTC(dev); struct pccard_ivar *ivar = PCCARD_IVAR(child); @@ -1221,7 +1222,7 @@ pccard_setup_intr(device_t dev, device_t child, struct resource *irq, if (func->intr_handler != NULL) panic("Only one interrupt handler per function allowed"); err = bus_generic_setup_intr(dev, child, irq, flags, pccard_intr, - func, cookiep); + func, cookiep, NULL); if (err != 0) return (err); func->intr_handler = intr; diff --git a/sys/bus/pci/pci_compat.c b/sys/bus/pci/pci_compat.c index d3fc010338..3bedac2208 100644 --- a/sys/bus/pci/pci_compat.c +++ b/sys/bus/pci/pci_compat.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/pci_compat.c,v 1.35.2.1 2001/10/14 21:14:14 luigi Exp $ - * $DragonFly: src/sys/bus/pci/pci_compat.c,v 1.7 2004/04/01 07:33:18 joerg Exp $ + * $DragonFly: src/sys/bus/pci/pci_compat.c,v 1.8 2005/05/24 20:58:52 dillon Exp $ * */ @@ -153,7 +153,7 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg, flags |= INTR_TYPE_CAM; error = BUS_SETUP_INTR(device_get_parent(cfg->dev), cfg->dev, - res, flags, handler, arg, &ih); + res, flags, handler, arg, &ih, NULL); if (error != 0) return 0; @@ -204,7 +204,7 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg, } error = BUS_SETUP_INTR(device_get_parent(cfg->dev), cfg->dev, res, flags, - handler, arg, &ih); + handler, arg, &ih, NULL); if (error != 0) { printf("pci_map_int: BUS_SETUP_INTR failed\n"); return 0; diff --git a/sys/bus/ppbus/ppbconf.c b/sys/bus/ppbus/ppbconf.c index 133fd3352a..85e84fe073 100644 --- a/sys/bus/ppbus/ppbconf.c +++ b/sys/bus/ppbus/ppbconf.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/ppbconf.c,v 1.17.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/bus/ppbus/ppbconf.c,v 1.5 2004/04/07 05:54:41 dillon Exp $ + * $DragonFly: src/sys/bus/ppbus/ppbconf.c,v 1.6 2005/05/24 20:58:53 dillon Exp $ * */ #include "opt_ppb_1284.h" @@ -405,7 +405,8 @@ ppbus_attach(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) + void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer) { int error; struct ppb_data *ppb = DEVTOSOFTC(bus); @@ -416,7 +417,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))) + ihand, arg, cookiep, serializer))) return (error); /* store the resource and the cookie for eventually forcing diff --git a/sys/bus/usb/ehci_pci.c b/sys/bus/usb/ehci_pci.c index 561e63fc12..f41d5b5eba 100644 --- a/sys/bus/usb/ehci_pci.c +++ b/sys/bus/usb/ehci_pci.c @@ -34,7 +34,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * $FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.9 2003/12/17 17:15:41 peter Exp $ - * $DragonFly: src/sys/bus/usb/ehci_pci.c,v 1.5 2004/07/16 17:24:48 drhodus Exp $ + * $DragonFly: src/sys/bus/usb/ehci_pci.c,v 1.6 2005/05/24 20:58:54 dillon Exp $ */ /* @@ -229,7 +229,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); + (driver_intr_t *) ehci_intr, sc, &sc->ih, NULL); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->ih = NULL; diff --git a/sys/bus/usb/ohci_pci.c b/sys/bus/usb/ohci_pci.c index 7aefc7cbd8..ef6aaef0f8 100644 --- a/sys/bus/usb/ohci_pci.c +++ b/sys/bus/usb/ohci_pci.c @@ -35,7 +35,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/ohci_pci.c,v 1.38 2003/12/22 15:18:46 shiba Exp $ - * $DragonFly: src/sys/bus/usb/ohci_pci.c,v 1.1 2003/12/30 01:01:44 dillon Exp $ + * $DragonFly: src/sys/bus/usb/ohci_pci.c,v 1.2 2005/05/24 20:58:54 dillon Exp $ */ /* @@ -282,7 +282,7 @@ ohci_pci_attach(device_t self) } err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_BIO, - (driver_intr_t *) ohci_intr, sc, &sc->ih); + (driver_intr_t *) ohci_intr, sc, &sc->ih, NULL); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->ih = NULL; diff --git a/sys/bus/usb/uhci_pci.c b/sys/bus/usb/uhci_pci.c index 18fceb21a5..d5a5522c92 100644 --- a/sys/bus/usb/uhci_pci.c +++ b/sys/bus/usb/uhci_pci.c @@ -35,7 +35,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/uhci_pci.c,v 1.51 2003/11/28 05:28:29 imp Exp $ - * $DragonFly: src/sys/bus/usb/uhci_pci.c,v 1.4 2004/07/16 13:41:55 asmodai Exp $ + * $DragonFly: src/sys/bus/usb/uhci_pci.c,v 1.5 2005/05/24 20:58:54 dillon Exp $ */ /* Universal Host Controller Interface @@ -327,7 +327,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); + (driver_intr_t *) uhci_intr, sc, &sc->ih, NULL); if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->ih = NULL; diff --git a/sys/conf/files b/sys/conf/files index 070d200fce..a9cbf1f9d6 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/files,v 1.340.2.137 2003/06/04 17:10:30 sam Exp $ -# $DragonFly: src/sys/conf/files,v 1.89 2005/04/21 14:43:58 joerg Exp $ +# $DragonFly: src/sys/conf/files,v 1.90 2005/05/24 20:58:55 dillon Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -663,6 +663,7 @@ kern/lwkt_ipiq.c standard kern/lwkt_token.c standard kern/lwkt_msgport.c standard kern/lwkt_rwlock.c standard +kern/lwkt_serialize.c standard kern/lwkt_caps.c standard kern/kern_synch.c standard kern/kern_syscalls.c standard diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c index c77d668b6a..29a2faf175 100644 --- a/sys/contrib/dev/oltr/if_oltr.c +++ b/sys/contrib/dev/oltr/if_oltr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/contrib/dev/oltr/if_oltr.c,v 1.11.2.5 2001/10/20 04:15:21 mdodd Exp $ - * $DragonFly: src/sys/contrib/dev/oltr/Attic/if_oltr.c,v 1.16 2005/01/23 20:21:30 joerg Exp $ + * $DragonFly: src/sys/contrib/dev/oltr/Attic/if_oltr.c,v 1.17 2005/05/24 20:58:56 dillon Exp $ */ #include @@ -369,7 +369,8 @@ oltr_pci_attach(device_t dev) device_printf(dev, "couldn't map interrupt\n"); goto config_failed; } - if (bus_setup_intr(dev, sc->oltr_irq, INTR_TYPE_NET, oltr_intr, sc, &sc->oltr_intrhand)) { + if (bus_setup_intr(dev, sc->oltr_irq, INTR_TYPE_NET, oltr_intr, sc, + &sc->oltr_intrhand, NULL)) { device_printf(dev, "couldn't setup interrupt\n"); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->oltr_irq); goto config_failed; diff --git a/sys/cpu/i386/include/atomic.h b/sys/cpu/i386/include/atomic.h index 8521db43b4..32c046d6aa 100644 --- a/sys/cpu/i386/include/atomic.h +++ b/sys/cpu/i386/include/atomic.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/atomic.h,v 1.9.2.1 2000/07/07 00:38:47 obrien Exp $ - * $DragonFly: src/sys/cpu/i386/include/atomic.h,v 1.9 2005/04/13 04:00:48 dillon Exp $ + * $DragonFly: src/sys/cpu/i386/include/atomic.h,v 1.10 2005/05/24 20:58:38 dillon Exp $ */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -162,4 +162,130 @@ atomic_poll_release_int(volatile u_int *p) #endif +/* + * These functions operate on a 32 bit interrupt interlock which is defined + * as follows: + * + * bit 0-30 interrupt handler disabled bits (counter) + * bit 31 interrupt handler currently running bit (1 = run) + * + * + * atomic_intr_cond_enter(P, func, arg) + * Increment the request counter and attempt to + * set bit 31 to acquire the interlock. If + * we are unable to set bit 31 func(arg) is + * called in a loop until we are able to set + * bit 31. + * + * atomic_intr_cond_exit(P, func, arg) + * Decrement the request counter and clear bit + * 31. If the request counter is still non-zero + * call func(arg) once. + * + * atomic_intr_handler_disable(P) + * Set bit 30, indicating that the interrupt + * handler has been disabled. Must be called + * after the hardware is disabled. + * + * Returns bit 31 indicating whether a serialized + * accessor is active (typically the interrupt + * handler is running). 0 == not active, + * non-zero == active. + * + * atomic_intr_handler_enable(P) + * Clear bit 30, indicating that the interrupt + * handler has been enabled. Must be called + * before the hardware is actually enabled. + * + * atomic_intr_handler_is_enabled(P) + * Returns bit 30, 0 indicates that the handler + * is enabled, non-zero indicates that it is + * disabled. The request counter portion of + * the field is ignored. + */ + +#ifndef __ATOMIC_INTR_T +#define __ATOMIC_INTR_T +typedef volatile int atomic_intr_t; +#endif + +#if defined(KLD_MODULE) + +void atomic_intr_init(atomic_intr_t *p); +int atomic_intr_handler_disable(atomic_intr_t *p); +void atomic_intr_handler_enable(atomic_intr_t *p); +int atomic_intr_handler_is_enabled(atomic_intr_t *p); +void atomic_intr_cond_enter(atomic_intr_t *p, void (*func)(void *), void *arg); +void atomic_intr_cond_exit(atomic_intr_t *p, void (*func)(void *), void *arg); + +#else + +static __inline +void +atomic_intr_init(atomic_intr_t *p) +{ + *p = 0; +} + +static __inline +int +atomic_intr_handler_disable(atomic_intr_t *p) +{ + int data; + + __asm __volatile(MPLOCKED "orl $0x40000000,%1; movl %1,%%eax; " \ + "andl $0x80000000,%%eax" \ + : "=&a"(data) : "m"(*p)); + return(data); +} + +static __inline +void +atomic_intr_handler_enable(atomic_intr_t *p) +{ + __asm __volatile(MPLOCKED "andl $0xB0000000,%0" : "+m" (*p)); +} + +static __inline +int +atomic_intr_handler_is_enabled(atomic_intr_t *p) +{ + int data; + + __asm __volatile("movl %1,%%eax; andl $0x40000000,%%eax" \ + : "=a"(data) : "m"(*p)); + return(data); +} + +static __inline +void +atomic_intr_cond_enter(atomic_intr_t *p, void (*func)(void *), void *arg) +{ + __asm __volatile(MPLOCKED "incl %0; " \ + "1: ;" \ + MPLOCKED "btsl $31,%0; jnc 2f; " \ + "pushl %2; call *%1; addl $4,%%esp; " \ + "jmp 1b; " \ + "2: ;" \ + : "+m" (*p) \ + : "r"(func), "m"(arg) \ + : "ax", "cx", "dx"); +} + +static __inline +void +atomic_intr_cond_exit(atomic_intr_t *p, void (*func)(void *), void *arg) +{ + __asm __volatile(MPLOCKED "decl %0; " \ + MPLOCKED "btrl $31,%0; " \ + "testl $0x3FFFFFFF,%0; jz 1f; " \ + "pushl %2; call *%1; addl $4,%%esp; " \ + "1: ;" \ + : "+m" (*p) \ + : "r"(func), "m"(arg) \ + : "ax", "cx", "dx"); +} + +#endif + #endif /* ! _MACHINE_ATOMIC_H_ */ diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c index d67b71e69e..0e4cda3a58 100644 --- a/sys/dev/acpica/Osd/OsdInterrupt.c +++ b/sys/dev/acpica/Osd/OsdInterrupt.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/Osd/OsdInterrupt.c,v 1.12.6.1 2003/08/22 20:49:21 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdInterrupt.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdInterrupt.c,v 1.2 2005/05/24 20:58:59 dillon Exp $ */ /* @@ -88,8 +88,9 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine device_printf(sc->acpi_dev, "could not allocate SCI interrupt\n"); return_ACPI_STATUS(AE_ALREADY_EXISTS); } - if (bus_setup_intr(sc->acpi_dev, sc->acpi_irq, INTR_TYPE_MISC, (driver_intr_t *)InterruptWrapper, - Context, &sc->acpi_irq_handle)) { + if (bus_setup_intr(sc->acpi_dev, sc->acpi_irq, INTR_TYPE_MISC, + (driver_intr_t *)InterruptWrapper, + Context, &sc->acpi_irq_handle, NULL)) { device_printf(sc->acpi_dev, "could not set up SCI interrupt\n"); return_ACPI_STATUS(AE_ALREADY_EXISTS); } diff --git a/sys/dev/acpica5/Osd/OsdInterrupt.c b/sys/dev/acpica5/Osd/OsdInterrupt.c index 4c7f313f0e..75540f903f 100644 --- a/sys/dev/acpica5/Osd/OsdInterrupt.c +++ b/sys/dev/acpica5/Osd/OsdInterrupt.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/Osd/OsdInterrupt.c,v 1.17 2004/04/14 03:41:06 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/Osd/OsdInterrupt.c,v 1.3 2005/03/12 14:33:40 y0netan1 Exp $ + * $DragonFly: src/sys/dev/acpica5/Osd/OsdInterrupt.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ */ /* @@ -94,7 +94,7 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, goto error; } if (bus_setup_intr(sc->acpi_dev, sc->acpi_irq, INTR_TYPE_MISC, - InterruptWrapper, Context, &sc->acpi_irq_handle)) { + InterruptWrapper, Context, &sc->acpi_irq_handle, NULL)) { device_printf(sc->acpi_dev, "could not set up interrupt\n"); goto error; } diff --git a/sys/dev/crypto/hifn/hifn7751.c b/sys/dev/crypto/hifn/hifn7751.c index 5b6aadad1b..4a843ee9c9 100644 --- a/sys/dev/crypto/hifn/hifn7751.c +++ b/sys/dev/crypto/hifn/hifn7751.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.5.2.5 2003/06/04 17:56:59 sam Exp $ */ -/* $DragonFly: src/sys/dev/crypto/hifn/hifn7751.c,v 1.7 2004/06/02 14:42:48 eirikn Exp $ */ +/* $DragonFly: src/sys/dev/crypto/hifn/hifn7751.c,v 1.8 2005/05/24 20:58:59 dillon Exp $ */ /* $OpenBSD: hifn7751.c,v 1.120 2002/05/17 00:33:34 deraadt Exp $ */ /* @@ -426,7 +426,8 @@ hifn_attach(device_t dev) * so make sure the IRQ is marked appropriately. */ if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET, - hifn_intr, sc, &sc->sc_intrhand)) { + hifn_intr, sc, + &sc->sc_intrhand, NULL)) { device_printf(dev, "could not setup interrupt\n"); goto fail_intr2; } diff --git a/sys/dev/crypto/ubsec/ubsec.c b/sys/dev/crypto/ubsec/ubsec.c index e86b367a94..98db1681b9 100644 --- a/sys/dev/crypto/ubsec/ubsec.c +++ b/sys/dev/crypto/ubsec/ubsec.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.12 2003/06/04 17:56:59 sam Exp $ */ -/* $DragonFly: src/sys/dev/crypto/ubsec/ubsec.c,v 1.6 2004/06/02 14:42:49 eirikn Exp $ */ +/* $DragonFly: src/sys/dev/crypto/ubsec/ubsec.c,v 1.7 2005/05/24 20:58:59 dillon Exp $ */ /* $OpenBSD: ubsec.c,v 1.115 2002/09/24 18:33:26 jason Exp $ */ /* @@ -348,7 +348,8 @@ ubsec_attach(device_t dev) * so make sure the IRQ is mapped appropriately. */ if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET, - ubsec_intr, sc, &sc->sc_ih)) { + ubsec_intr, sc, + &sc->sc_ih, NULL)) { device_printf(dev, "could not establish interrupt\n"); goto bad2; } diff --git a/sys/dev/disk/advansys/adv_eisa.c b/sys/dev/disk/advansys/adv_eisa.c index 4bb856b8d1..44255c5eb4 100644 --- a/sys/dev/disk/advansys/adv_eisa.c +++ b/sys/dev/disk/advansys/adv_eisa.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/advansys/adv_eisa.c,v 1.9.2.1 2000/04/14 13:32:44 nyan Exp $ - * $DragonFly: src/sys/dev/disk/advansys/adv_eisa.c,v 1.3 2003/08/07 21:16:50 dillon Exp $ + * $DragonFly: src/sys/dev/disk/advansys/adv_eisa.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -310,7 +310,7 @@ adv_eisa_attach(device_t dev) /* * Enable our interrupt handler. */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM, adv_intr, adv, &ih); + bus_setup_intr(dev, irq, INTR_TYPE_CAM, adv_intr, adv, &ih, NULL); /* Attach sub-devices - always succeeds */ adv_attach(adv); diff --git a/sys/dev/disk/advansys/adv_isa.c b/sys/dev/disk/advansys/adv_isa.c index 5f1b69aded..b1c605e2d6 100644 --- a/sys/dev/disk/advansys/adv_isa.c +++ b/sys/dev/disk/advansys/adv_isa.c @@ -45,7 +45,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/advansys/adv_isa.c,v 1.14.2.5 2002/01/06 21:21:42 dwmalone Exp $ - * $DragonFly: src/sys/dev/disk/advansys/adv_isa.c,v 1.3 2003/08/07 21:16:50 dillon Exp $ + * $DragonFly: src/sys/dev/disk/advansys/adv_isa.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -323,7 +323,7 @@ adv_isa_probe(device_t dev) RF_ACTIVE); if (irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM, adv_intr, adv, - &ih)) { + &ih, NULL)) { bus_dmamap_unload(overrun_dmat, overrun_dmamap); bus_dmamem_free(overrun_dmat, overrun_buf, overrun_dmamap); diff --git a/sys/dev/disk/advansys/adv_pci.c b/sys/dev/disk/advansys/adv_pci.c index 8e0eb3138f..0df1eb3fd9 100644 --- a/sys/dev/disk/advansys/adv_pci.c +++ b/sys/dev/disk/advansys/adv_pci.c @@ -58,7 +58,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/advansys/adv_pci.c,v 1.11.2.3 2001/06/02 04:38:10 nyan Exp $ - * $DragonFly: src/sys/dev/disk/advansys/adv_pci.c,v 1.3 2003/08/07 21:16:50 dillon Exp $ + * $DragonFly: src/sys/dev/disk/advansys/adv_pci.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -294,7 +294,7 @@ adv_pci_attach(device_t dev) irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &irqrid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM, adv_intr, adv, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM, adv_intr, adv, &ih, NULL)) { adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; diff --git a/sys/dev/disk/advansys/adwcam.c b/sys/dev/disk/advansys/adwcam.c index 7d09573906..9a50f5613f 100644 --- a/sys/dev/disk/advansys/adwcam.c +++ b/sys/dev/disk/advansys/adwcam.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/advansys/adwcam.c,v 1.7.2.2 2001/03/05 13:08:55 obrien Exp $ - * $DragonFly: src/sys/dev/disk/advansys/adwcam.c,v 1.7 2004/09/17 03:39:38 joerg Exp $ + * $DragonFly: src/sys/dev/disk/advansys/adwcam.c,v 1.8 2005/05/24 20:58:59 dillon Exp $ */ /* * Ported from: @@ -1157,7 +1157,7 @@ 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, - adw_intr, adw, &adw->ih)) != 0) { + adw_intr, adw, &adw->ih, NULL)) != 0) { device_printf(adw->device, "bus_setup_intr() failed: %d\n", error); goto fail; diff --git a/sys/dev/disk/aha/aha_isa.c b/sys/dev/disk/aha/aha_isa.c index 676e853438..a1966d29bb 100644 --- a/sys/dev/disk/aha/aha_isa.c +++ b/sys/dev/disk/aha/aha_isa.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aha/aha_isa.c,v 1.17.2.1 2000/08/02 22:24:40 peter Exp $ - * $DragonFly: src/sys/dev/disk/aha/aha_isa.c,v 1.3 2003/08/07 21:16:50 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aha/aha_isa.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -279,7 +279,7 @@ aha_isa_attach(device_t dev) } error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM, aha_intr, aha, - &ih); + &ih, NULL); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); aha_free(aha); diff --git a/sys/dev/disk/aha/aha_mca.c b/sys/dev/disk/aha/aha_mca.c index c88cb14670..3a7b51f706 100644 --- a/sys/dev/disk/aha/aha_mca.c +++ b/sys/dev/disk/aha/aha_mca.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aha/aha_mca.c,v 1.2 2000/01/24 07:08:40 imp Exp $ - * $DragonFly: src/sys/dev/disk/aha/Attic/aha_mca.c,v 1.3 2003/08/07 21:16:50 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aha/Attic/aha_mca.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ * * Based on aha_isa.c */ @@ -202,7 +202,8 @@ aha_mca_attach (device_t dev) goto bad; } - error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, aha_intr, sc, &ih); + error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, aha_intr, sc, + &ih, NULL); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); goto bad; diff --git a/sys/dev/disk/ahb/ahb.c b/sys/dev/disk/ahb/ahb.c index 8c93df4c3a..fb16208324 100644 --- a/sys/dev/disk/ahb/ahb.c +++ b/sys/dev/disk/ahb/ahb.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.18.2.3 2001/03/05 13:08:55 obrien Exp $ - * $DragonFly: src/sys/dev/disk/ahb/ahb.c,v 1.8 2004/09/17 03:39:38 joerg Exp $ + * $DragonFly: src/sys/dev/disk/ahb/ahb.c,v 1.9 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -367,7 +367,7 @@ ahbattach(device_t dev) goto error_exit; /* Enable our interrupt */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM, ahbintr, ahb, &ih); + bus_setup_intr(dev, irq, INTR_TYPE_CAM, ahbintr, ahb, &ih, NULL); return (0); error_exit: diff --git a/sys/dev/disk/aic/aic_cbus.c b/sys/dev/disk/aic/aic_cbus.c index 27c250268c..9f14bf050d 100644 --- a/sys/dev/disk/aic/aic_cbus.c +++ b/sys/dev/disk/aic/aic_cbus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aic/aic_cbus.c,v 1.1.2.2 2000/06/21 09:37:09 nyan Exp $ - * $DragonFly: src/sys/dev/disk/aic/Attic/aic_cbus.c,v 1.4 2003/08/27 10:35:16 rob Exp $ + * $DragonFly: src/sys/dev/disk/aic/Attic/aic_cbus.c,v 1.5 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -234,7 +234,7 @@ aic_isa_attach(device_t dev) } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr, - aic, &sc->sc_ih); + aic, &sc->sc_ih, NULL); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_isa_release_resources(dev); diff --git a/sys/dev/disk/aic/aic_isa.c b/sys/dev/disk/aic/aic_isa.c index afaa179d09..b5f29bddb1 100644 --- a/sys/dev/disk/aic/aic_isa.c +++ b/sys/dev/disk/aic/aic_isa.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aic/aic_isa.c,v 1.3 2000/01/14 23:42:35 imp Exp $ - * $DragonFly: src/sys/dev/disk/aic/aic_isa.c,v 1.4 2003/08/27 10:35:16 rob Exp $ + * $DragonFly: src/sys/dev/disk/aic/aic_isa.c,v 1.5 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -180,7 +180,7 @@ aic_isa_attach(device_t dev) } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr, - aic, &sc->sc_ih); + aic, &sc->sc_ih, NULL); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_isa_release_resources(dev); diff --git a/sys/dev/disk/aic/aic_pccard.c b/sys/dev/disk/aic/aic_pccard.c index f5955e5ad4..9ecaf98c98 100644 --- a/sys/dev/disk/aic/aic_pccard.c +++ b/sys/dev/disk/aic/aic_pccard.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aic/aic_pccard.c,v 1.1 2000/01/14 23:42:36 imp Exp $ - * $DragonFly: src/sys/dev/disk/aic/aic_pccard.c,v 1.5 2004/02/19 15:48:26 joerg Exp $ + * $DragonFly: src/sys/dev/disk/aic/aic_pccard.c,v 1.6 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -163,7 +163,7 @@ aic_pccard_attach(device_t dev) } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr, - aic, &sc->sc_ih); + aic, &sc->sc_ih, NULL); if (error) { device_printf(dev, "failed to register interrupt handler\n"); aic_pccard_release_resources(dev); diff --git a/sys/dev/disk/aic7xxx/aic79xx_osm.c b/sys/dev/disk/aic7xxx/aic79xx_osm.c index 8bb9c18159..ca37222baa 100644 --- a/sys/dev/disk/aic7xxx/aic79xx_osm.c +++ b/sys/dev/disk/aic7xxx/aic79xx_osm.c @@ -32,7 +32,7 @@ * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.c#27 $ * * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.3.2.4 2003/06/10 03:26:07 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.6 2004/09/17 03:39:39 joerg Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.7 2005/05/24 20:58:59 dillon Exp $ */ #include "aic79xx_osm.h" @@ -100,7 +100,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, - &ahd->platform_data->ih); + &ahd->platform_data->ih, NULL); if (error != 0) device_printf(ahd->dev_softc, "bus_setup_intr() failed: %d\n", error); diff --git a/sys/dev/disk/aic7xxx/aic7xxx_osm.c b/sys/dev/disk/aic7xxx/aic7xxx_osm.c index f86cacd4d0..7fca750e8b 100644 --- a/sys/dev/disk/aic7xxx/aic7xxx_osm.c +++ b/sys/dev/disk/aic7xxx/aic7xxx_osm.c @@ -31,7 +31,7 @@ * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.c#13 $ * * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.27.2.6 2003/06/10 03:26:09 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.6 2004/09/17 03:39:39 joerg Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.7 2005/05/24 20:58:59 dillon Exp $ */ #include "aic7xxx_osm.h" @@ -91,7 +91,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, - &ahc->platform_data->ih); + &ahc->platform_data->ih, NULL); if (error != 0) device_printf(ahc->dev_softc, "bus_setup_intr() failed: %d\n", diff --git a/sys/dev/disk/amd/amd.c b/sys/dev/disk/amd/amd.c index 53e7398819..f8ea706efe 100644 --- a/sys/dev/disk/amd/amd.c +++ b/sys/dev/disk/amd/amd.c @@ -31,7 +31,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************* * $FreeBSD: src/sys/pci/amd.c,v 1.3.2.2 2001/06/02 04:32:50 nyan Exp $ - * $DragonFly: src/sys/dev/disk/amd/amd.c,v 1.6 2004/10/20 18:12:54 dillon Exp $ + * $DragonFly: src/sys/dev/disk/amd/amd.c,v 1.7 2005/05/24 20:58:59 dillon Exp $ */ /* @@ -2390,7 +2390,8 @@ amd_attach(device_t dev) irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM, amd_intr, amd, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM, amd_intr, amd, &ih, NULL) + ) { if (bootverbose) printf("amd%d: unable to register interrupt handler!\n", unit); diff --git a/sys/dev/disk/ata/ata-all.c b/sys/dev/disk/ata/ata-all.c index 0f6489903a..ba2595fba3 100644 --- a/sys/dev/disk/ata/ata-all.c +++ b/sys/dev/disk/ata/ata-all.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.50.2.45 2003/03/12 14:47:12 sos Exp $ - * $DragonFly: src/sys/dev/disk/ata/ata-all.c,v 1.23 2005/03/09 02:29:45 drhodus Exp $ + * $DragonFly: src/sys/dev/disk/ata/ata-all.c,v 1.24 2005/05/24 20:58:59 dillon Exp $ */ #include "opt_ata.h" @@ -203,7 +203,7 @@ ata_attach(device_t dev) return ENXIO; } if ((error = bus_setup_intr(dev, ch->r_irq, INTR_TYPE_BIO, - ata_intr, ch, &ch->ih))) { + ata_intr, ch, &ch->ih, NULL))) { ata_printf(ch, -1, "unable to setup interrupt\n"); return error; } diff --git a/sys/dev/disk/ata/ata-pci.c b/sys/dev/disk/ata/ata-pci.c index 2ed243e07b..2b3babe537 100644 --- a/sys/dev/disk/ata/ata-pci.c +++ b/sys/dev/disk/ata/ata-pci.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.32.2.15 2003/06/06 13:27:05 fjoe Exp $ - * $DragonFly: src/sys/dev/disk/ata/ata-pci.c,v 1.19 2005/04/05 22:37:16 dillon Exp $ + * $DragonFly: src/sys/dev/disk/ata/ata-pci.c,v 1.20 2005/05/24 20:58:59 dillon Exp $ */ #include @@ -887,19 +887,19 @@ ata_pci_release_resource(device_t dev, device_t child, int type, int rid, static int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_intr_t *intr, void *arg, - void **cookiep) + void **cookiep, lwkt_serialize_t serializer) { if (ATA_MASTERDEV(dev)) { #ifdef __alpha__ return alpha_platform_setup_ide_intr(irq, intr, arg, cookiep); #else return BUS_SETUP_INTR(device_get_parent(dev), child, irq, - flags, intr, arg, cookiep); + flags, intr, arg, cookiep, serializer); #endif } else return BUS_SETUP_INTR(device_get_parent(dev), dev, irq, - flags, intr, arg, cookiep); + flags, intr, arg, cookiep, serializer); } static int diff --git a/sys/dev/disk/buslogic/bt.c b/sys/dev/disk/buslogic/bt.c index 39edb10845..ae05559e29 100644 --- a/sys/dev/disk/buslogic/bt.c +++ b/sys/dev/disk/buslogic/bt.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/buslogic/bt.c,v 1.25.2.1 2000/08/02 22:32:26 peter Exp $ - * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.7 2004/09/17 03:39:39 joerg Exp $ + * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.8 2005/05/24 20:58:59 dillon Exp $ */ /* @@ -866,7 +866,7 @@ bt_attach(device_t dev) * Setup interrupt. */ error = bus_setup_intr(dev, bt->irq, INTR_TYPE_CAM, - bt_intr, bt, &bt->ih); + bt_intr, bt, &bt->ih, NULL); if (error) { device_printf(dev, "bus_setup_intr() failed: %d\n", error); return (error); diff --git a/sys/dev/disk/ct/ct_isa.c b/sys/dev/disk/ct/ct_isa.c index e6c525d8e8..be0092a8fe 100644 --- a/sys/dev/disk/ct/ct_isa.c +++ b/sys/dev/disk/ct/ct_isa.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ct/ct_isa.c,v 1.3.2.3 2003/06/01 04:26:44 nyan Exp $ */ -/* $DragonFly: src/sys/dev/disk/ct/Attic/ct_isa.c,v 1.5 2004/02/13 01:04:14 joerg Exp $ */ +/* $DragonFly: src/sys/dev/disk/ct/Attic/ct_isa.c,v 1.6 2005/05/24 20:58:59 dillon Exp $ */ /* $NecBSD: ct_isa.c,v 1.6 1999/07/26 06:32:01 honda Exp $ */ /* $NetBSD$ */ @@ -331,7 +331,8 @@ 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)) { + (driver_intr_t *)ctintr, ct, + &ct->sc_ih, NULL)) { ct_space_unmap(dev, ct); return ENXIO; } diff --git a/sys/dev/disk/fd/fd.c b/sys/dev/disk/fd/fd.c index 2215d32a43..fd8b595122 100644 --- a/sys/dev/disk/fd/fd.c +++ b/sys/dev/disk/fd/fd.c @@ -51,7 +51,7 @@ * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 * $FreeBSD: src/sys/isa/fd.c,v 1.176.2.8 2002/05/15 21:56:14 joerg Exp $ - * $DragonFly: src/sys/dev/disk/fd/fd.c,v 1.20 2004/11/12 09:50:38 joerg Exp $ + * $DragonFly: src/sys/dev/disk/fd/fd.c,v 1.21 2005/05/24 20:58:59 dillon Exp $ * */ @@ -797,7 +797,8 @@ fdc_attach(device_t dev) return error; } error = BUS_SETUP_INTR(device_get_parent(dev), dev, fdc->res_irq, - INTR_TYPE_BIO, fdc_intr, fdc, &fdc->fdc_intr); + INTR_TYPE_BIO, fdc_intr, fdc, + &fdc->fdc_intr, NULL); if (error) { device_printf(dev, "cannot setup interrupt\n"); return error; diff --git a/sys/dev/disk/isp/isp_pci.c b/sys/dev/disk/isp/isp_pci.c index c8001e2ed9..47f6c3549d 100644 --- a/sys/dev/disk/isp/isp_pci.c +++ b/sys/dev/disk/isp/isp_pci.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.78.2.4 2002/10/11 18:50:53 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/isp/isp_pci.c,v 1.4 2004/03/15 01:10:43 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/isp/isp_pci.c,v 1.5 2005/05/24 20:58:59 dillon Exp $ */ /* * PCI specific probe and attach routines for Qlogic ISP SCSI adapters. * FreeBSD Version. @@ -642,7 +642,7 @@ isp_pci_attach(device_t dev) isp_debug = 0; (void) getenv_int("isp_debug", &isp_debug); if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, isp_pci_intr, - isp, &pcs->ih)) { + isp, &pcs->ih, NULL)) { device_printf(dev, "could not setup interrupt\n"); goto bad; } diff --git a/sys/dev/disk/mpt/mpt_pci.c b/sys/dev/disk/mpt/mpt_pci.c index 1aa78cbf70..04717aafd2 100644 --- a/sys/dev/disk/mpt/mpt_pci.c +++ b/sys/dev/disk/mpt/mpt_pci.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.3.2.3 2002/09/24 21:37:25 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/mpt/mpt_pci.c,v 1.3 2003/08/07 21:16:53 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/mpt/mpt_pci.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ */ /* * PCI specific probe and attach routines for LSI '909 FC adapters. * FreeBSD Version. @@ -328,7 +328,7 @@ mpt_attach(device_t dev) /* Register the interrupt handler */ if (bus_setup_intr(dev, mpt->pci_irq, MPT_IFLAGS, mpt_pci_intr, - mpt, &mpt->ih)) { + mpt, &mpt->ih, NULL)) { device_printf(dev, "could not setup interrupt\n"); goto bad; } diff --git a/sys/dev/disk/ncr/ncr.c b/sys/dev/disk/ncr/ncr.c index 3552149287..2107db841f 100644 --- a/sys/dev/disk/ncr/ncr.c +++ b/sys/dev/disk/ncr/ncr.c @@ -1,7 +1,7 @@ /************************************************************************** ** ** $FreeBSD: src/sys/pci/ncr.c,v 1.155.2.3 2001/03/05 13:09:10 obrien Exp $ -** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.8 2004/09/17 02:52:39 joerg Exp $ +** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.9 2005/05/24 20:58:59 dillon Exp $ ** ** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family. ** @@ -3772,7 +3772,7 @@ ncr_attach (device_t dev) "interruptless mode: reduced performance.\n"); } else { bus_setup_intr(dev, np->irq_res, INTR_TYPE_CAM, - ncr_intr, np, &np->irq_handle); + ncr_intr, np, &np->irq_handle, NULL); } /* diff --git a/sys/dev/disk/ncv/ncr53c500_pccard.c b/sys/dev/disk/ncv/ncr53c500_pccard.c index 76263909ac..4d7bcef946 100644 --- a/sys/dev/disk/ncv/ncr53c500_pccard.c +++ b/sys/dev/disk/ncv/ncr53c500_pccard.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ncv/ncr53c500_pccard.c,v 1.2.2.5 2001/12/17 13:30:18 non Exp $ */ -/* $DragonFly: src/sys/dev/disk/ncv/ncr53c500_pccard.c,v 1.6 2004/02/19 15:48:26 joerg Exp $ */ +/* $DragonFly: src/sys/dev/disk/ncv/ncr53c500_pccard.c,v 1.7 2005/05/24 20:59:00 dillon Exp $ */ /* $NecBSD: ncr53c500_pisa.c,v 1.28 1998/11/26 01:59:11 honda Exp $ */ /* $NetBSD$ */ @@ -264,7 +264,8 @@ ncv_pccard_attach(DEVPORT_PDEVICE dev) } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM, - ncv_pccard_intr, (void *)sc, &sc->ncv_intrhand); + ncv_pccard_intr, (void *)sc, + &sc->ncv_intrhand, NULL); if (error) { ncv_release_resource(dev); return(error); diff --git a/sys/dev/disk/nsp/nsp_pccard.c b/sys/dev/disk/nsp/nsp_pccard.c index 42bb329c1f..35057d70ca 100644 --- a/sys/dev/disk/nsp/nsp_pccard.c +++ b/sys/dev/disk/nsp/nsp_pccard.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/nsp/nsp_pccard.c,v 1.2.2.6 2001/12/17 13:30:19 non Exp $ */ -/* $DragonFly: src/sys/dev/disk/nsp/nsp_pccard.c,v 1.5 2004/02/19 15:48:26 joerg Exp $ */ +/* $DragonFly: src/sys/dev/disk/nsp/nsp_pccard.c,v 1.6 2005/05/24 20:59:00 dillon Exp $ */ /* $NecBSD: nsp_pisa.c,v 1.4 1999/04/15 01:35:54 kmatsuda Exp $ */ /* $NetBSD$ */ @@ -224,7 +224,8 @@ nsp_pccard_attach(DEVPORT_PDEVICE dev) } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM, - nsp_pccard_intr, (void *)sc, &sc->nsp_intrhand); + nsp_pccard_intr, (void *)sc, + &sc->nsp_intrhand, NULL); if (error) { nsp_release_resource(dev); return(error); diff --git a/sys/dev/disk/stg/tmc18c30_isa.c b/sys/dev/disk/stg/tmc18c30_isa.c index d3615ad0d8..01bfe74113 100644 --- a/sys/dev/disk/stg/tmc18c30_isa.c +++ b/sys/dev/disk/stg/tmc18c30_isa.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/stg/tmc18c30_isa.c,v 1.2.2.4 2001/09/04 04:45:23 non Exp $ */ -/* $DragonFly: src/sys/dev/disk/stg/tmc18c30_isa.c,v 1.5 2004/02/12 00:00:18 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/stg/tmc18c30_isa.c,v 1.6 2005/05/24 20:59:00 dillon Exp $ */ /* $NecBSD: tmc18c30_pisa.c,v 1.22 1998/11/26 01:59:21 honda Exp $ */ /* $NetBSD$ */ @@ -191,7 +191,8 @@ stg_isa_attach(device_t dev) } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM, - stg_isa_intr, (void *)sc, &sc->stg_intrhand); + stg_isa_intr, (void *)sc, + &sc->stg_intrhand, NULL); if (error) { stg_release_resource(dev); return(error); diff --git a/sys/dev/disk/stg/tmc18c30_pccard.c b/sys/dev/disk/stg/tmc18c30_pccard.c index b2caf1f2ec..c285111944 100644 --- a/sys/dev/disk/stg/tmc18c30_pccard.c +++ b/sys/dev/disk/stg/tmc18c30_pccard.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/stg/tmc18c30_pccard.c,v 1.2.2.6 2001/12/17 13:30:19 non Exp $ */ -/* $DragonFly: src/sys/dev/disk/stg/tmc18c30_pccard.c,v 1.6 2004/02/19 15:48:26 joerg Exp $ */ +/* $DragonFly: src/sys/dev/disk/stg/tmc18c30_pccard.c,v 1.7 2005/05/24 20:59:00 dillon Exp $ */ /* $NecBSD: tmc18c30_pisa.c,v 1.22 1998/11/26 01:59:21 honda Exp $ */ /* $NetBSD$ */ @@ -218,7 +218,8 @@ stg_pccard_attach(DEVPORT_PDEVICE dev) } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM, - stg_pccard_intr, (void *)sc, &sc->stg_intrhand); + stg_pccard_intr, (void *)sc, + &sc->stg_intrhand, NULL); if (error) { stg_release_resource(dev); return(error); diff --git a/sys/dev/disk/sym/sym_hipd.c b/sys/dev/disk/sym/sym_hipd.c index 0c40e0b828..1519275320 100644 --- a/sys/dev/disk/sym/sym_hipd.c +++ b/sys/dev/disk/sym/sym_hipd.c @@ -56,7 +56,7 @@ */ /* $FreeBSD: src/sys/dev/sym/sym_hipd.c,v 1.6.2.12 2001/12/02 19:01:10 groudier Exp $ */ -/* $DragonFly: src/sys/dev/disk/sym/sym_hipd.c,v 1.11 2005/01/06 08:33:11 asmodai Exp $ */ +/* $DragonFly: src/sys/dev/disk/sym/sym_hipd.c,v 1.12 2005/05/24 20:59:00 dillon Exp $ */ #define SYM_DRIVER_NAME "sym-1.6.5-20000902" @@ -9630,7 +9630,7 @@ int sym_cam_attach(hcb_p np) */ #ifdef FreeBSD_Bus_Io_Abstraction err = bus_setup_intr(np->device, np->irq_res, INTR_TYPE_CAM, - sym_intr, np, &np->intr); + sym_intr, np, &np->intr, NULL); if (err) { device_printf(np->device, "bus_setup_intr() failed: %d\n", err); diff --git a/sys/dev/disk/trm/trm.c b/sys/dev/disk/trm/trm.c index 3c65ec7800..50eadc3926 100644 --- a/sys/dev/disk/trm/trm.c +++ b/sys/dev/disk/trm/trm.c @@ -45,7 +45,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/trm/trm.c,v 1.2.2.2 2002/12/19 20:34:45 cognet Exp $ - * $DragonFly: src/sys/dev/disk/trm/trm.c,v 1.6 2004/09/17 03:39:39 joerg Exp $ + * $DragonFly: src/sys/dev/disk/trm/trm.c,v 1.7 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -3265,7 +3265,8 @@ trm_attach(device_t pci_config_id) ~0, 1, RF_SHAREABLE | RF_ACTIVE); if (pACB->irq == NULL || bus_setup_intr(pci_config_id, pACB->irq, - INTR_TYPE_CAM, trm_Interrupt, pACB, &pACB->ih)) { + INTR_TYPE_CAM, trm_Interrupt, pACB, + &pACB->ih, NULL)) { printf("trm%d: register Interrupt handler error!\n", unit); goto bad; } diff --git a/sys/dev/drm/drm_dma.h b/sys/dev/drm/drm_dma.h index 2ab7c2fe8d..40cd7ea8d0 100644 --- a/sys/dev/drm/drm_dma.h +++ b/sys/dev/drm/drm_dma.h @@ -29,7 +29,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_dma.h,v 1.5.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_dma.h,v 1.5 2005/02/17 13:59:35 joerg Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_dma.h,v 1.6 2005/05/24 20:59:00 dillon Exp $ */ #include "dev/drm/drmP.h" @@ -208,10 +208,10 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) #if defined(__DragonFly__) || defined(__FreeBSD__) #if defined(__DragonFly__) || __FreeBSD_version < 500000 retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY, - DRM(dma_service), dev, &dev->irqh); + DRM(dma_service), dev, &dev->irqh, NULL); #else retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY | INTR_MPSAFE, - DRM(dma_service), dev, &dev->irqh); + DRM(dma_service), dev, &dev->irqh, NULL); #endif if ( retcode ) { #elif defined(__NetBSD__) diff --git a/sys/dev/misc/atkbd/atkbd_isa.c b/sys/dev/misc/atkbd/atkbd_isa.c index 4a2bacfa69..89fab017a1 100644 --- a/sys/dev/misc/atkbd/atkbd_isa.c +++ b/sys/dev/misc/atkbd/atkbd_isa.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/isa/atkbd_isa.c,v 1.7.2.3 2001/08/01 10:42:28 yokota Exp $ - * $DragonFly: src/sys/dev/misc/atkbd/atkbd_isa.c,v 1.3 2003/08/07 21:16:55 dillon Exp $ + * $DragonFly: src/sys/dev/misc/atkbd/atkbd_isa.c,v 1.4 2005/05/24 20:59:00 dillon Exp $ */ #include "opt_kbd.h" @@ -115,7 +115,7 @@ atkbdattach(device_t dev) sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, irq, irq, 1, RF_SHAREABLE | RF_ACTIVE); BUS_SETUP_INTR(device_get_parent(dev), dev, sc->intr, INTR_TYPE_TTY, - atkbd_isa_intr, kbd, &sc->ih); + atkbd_isa_intr, kbd, &sc->ih, NULL); return 0; } diff --git a/sys/dev/misc/lpt/lpt.c b/sys/dev/misc/lpt/lpt.c index 47498af62b..430cbfb6b1 100644 --- a/sys/dev/misc/lpt/lpt.c +++ b/sys/dev/misc/lpt/lpt.c @@ -49,7 +49,7 @@ * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp * From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp * $FreeBSD: src/sys/dev/ppbus/lpt.c,v 1.15.2.3 2000/07/07 00:30:40 obrien Exp $ - * $DragonFly: src/sys/dev/misc/lpt/lpt.c,v 1.10 2004/09/19 00:23:33 dillon Exp $ + * $DragonFly: src/sys/dev/misc/lpt/lpt.c,v 1.11 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -765,7 +765,7 @@ lptwrite(dev_t dev, struct uio *uio, int ioflag) /* register our interrupt handler */ err = BUS_SETUP_INTR(ppbus, lptdev, sc->intr_resource, INTR_TYPE_TTY, lpt_intr, lptdev, - &sc->intr_cookie); + &sc->intr_cookie, NULL); if (err) { device_printf(lptdev, "handler registration failed, polled mode.\n"); sc->sc_irq &= ~LP_USE_IRQ; diff --git a/sys/dev/misc/mse/mse.c b/sys/dev/misc/mse/mse.c index 7029b2a335..cc4c6c832f 100644 --- a/sys/dev/misc/mse/mse.c +++ b/sys/dev/misc/mse/mse.c @@ -12,7 +12,7 @@ * without express or implied warranty. * * $FreeBSD: src/sys/i386/isa/mse.c,v 1.49.2.1 2000/03/20 13:58:47 yokota Exp $ - * $DragonFly: src/sys/dev/misc/mse/mse.c,v 1.11 2005/01/06 08:33:11 asmodai Exp $ + * $DragonFly: src/sys/dev/misc/mse/mse.c,v 1.12 2005/05/24 20:59:00 dillon Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -350,7 +350,7 @@ mse_attach(dev) sc->sc_ioh = rman_get_bushandle(sc->sc_port); if (BUS_SETUP_INTR(device_get_parent(dev), dev, sc->sc_intr, - INTR_TYPE_TTY, mseintr, sc, &sc->sc_ih)) { + INTR_TYPE_TTY, mseintr, sc, &sc->sc_ih, NULL)) { 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/misc/musycc/musycc.c b/sys/dev/misc/musycc/musycc.c index 793005a19d..8e5c4cba23 100644 --- a/sys/dev/misc/musycc/musycc.c +++ b/sys/dev/misc/musycc/musycc.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/dev/musycc/musycc.c,v 1.17.2.3 2001/03/13 22:05:36 phk Exp $ - * $DragonFly: src/sys/dev/misc/musycc/musycc.c,v 1.5 2004/06/02 14:42:49 eirikn Exp $ + * $DragonFly: src/sys/dev/misc/musycc/musycc.c,v 1.6 2005/05/24 20:59:00 dillon Exp $ * * * @@ -1484,7 +1484,8 @@ musycc_attach(device_t self) } error = bus_setup_intr(self, csc->irq[f], INTR_TYPE_NET, - f == 0 ? musycc_intr0 : musycc_intr1, csc, &csc->intrhand[f]); + (f == 0 ? musycc_intr0 : musycc_intr1), csc, + &csc->intrhand[f], NULL); if (error) { printf("couldn't set up irq\n"); diff --git a/sys/dev/misc/ppc/ppc.c b/sys/dev/misc/ppc/ppc.c index f525962e6d..2086d8d590 100644 --- a/sys/dev/misc/ppc/ppc.c +++ b/sys/dev/misc/ppc/ppc.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/ppc.c,v 1.26.2.5 2001/10/02 05:21:45 nsouch Exp $ - * $DragonFly: src/sys/dev/misc/ppc/ppc.c,v 1.6 2005/02/17 13:59:36 joerg Exp $ + * $DragonFly: src/sys/dev/misc/ppc/ppc.c,v 1.7 2005/05/24 20:59:00 dillon Exp $ * */ @@ -79,7 +79,7 @@ static int ppc_write(device_t, char *, int, int); static u_char ppc_io(device_t, int, u_char *, int, u_char); static int ppc_setup_intr(device_t, device_t, struct resource *, int, - void (*)(void *), void *, void **); + void (*)(void *), void *, void **, lwkt_serialize_t); static int ppc_teardown_intr(device_t, device_t, struct resource *, void *); static device_method_t ppc_methods[] = { @@ -2001,8 +2001,8 @@ ppc_attach(device_t dev) if (ppc->res_irq) { /* default to the tty mask for registration */ /* XXX */ if (BUS_SETUP_INTR(parent, dev, ppc->res_irq, INTR_TYPE_TTY, - ppcintr, dev, &ppc->intr_cookie) == 0) { - + ppcintr, dev, + &ppc->intr_cookie, NULL) == 0) { /* remember the ppcintr is registered */ ppc->ppc_registered = 1; } @@ -2109,7 +2109,8 @@ ppc_read_ivar(device_t bus, device_t dev, int index, uintptr_t *val) */ static int ppc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer) { int error; struct ppc_data *ppc = DEVTOSOFTC(bus); @@ -2131,7 +2132,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, ihand, arg, cookiep, serializer)); } /* @@ -2152,8 +2153,9 @@ 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, ppcintr, bus, + &ppc->intr_cookie, NULL)) + ) { /* remember the ppcintr is registered */ ppc->ppc_registered = 1; } diff --git a/sys/dev/misc/ppi/ppi.c b/sys/dev/misc/ppi/ppi.c index 418e59efd9..53669fb511 100644 --- a/sys/dev/misc/ppi/ppi.c +++ b/sys/dev/misc/ppi/ppi.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/ppi.c,v 1.21.2.3 2000/08/07 18:24:43 peter Exp $ - * $DragonFly: src/sys/dev/misc/ppi/ppi.c,v 1.8 2004/05/19 22:52:43 dillon Exp $ + * $DragonFly: src/sys/dev/misc/ppi/ppi.c,v 1.9 2005/05/24 20:59:00 dillon Exp $ * */ #include "opt_ppb_1284.h" @@ -283,8 +283,10 @@ ppiopen(dev_t dev, int flags, int fmt, d_thread_t *td) #ifdef PERIPH_1284 if (ppi->intr_resource) { /* register our interrupt handler */ - BUS_SETUP_INTR(device_get_parent(ppidev), ppidev, ppi->intr_resource, - INTR_TYPE_TTY, ppiintr, dev, &ppi->intr_cookie); + BUS_SETUP_INTR(device_get_parent(ppidev), ppidev, + ppi->intr_resource, INTR_TYPE_TTY, + ppiintr, dev, + &ppi->intr_cookie, NULL); } #endif /* PERIPH_1284 */ } diff --git a/sys/dev/misc/pps/pps.c b/sys/dev/misc/pps/pps.c index 555c2d0008..f671f605ed 100644 --- a/sys/dev/misc/pps/pps.c +++ b/sys/dev/misc/pps/pps.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/dev/ppbus/pps.c,v 1.24.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/dev/misc/pps/pps.c,v 1.10 2004/05/20 21:44:00 dillon Exp $ + * $DragonFly: src/sys/dev/misc/pps/pps.c,v 1.11 2005/05/24 20:59:00 dillon Exp $ * * This driver implements a draft-mogul-pps-api-02.txt PPS source. * @@ -145,7 +145,7 @@ ppsopen(dev_t dev, int flags, int fmt, struct thread *td) /* attach the interrupt handler */ if ((error = BUS_SETUP_INTR(ppbus, ppsdev, sc->intr_resource, INTR_TYPE_TTY, ppsintr, ppsdev, - &sc->intr_cookie))) { + &sc->intr_cookie, NULL))) { ppb_release_bus(ppbus, ppsdev); return (error); } diff --git a/sys/dev/misc/psm/psm.c b/sys/dev/misc/psm/psm.c index 4e42f4cbb3..48ad09cd59 100644 --- a/sys/dev/misc/psm/psm.c +++ b/sys/dev/misc/psm/psm.c @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/isa/psm.c,v 1.23.2.7 2003/11/12 04:26:26 mikeh Exp $ - * $DragonFly: src/sys/dev/misc/psm/psm.c,v 1.13 2004/09/18 19:08:08 dillon Exp $ + * $DragonFly: src/sys/dev/misc/psm/psm.c,v 1.14 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -1244,7 +1244,7 @@ psmattach(device_t dev) if (sc->intr == NULL) return (ENXIO); error = BUS_SETUP_INTR(device_get_parent(dev), dev, sc->intr, - INTR_TYPE_TTY, psmintr, sc, &sc->ih); + INTR_TYPE_TTY, psmintr, sc, &sc->ih, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, rid, sc->intr); return (error); diff --git a/sys/dev/misc/puc/puc.c b/sys/dev/misc/puc/puc.c index 6d1f4e198d..ca97c1e862 100644 --- a/sys/dev/misc/puc/puc.c +++ b/sys/dev/misc/puc/puc.c @@ -1,7 +1,7 @@ /* * $NetBSD: puc.c,v 1.7 2000/07/29 17:43:38 jlam Exp $ * $FreeBSD: src/sys/dev/puc/puc.c,v 1.3.2.5 2003/04/04 08:42:17 sobomax Exp $ - * $DragonFly: src/sys/dev/misc/puc/puc.c,v 1.6 2004/05/13 19:44:33 dillon Exp $ + * $DragonFly: src/sys/dev/misc/puc/puc.c,v 1.7 2005/05/24 20:59:00 dillon Exp $ */ /*- @@ -139,7 +139,7 @@ static int puc_release_resource(device_t, device_t, int, int, struct resource *); static int puc_get_resource(device_t, device_t, int, int, u_long *, u_long *); static int puc_setup_intr(device_t, device_t, struct resource *, int, - void (*)(void *), void *, void **); + void (*)(void *), void *, void **, lwkt_serialize_t); static int puc_teardown_intr(device_t, device_t, struct resource *, void *); static int puc_read_ivar(device_t, device_t, int, uintptr_t *); @@ -241,13 +241,15 @@ puc_pci_attach(device_t dev) sc->irqrid = rid; #ifdef PUC_FASTINTR irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, - INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->intr_cookie); + INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, + &sc->intr_cookie, NULL); #else irq_setup = ENXIO; #endif if (irq_setup != 0) irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, - INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); + INTR_TYPE_TTY, puc_intr, sc, + &sc->intr_cookie, NULL); if (irq_setup != 0) return (ENXIO); @@ -692,7 +694,8 @@ puc_get_resource(device_t dev, device_t child, int type, int rid, static int puc_setup_intr(device_t dev, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer) { int i; struct puc_softc *sc; @@ -704,6 +707,7 @@ puc_setup_intr(device_t dev, device_t child, struct resource *r, int flags, return (ENXIO); sc->sc_ports[i].ihand = ihand; sc->sc_ports[i].ihandarg = arg; + KKASSERT(serializer == NULL); /* not handled yet XXX */ *cookiep = arg; return (0); } diff --git a/sys/dev/netif/an/if_an_isa.c b/sys/dev/netif/an/if_an_isa.c index d495577537..6f4248a0dc 100644 --- a/sys/dev/netif/an/if_an_isa.c +++ b/sys/dev/netif/an/if_an_isa.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/an/if_an_isa.c,v 1.1.2.5 2003/02/01 03:25:12 ambrisko Exp $ - * $DragonFly: src/sys/dev/netif/an/if_an_isa.c,v 1.7 2005/05/24 08:16:07 joerg Exp $ + * $DragonFly: src/sys/dev/netif/an/if_an_isa.c,v 1.8 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -115,7 +115,7 @@ an_attach_isa(dev) an_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - an_intr, sc, &sc->irq_handle); + an_intr, sc, &sc->irq_handle, NULL); if (error) { an_release_resources(dev); return (error); diff --git a/sys/dev/netif/an/if_an_pccard.c b/sys/dev/netif/an/if_an_pccard.c index b3a4349f07..694191e4e6 100644 --- a/sys/dev/netif/an/if_an_pccard.c +++ b/sys/dev/netif/an/if_an_pccard.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/an/if_an_pccard.c,v 1.1.2.6 2003/02/01 03:25:12 ambrisko Exp $ - * $DragonFly: src/sys/dev/netif/an/if_an_pccard.c,v 1.7 2005/05/24 08:16:07 joerg Exp $ + * $DragonFly: src/sys/dev/netif/an/if_an_pccard.c,v 1.8 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -185,7 +185,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); + an_intr, sc, &sc->irq_handle, NULL); if (error) { goto fail; } diff --git a/sys/dev/netif/an/if_an_pci.c b/sys/dev/netif/an/if_an_pci.c index 9e2c154a0c..02ea86bf73 100644 --- a/sys/dev/netif/an/if_an_pci.c +++ b/sys/dev/netif/an/if_an_pci.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/an/if_an_pci.c,v 1.2.2.8 2003/02/11 03:32:48 ambrisko Exp $ - * $DragonFly: src/sys/dev/netif/an/if_an_pci.c,v 1.8 2005/05/24 08:16:07 joerg Exp $ + * $DragonFly: src/sys/dev/netif/an/if_an_pci.c,v 1.9 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -225,7 +225,7 @@ an_attach_pci(dev) } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - an_intr, sc, &sc->irq_handle); + an_intr, sc, &sc->irq_handle, NULL); if (error) { goto fail; } diff --git a/sys/dev/netif/ar/if_ar.c b/sys/dev/netif/ar/if_ar.c index 7af41f80c6..95cac91d7b 100644 --- a/sys/dev/netif/ar/if_ar.c +++ b/sys/dev/netif/ar/if_ar.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ar/if_ar.c,v 1.66 2005/01/06 01:42:28 imp Exp $ - * $DragonFly: src/sys/dev/netif/ar/if_ar.c,v 1.13 2005/05/24 07:25:06 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ar/if_ar.c,v 1.14 2005/05/24 20:59:00 dillon Exp $ */ /* @@ -256,6 +256,7 @@ ar_attach(device_t device) char *iface; #endif /* NETGRAPH */ int unit; + int error; hc = (struct ar_hardc *)device_get_softc(device); @@ -267,8 +268,10 @@ ar_attach(device_t device) arc_init(hc); - if(BUS_SETUP_INTR(device_get_parent(device), device, hc->res_irq, - INTR_TYPE_NET, arintr, hc, &hc->intr_cookie) != 0) + error = BUS_SETUP_INTR(device_get_parent(device), device, hc->res_irq, + INTR_TYPE_NET, arintr, hc, + &hc->intr_cookie, NULL); + if (error) return (1); sc = hc->sc; diff --git a/sys/dev/netif/awi/if_awi_pccard.c b/sys/dev/netif/awi/if_awi_pccard.c index 276215cfa4..4d4dc7bafe 100644 --- a/sys/dev/netif/awi/if_awi_pccard.c +++ b/sys/dev/netif/awi/if_awi_pccard.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/awi/if_awi_pccard.c,v 1.5.2.1 2000/12/07 04:09:39 imp Exp $ - * $DragonFly: src/sys/dev/netif/awi/Attic/if_awi_pccard.c,v 1.11 2005/05/24 09:52:12 joerg Exp $ + * $DragonFly: src/sys/dev/netif/awi/Attic/if_awi_pccard.c,v 1.12 2005/05/24 20:59:00 dillon Exp $ */ #include @@ -188,7 +188,8 @@ awi_pccard_attach(device_t dev) am79c930_chip_init(&sc->sc_chip, 0); error = bus_setup_intr(dev, psc->sc_irq_res, INTR_TYPE_NET, - (void (*)(void *))awi_intr, sc, &psc->sc_intrhand); + (void (*)(void *))awi_intr, sc, + &psc->sc_intrhand, NULL); if (error) { device_printf(dev, "awi_pccard_attach: intr setup failed\n"); goto fail; diff --git a/sys/dev/netif/bfe/if_bfe.c b/sys/dev/netif/bfe/if_bfe.c index da60f7b527..7004f372ed 100644 --- a/sys/dev/netif/bfe/if_bfe.c +++ b/sys/dev/netif/bfe/if_bfe.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bfe/if_bfe.c 1.4.4.7 2004/03/02 08:41:33 julian Exp v - * $DragonFly: src/sys/dev/netif/bfe/if_bfe.c,v 1.14 2005/05/24 09:52:12 joerg Exp $ + * $DragonFly: src/sys/dev/netif/bfe/if_bfe.c,v 1.15 2005/05/24 20:59:00 dillon Exp $ */ #include @@ -393,7 +393,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, - bfe_intr, sc, &sc->bfe_intrhand); + bfe_intr, sc, &sc->bfe_intrhand, NULL); if (error) { bfe_release_resources(sc); diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index ccaa526fdb..dce5f9882a 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -31,7 +31,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bge/if_bge.c,v 1.3.2.29 2003/12/01 21:06:59 ambrisko Exp $ - * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.34 2005/05/23 07:00:36 joerg Exp $ + * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.35 2005/05/24 20:59:00 dillon Exp $ * */ @@ -1518,7 +1518,7 @@ bge_attach(device_t dev) } error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET, - bge_intr, sc, &sc->bge_intrhand); + bge_intr, sc, &sc->bge_intrhand, NULL); if (error) { bge_release_resources(sc); diff --git a/sys/dev/netif/cm/if_cm_isa.c b/sys/dev/netif/cm/if_cm_isa.c index be83db4fab..f3d3a11490 100644 --- a/sys/dev/netif/cm/if_cm_isa.c +++ b/sys/dev/netif/cm/if_cm_isa.c @@ -1,6 +1,6 @@ /* $NetBSD: if_bah_zbus.c,v 1.6 2000/01/23 21:06:12 aymeric Exp $ */ /* $FreeBSD: src/sys/dev/cm/if_cm_isa.c,v 1.1.2.1 2002/02/13 22:33:41 fjoe Exp $ */ -/* $DragonFly: src/sys/dev/netif/cm/Attic/if_cm_isa.c,v 1.5 2004/01/06 03:17:22 dillon Exp $ */ +/* $DragonFly: src/sys/dev/netif/cm/Attic/if_cm_isa.c,v 1.6 2005/05/24 20:59:01 dillon Exp $ */ /*- * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc. @@ -89,7 +89,7 @@ cm_isa_attach(dev) cm_alloc_irq(dev, sc->irq_rid); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - cmintr, sc, &sc->irq_handle); + cmintr, sc, &sc->irq_handle, NULL); if (error) { cm_release_resources(dev); return (error); diff --git a/sys/dev/netif/cs/if_cs_isa.c b/sys/dev/netif/cs/if_cs_isa.c index ede3fbf705..f60f2c8a84 100644 --- a/sys/dev/netif/cs/if_cs_isa.c +++ b/sys/dev/netif/cs/if_cs_isa.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/cs/if_cs_isa.c,v 1.1.2.1 2001/01/25 20:13:48 imp Exp $ - * $DragonFly: src/sys/dev/netif/cs/if_cs_isa.c,v 1.4 2004/01/06 03:17:22 dillon Exp $ + * $DragonFly: src/sys/dev/netif/cs/if_cs_isa.c,v 1.5 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -96,7 +96,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); + csintr, sc, &sc->irq_handle, NULL); if (error) { cs_release_resources(dev); return (error); diff --git a/sys/dev/netif/cs/if_cs_pccard.c b/sys/dev/netif/cs/if_cs_pccard.c index c9713edc8b..7ab7a06ec5 100644 --- a/sys/dev/netif/cs/if_cs_pccard.c +++ b/sys/dev/netif/cs/if_cs_pccard.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/cs/if_cs_pccard.c,v 1.1.2.1 2001/01/25 20:13:48 imp Exp $ - * $DragonFly: src/sys/dev/netif/cs/if_cs_pccard.c,v 1.5 2004/02/19 14:31:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/cs/if_cs_pccard.c,v 1.6 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -90,7 +90,7 @@ cs_pccard_attach(device_t dev) goto bad; error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - csintr, sc, &sc->irq_handle); + csintr, sc, &sc->irq_handle, NULL); if (error != 0) goto bad; diff --git a/sys/dev/netif/dc/if_dc.c b/sys/dev/netif/dc/if_dc.c index a9eccb7a4e..343d7c51fc 100644 --- a/sys/dev/netif/dc/if_dc.c +++ b/sys/dev/netif/dc/if_dc.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_dc.c,v 1.9.2.45 2003/06/08 14:31:53 mux Exp $ - * $DragonFly: src/sys/dev/netif/dc/if_dc.c,v 1.25 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/dc/if_dc.c,v 1.26 2005/05/24 20:59:01 dillon Exp $ */ /* @@ -1841,7 +1841,7 @@ static int dc_attach(dev) } error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET, - dc_intr, sc, &sc->dc_intrhand); + dc_intr, sc, &sc->dc_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->dc_irq); diff --git a/sys/dev/netif/de/if_de.c b/sys/dev/netif/de/if_de.c index 9ea123833b..0ec3529ff5 100644 --- a/sys/dev/netif/de/if_de.c +++ b/sys/dev/netif/de/if_de.c @@ -1,7 +1,7 @@ /* $NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $ */ /* $FreeBSD: src/sys/pci/if_de.c,v 1.123.2.4 2000/08/04 23:25:09 peter Exp $ */ -/* $DragonFly: src/sys/dev/netif/de/if_de.c,v 1.35 2005/05/24 09:52:13 joerg Exp $ */ +/* $DragonFly: src/sys/dev/netif/de/if_de.c,v 1.36 2005/05/24 20:59:01 dillon Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) @@ -4192,7 +4192,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_rtn, sc, &ih)) { + intr_rtn, sc, &ih, NULL)) { device_printf(dev, "couldn't map interrupt\n"); free((caddr_t) sc->tulip_rxdescs, M_DEVBUF); free((caddr_t) sc->tulip_txdescs, M_DEVBUF); diff --git a/sys/dev/netif/ed/if_ed_cbus.c b/sys/dev/netif/ed/if_ed_cbus.c index 10fdfc34c2..6418ff72f4 100644 --- a/sys/dev/netif/ed/if_ed_cbus.c +++ b/sys/dev/netif/ed/if_ed_cbus.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ed/if_ed_cbus.c,v 1.12 2003/10/31 18:31:58 brooks Exp $ - * $DragonFly: src/sys/dev/netif/ed/Attic/if_ed_cbus.c,v 1.8 2004/10/14 18:31:02 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ed/Attic/if_ed_cbus.c,v 1.9 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -272,7 +272,7 @@ ed_isa_attach(dev) ed_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - edintr, sc, &sc->irq_handle); + edintr, sc, &sc->irq_handle, NULL); if (error) { ed_release_resources(dev); return (error); diff --git a/sys/dev/netif/ed/if_ed_isa.c b/sys/dev/netif/ed/if_ed_isa.c index b78143befd..b74058c590 100644 --- a/sys/dev/netif/ed/if_ed_isa.c +++ b/sys/dev/netif/ed/if_ed_isa.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ed/if_ed_isa.c,v 1.15 2003/10/31 18:31:58 brooks Exp $ - * $DragonFly: src/sys/dev/netif/ed/if_ed_isa.c,v 1.8 2004/10/14 18:31:02 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ed/if_ed_isa.c,v 1.9 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -135,7 +135,7 @@ ed_isa_attach(dev) ed_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - edintr, sc, &sc->irq_handle); + edintr, sc, &sc->irq_handle, NULL); if (error) { ed_release_resources(dev); return (error); diff --git a/sys/dev/netif/ed/if_ed_pccard.c b/sys/dev/netif/ed/if_ed_pccard.c index 58a22b410f..bae040a492 100644 --- a/sys/dev/netif/ed/if_ed_pccard.c +++ b/sys/dev/netif/ed/if_ed_pccard.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.55 2003/12/31 04:25:00 kato Exp $ - * $DragonFly: src/sys/dev/netif/ed/if_ed_pccard.c,v 1.10 2004/10/14 18:31:02 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ed/if_ed_pccard.c,v 1.11 2005/05/24 20:59:01 dillon Exp $ */ #include "opt_ed.h" @@ -259,7 +259,7 @@ ed_pccard_attach(device_t dev) ed_alloc_irq(dev, sc->irq_rid, 0); error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - edintr, sc, &sc->irq_handle); + edintr, sc, &sc->irq_handle, NULL); if (error) { printf("setup intr failed %d \n", error); ed_release_resources(dev); diff --git a/sys/dev/netif/ed/if_ed_pci.c b/sys/dev/netif/ed/if_ed_pci.c index 082f676a21..ccea5c3b5b 100644 --- a/sys/dev/netif/ed/if_ed_pci.c +++ b/sys/dev/netif/ed/if_ed_pci.c @@ -18,7 +18,7 @@ * are met. * * $FreeBSD: src/sys/dev/ed/if_ed_pci.c,v 1.34 2003/10/31 18:31:58 brooks Exp $ - * $DragonFly: src/sys/dev/netif/ed/if_ed_pci.c,v 1.7 2004/10/14 18:31:02 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ed/if_ed_pci.c,v 1.8 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -96,7 +96,7 @@ ed_pci_attach(device_t dev) } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - edintr, sc, &sc->irq_handle); + edintr, sc, &sc->irq_handle, NULL); if (error) { ed_release_resources(dev); return (error); diff --git a/sys/dev/netif/em/if_em.c b/sys/dev/netif/em/if_em.c index e3093e7c10..5b873a2b28 100644 --- a/sys/dev/netif/em/if_em.c +++ b/sys/dev/netif/em/if_em.c @@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ /*$FreeBSD: src/sys/dev/em/if_em.c,v 1.2.2.15 2003/06/09 22:10:15 pdeuskar Exp $*/ -/*$DragonFly: src/sys/dev/netif/em/if_em.c,v 1.30 2005/05/23 18:20:47 dillon Exp $*/ +/*$DragonFly: src/sys/dev/netif/em/if_em.c,v 1.31 2005/05/24 20:59:01 dillon Exp $*/ #include "if_em.h" #include @@ -516,7 +516,7 @@ em_attach(device_t dev) error = bus_setup_intr(dev, adapter->res_interrupt, INTR_TYPE_NET, (void (*)(void *)) em_intr, adapter, - &adapter->int_handler_tag); + &adapter->int_handler_tag, NULL); if (error) { device_printf(dev, "Error registering interrupt handler!\n"); ether_ifdetach(&adapter->interface_data.ac_if); diff --git a/sys/dev/netif/em/if_em.h b/sys/dev/netif/em/if_em.h index b9a8afb69a..3e714a81c8 100644 --- a/sys/dev/netif/em/if_em.h +++ b/sys/dev/netif/em/if_em.h @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ /*$FreeBSD: src/sys/dev/em/if_em.h,v 1.1.2.13 2003/06/09 21:43:41 pdeuskar Exp $*/ -/*$DragonFly: src/sys/dev/netif/em/if_em.h,v 1.8 2004/11/22 00:46:14 dillon Exp $*/ +/*$DragonFly: src/sys/dev/netif/em/if_em.h,v 1.9 2005/05/24 20:59:01 dillon Exp $*/ #ifndef _EM_H_DEFINED_ #define _EM_H_DEFINED_ diff --git a/sys/dev/netif/ep/if_ep_eisa.c b/sys/dev/netif/ep/if_ep_eisa.c index f254b70e49..abe127fcc5 100644 --- a/sys/dev/netif/ep/if_ep_eisa.c +++ b/sys/dev/netif/ep/if_ep_eisa.c @@ -20,7 +20,7 @@ * are met. * * $FreeBSD: src/sys/dev/ep/if_ep_eisa.c,v 1.18 2000/01/14 07:14:00 peter Exp $ - * $DragonFly: src/sys/dev/netif/ep/if_ep_eisa.c,v 1.6 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ep/if_ep_eisa.c,v 1.7 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -232,7 +232,7 @@ ep_eisa_attach(device_t dev) } if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, ep_intr, - sc, &sc->ep_intrhand))) { + sc, &sc->ep_intrhand, NULL))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } diff --git a/sys/dev/netif/ep/if_ep_isa.c b/sys/dev/netif/ep/if_ep_isa.c index 3680a88783..c7b1b05532 100644 --- a/sys/dev/netif/ep/if_ep_isa.c +++ b/sys/dev/netif/ep/if_ep_isa.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ep/if_ep_isa.c,v 1.8.2.1 2000/12/16 03:47:57 nyan Exp $ - * $DragonFly: src/sys/dev/netif/ep/if_ep_isa.c,v 1.4 2003/11/20 22:07:27 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ep/if_ep_isa.c,v 1.5 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -331,7 +331,7 @@ ep_isa_attach (device_t dev) } if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, ep_intr, - sc, &sc->ep_intrhand))) { + sc, &sc->ep_intrhand, NULL))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } diff --git a/sys/dev/netif/ep/if_ep_mca.c b/sys/dev/netif/ep/if_ep_mca.c index 4d2a86bbbd..fd55c3e222 100644 --- a/sys/dev/netif/ep/if_ep_mca.c +++ b/sys/dev/netif/ep/if_ep_mca.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ep/if_ep_mca.c,v 1.2 1999/10/27 06:25:15 mdodd Exp $ - * $DragonFly: src/sys/dev/netif/ep/Attic/if_ep_mca.c,v 1.4 2003/11/20 22:07:27 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ep/Attic/if_ep_mca.c,v 1.5 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -136,7 +136,7 @@ ep_mca_attach (device_t dev) } if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, ep_intr, - sc, &sc->ep_intrhand))) { + sc, &sc->ep_intrhand, NULL))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } diff --git a/sys/dev/netif/ep/if_ep_pccard.c b/sys/dev/netif/ep/if_ep_pccard.c index 9bd9829222..451e629e60 100644 --- a/sys/dev/netif/ep/if_ep_pccard.c +++ b/sys/dev/netif/ep/if_ep_pccard.c @@ -28,7 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ep/if_ep_pccard.c,v 1.12.2.2 2000/08/08 23:55:02 peter Exp $ - * $DragonFly: src/sys/dev/netif/ep/if_ep_pccard.c,v 1.6 2004/03/14 15:36:49 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ep/if_ep_pccard.c,v 1.7 2005/05/24 20:59:01 dillon Exp $ */ /* @@ -213,7 +213,7 @@ ep_pccard_attach(device_t dev) } if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, ep_intr, - sc, &sc->ep_intrhand))) { + sc, &sc->ep_intrhand, NULL))) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); goto bad; } diff --git a/sys/dev/netif/ex/if_ex_isa.c b/sys/dev/netif/ex/if_ex_isa.c index 0220476317..d1b5c51cc2 100644 --- a/sys/dev/netif/ex/if_ex_isa.c +++ b/sys/dev/netif/ex/if_ex_isa.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ex/if_ex_isa.c,v 1.3.2.1 2001/03/05 05:33:20 imp Exp $ - * $DragonFly: src/sys/dev/netif/ex/if_ex_isa.c,v 1.6 2003/11/20 22:07:28 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ex/if_ex_isa.c,v 1.7 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -301,7 +301,8 @@ ex_isa_attach(device_t dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - ex_intr, (void *)sc, &sc->ih); + ex_intr, (void *)sc, + &sc->ih, NULL); if (error) { device_printf(dev, "bus_setup_intr() failed!\n"); goto bad; diff --git a/sys/dev/netif/ex/if_ex_pccard.c b/sys/dev/netif/ex/if_ex_pccard.c index 50e95dfc8e..4d850043be 100644 --- a/sys/dev/netif/ex/if_ex_pccard.c +++ b/sys/dev/netif/ex/if_ex_pccard.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ex/if_ex_pccard.c,v 1.2.2.1 2001/03/05 05:33:20 imp Exp $ - * $DragonFly: src/sys/dev/netif/ex/if_ex_pccard.c,v 1.7 2004/02/19 14:31:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ex/if_ex_pccard.c,v 1.8 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -163,7 +163,7 @@ ex_pccard_attach(device_t dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - ex_intr, (void *)sc, &sc->ih); + ex_intr, (void *)sc, &sc->ih, NULL); if (error) { device_printf(dev, "bus_setup_intr() failed!\n"); goto bad; diff --git a/sys/dev/netif/fe/if_fe.c b/sys/dev/netif/fe/if_fe.c index 304eff9fc5..4c271c450c 100644 --- a/sys/dev/netif/fe/if_fe.c +++ b/sys/dev/netif/fe/if_fe.c @@ -22,7 +22,7 @@ /* * $FreeBSD: src/sys/dev/fe/if_fe.c,v 1.65.2.1 2000/09/22 10:01:47 nyan Exp $ - * $DragonFly: src/sys/dev/netif/fe/if_fe.c,v 1.14 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/fe/if_fe.c,v 1.15 2005/05/24 20:59:01 dillon Exp $ * * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards. * Contributed by M. Sekiguchi. @@ -745,7 +745,7 @@ fe_attach (device_t dev) int b, error; error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - fe_intr, sc, &sc->irq_handle); + fe_intr, sc, &sc->irq_handle, NULL); if (error) { fe_release_resource(dev); return ENXIO; diff --git a/sys/dev/netif/fea/if_fea.c b/sys/dev/netif/fea/if_fea.c index d486d4186c..f0772d5f1f 100644 --- a/sys/dev/netif/fea/if_fea.c +++ b/sys/dev/netif/fea/if_fea.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pdq/if_fea.c,v 1.19 2000/01/14 07:14:03 peter Exp $ - * $DragonFly: src/sys/dev/netif/fea/Attic/if_fea.c,v 1.7 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/fea/Attic/if_fea.c,v 1.8 2005/05/24 20:59:01 dillon Exp $ */ /* @@ -217,7 +217,7 @@ pdq_eisa_attach (dev) goto bad; } - if (bus_setup_intr(dev, irq, INTR_TYPE_NET, pdq_eisa_intr, dev, &ih)) { + if (bus_setup_intr(dev, irq, INTR_TYPE_NET, pdq_eisa_intr, dev, &ih, NULL)) { goto bad; } diff --git a/sys/dev/netif/fxp/if_fxp.c b/sys/dev/netif/fxp/if_fxp.c index ddcf76058b..5bb3acaa6c 100644 --- a/sys/dev/netif/fxp/if_fxp.c +++ b/sys/dev/netif/fxp/if_fxp.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.110.2.30 2003/06/12 16:47:05 mux Exp $ - * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.25 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.26 2005/05/24 20:59:01 dillon Exp $ */ /* @@ -464,7 +464,7 @@ fxp_attach(device_t dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - fxp_intr, sc, &sc->ih); + fxp_intr, sc, &sc->ih, NULL); if (error) { device_printf(dev, "could not setup irq\n"); goto fail; diff --git a/sys/dev/netif/gx/if_gx.c b/sys/dev/netif/gx/if_gx.c index f20a97fe30..53dfe3f9f2 100644 --- a/sys/dev/netif/gx/if_gx.c +++ b/sys/dev/netif/gx/if_gx.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/gx/if_gx.c,v 1.2.2.3 2001/12/14 19:51:39 jlemon Exp $ - * $DragonFly: src/sys/dev/netif/gx/Attic/if_gx.c,v 1.14 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/gx/Attic/if_gx.c,v 1.15 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -302,7 +302,7 @@ gx_attach(device_t dev) } error = bus_setup_intr(dev, gx->gx_irq, INTR_TYPE_NET, - gx_intr, gx, &gx->gx_intrhand); + gx_intr, gx, &gx->gx_intrhand, NULL); if (error) { device_printf(dev, "couldn't setup irq\n"); goto fail; diff --git a/sys/dev/netif/ipw/if_ipw.c b/sys/dev/netif/ipw/if_ipw.c index adbe7cd75f..1e08a5643c 100644 --- a/sys/dev/netif/ipw/if_ipw.c +++ b/sys/dev/netif/ipw/if_ipw.c @@ -26,7 +26,7 @@ * * * $Id: if_ipw.c,v 1.7.2.1 2005/01/13 20:01:03 damien Exp $ - * $DragonFly: src/sys/dev/netif/ipw/Attic/if_ipw.c,v 1.5 2005/03/09 20:07:45 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ipw/Attic/if_ipw.c,v 1.6 2005/05/24 20:59:01 dillon Exp $ */ /*- @@ -359,7 +359,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); + ipw_intr, sc, &sc->sc_ih, NULL); if (error != 0) { device_printf(dev, "could not set up interrupt\n"); goto fail; diff --git a/sys/dev/netif/iwi/if_iwi.c b/sys/dev/netif/iwi/if_iwi.c index 6aec764232..9f66949d84 100644 --- a/sys/dev/netif/iwi/if_iwi.c +++ b/sys/dev/netif/iwi/if_iwi.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/iwi/if_iwi.c,v 1.2 2005/03/07 10:13:22 joerg Exp $ + * $DragonFly: src/sys/dev/netif/iwi/if_iwi.c,v 1.3 2005/05/24 20:59:01 dillon Exp $ */ #include "opt_inet.h" @@ -437,7 +437,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); + iwi_intr, sc, &sc->sc_ih, NULL); if (error != 0) { device_printf(dev, "could not set up interrupt\n"); goto fail; diff --git a/sys/dev/netif/lge/if_lge.c b/sys/dev/netif/lge/if_lge.c index 040a6d91fa..191bf94d3e 100644 --- a/sys/dev/netif/lge/if_lge.c +++ b/sys/dev/netif/lge/if_lge.c @@ -31,7 +31,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/lge/if_lge.c,v 1.5.2.2 2001/12/14 19:49:23 jlemon Exp $ - * $DragonFly: src/sys/dev/netif/lge/if_lge.c,v 1.24 2005/05/24 11:42:07 joerg Exp $ + * $DragonFly: src/sys/dev/netif/lge/if_lge.c,v 1.25 2005/05/24 20:59:01 dillon Exp $ */ /* @@ -510,7 +510,7 @@ lge_attach(device_t dev) } error = bus_setup_intr(dev, sc->lge_irq, INTR_TYPE_NET, - lge_intr, sc, &sc->lge_intrhand); + lge_intr, sc, &sc->lge_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->lge_irq); diff --git a/sys/dev/netif/lnc/if_lnc_isa.c b/sys/dev/netif/lnc/if_lnc_isa.c index cb0de46359..8b67f7818e 100644 --- a/sys/dev/netif/lnc/if_lnc_isa.c +++ b/sys/dev/netif/lnc/if_lnc_isa.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/lnc/if_lnc_isa.c,v 1.12 2001/07/04 13:00:19 nyan Exp $ - * $DragonFly: src/sys/dev/netif/lnc/if_lnc_isa.c,v 1.3 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/lnc/if_lnc_isa.c,v 1.4 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -173,7 +173,7 @@ lnc_isa_attach(device_t dev) } err = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET, lncintr, - sc, &sc->intrhand); + sc, &sc->intrhand, NULL); if (err) { device_printf(dev, "Failed to setup irq handler\n"); diff --git a/sys/dev/netif/lnc/if_lnc_pci.c b/sys/dev/netif/lnc/if_lnc_pci.c index d2131f3ed7..4858aec970 100644 --- a/sys/dev/netif/lnc/if_lnc_pci.c +++ b/sys/dev/netif/lnc/if_lnc_pci.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/lnc/if_lnc_pci.c,v 1.25 2001/07/04 13:00:19 nyan Exp $ - * $DragonFly: src/sys/dev/netif/lnc/if_lnc_pci.c,v 1.4 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/lnc/if_lnc_pci.c,v 1.5 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -117,7 +117,7 @@ lnc_pci_attach(device_t dev) device_printf(dev, "Cannot allocate irq\n"); err = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET, lncintr, - sc, &sc->intrhand); + sc, &sc->intrhand, NULL); if (err) device_printf(dev, "Cannot setup irq handler\n"); diff --git a/sys/dev/netif/mn/if_mn.c b/sys/dev/netif/mn/if_mn.c index 3466e28485..83b22fa28e 100644 --- a/sys/dev/netif/mn/if_mn.c +++ b/sys/dev/netif/mn/if_mn.c @@ -22,7 +22,7 @@ * this gadget. * * $FreeBSD: src/sys/pci/if_mn.c,v 1.11.2.3 2001/01/23 12:47:09 phk Exp $ - * $DragonFly: src/sys/dev/netif/mn/if_mn.c,v 1.8 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/mn/if_mn.c,v 1.9 2005/05/24 20:59:01 dillon Exp $ */ /* @@ -1348,7 +1348,8 @@ mn_attach (device_t self) return(ENXIO); } - error = bus_setup_intr(self, sc->irq, INTR_TYPE_NET, mn_intr, sc, &sc->intrhand); + error = bus_setup_intr(self, sc->irq, INTR_TYPE_NET, mn_intr, sc, + &sc->intrhand, NULL); if (error) { printf("couldn't set up irq\n"); diff --git a/sys/dev/netif/my/if_my.c b/sys/dev/netif/my/if_my.c index 7c1898408f..2668c8cf29 100644 --- a/sys/dev/netif/my/if_my.c +++ b/sys/dev/netif/my/if_my.c @@ -26,7 +26,7 @@ * Written by: yen_cw@myson.com.tw available at: http://www.myson.com.tw/ * * $FreeBSD: src/sys/dev/my/if_my.c,v 1.2.2.4 2002/04/17 02:05:27 julian Exp $ - * $DragonFly: src/sys/dev/netif/my/if_my.c,v 1.17 2005/05/24 09:52:13 joerg Exp $ + * $DragonFly: src/sys/dev/netif/my/if_my.c,v 1.18 2005/05/24 20:59:01 dillon Exp $ * * Myson fast ethernet PCI NIC driver * @@ -935,7 +935,7 @@ my_attach(device_t dev) goto fail; } error = bus_setup_intr(dev, sc->my_irq, INTR_TYPE_NET, - my_intr, sc, &sc->my_intrhand); + my_intr, sc, &sc->my_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->my_irq); diff --git a/sys/dev/netif/ndis/if_ndis.c b/sys/dev/netif/ndis/if_ndis.c index 447d989800..514c166def 100644 --- a/sys/dev/netif/ndis/if_ndis.c +++ b/sys/dev/netif/ndis/if_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.65 2004/07/07 17:46:30 wpaul Exp $ - * $DragonFly: src/sys/dev/netif/ndis/if_ndis.c,v 1.4 2005/02/19 00:55:44 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ndis/if_ndis.c,v 1.5 2005/05/24 20:59:01 dillon Exp $ */ #include @@ -382,7 +382,8 @@ ndis_attach(dev) */ error = bus_setup_intr(dev, sc->ndis_irq, INTR_TYPE_NET | INTR_MPSAFE, - ndis_intr, sc, &sc->ndis_intrhand); + ndis_intr, sc, + &sc->ndis_intrhand, NULL); if (error) { device_printf(dev, "couldn't set up irq\n"); diff --git a/sys/dev/netif/nge/if_nge.c b/sys/dev/netif/nge/if_nge.c index 1c216d61b3..b517942857 100644 --- a/sys/dev/netif/nge/if_nge.c +++ b/sys/dev/netif/nge/if_nge.c @@ -31,7 +31,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/nge/if_nge.c,v 1.13.2.13 2003/02/05 22:03:57 mbr Exp $ - * $DragonFly: src/sys/dev/netif/nge/if_nge.c,v 1.22 2005/05/24 16:46:26 joerg Exp $ + * $DragonFly: src/sys/dev/netif/nge/if_nge.c,v 1.23 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -809,7 +809,7 @@ nge_attach(device_t dev) } error = bus_setup_intr(dev, sc->nge_irq, INTR_TYPE_NET, - nge_intr, sc, &sc->nge_intrhand); + nge_intr, sc, &sc->nge_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->nge_irq); diff --git a/sys/dev/netif/nv/if_nv.c b/sys/dev/netif/nv/if_nv.c index 5547219766..676b2dd8c1 100644 --- a/sys/dev/netif/nv/if_nv.c +++ b/sys/dev/netif/nv/if_nv.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $Id: if_nv.c,v 1.20 2005/03/12 01:11:00 q Exp $ - * $DragonFly: src/sys/dev/netif/nv/Attic/if_nv.c,v 1.11 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/nv/Attic/if_nv.c,v 1.12 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -502,7 +502,7 @@ nv_attach(device_t dev) /* Activate our interrupt handler. - attach last to avoid lock */ error = bus_setup_intr(sc->dev, sc->irq, INTR_TYPE_NET, - nv_intr, sc, &sc->sc_ih); + nv_intr, sc, &sc->sc_ih, NULL); if (error) { device_printf(sc->dev, "couldn't set up interrupt handler\n"); goto fail; diff --git a/sys/dev/netif/owi/if_owi.c b/sys/dev/netif/owi/if_owi.c index 06b4a527b2..ded4e73b06 100644 --- a/sys/dev/netif/owi/if_owi.c +++ b/sys/dev/netif/owi/if_owi.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/wi/if_wi.c,v 1.103.2.2 2002/08/02 07:11:34 imp Exp $ - * $DragonFly: src/sys/dev/netif/owi/Attic/if_owi.c,v 1.5 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/owi/Attic/if_owi.c,v 1.6 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -229,7 +229,7 @@ owi_generic_attach(device_t dev) callout_init(&sc->wi_stat_timer); error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - wi_intr, sc, &sc->wi_intrhand); + wi_intr, sc, &sc->wi_intrhand, NULL); if (error) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); diff --git a/sys/dev/netif/pcn/if_pcn.c b/sys/dev/netif/pcn/if_pcn.c index 722c8d2160..3b83b2737d 100644 --- a/sys/dev/netif/pcn/if_pcn.c +++ b/sys/dev/netif/pcn/if_pcn.c @@ -31,7 +31,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_pcn.c,v 1.5.2.10 2003/03/05 18:42:33 njl Exp $ - * $DragonFly: src/sys/dev/netif/pcn/if_pcn.c,v 1.18 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/pcn/if_pcn.c,v 1.19 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -576,7 +576,7 @@ static int pcn_attach(dev) } error = bus_setup_intr(dev, sc->pcn_irq, INTR_TYPE_NET, - pcn_intr, sc, &sc->pcn_intrhand); + pcn_intr, sc, &sc->pcn_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->pcn_res); diff --git a/sys/dev/netif/plip/if_plip.c b/sys/dev/netif/plip/if_plip.c index 12f6292525..5da7de65df 100644 --- a/sys/dev/netif/plip/if_plip.c +++ b/sys/dev/netif/plip/if_plip.c @@ -25,7 +25,7 @@ * * From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp * $FreeBSD: src/sys/dev/ppbus/if_plip.c,v 1.19.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/dev/netif/plip/if_plip.c,v 1.10 2005/02/19 17:59:38 joerg Exp $ + * $DragonFly: src/sys/dev/netif/plip/if_plip.c,v 1.11 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -346,8 +346,9 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) } /* attach our interrupt handler, later detached when the bus is released */ - if ((error = BUS_SETUP_INTR(ppbus, dev, sc->res_irq, - INTR_TYPE_NET, lp_intr, dev, &ih))) { + error = BUS_SETUP_INTR(ppbus, dev, sc->res_irq, INTR_TYPE_NET, + lp_intr, dev, &ih, NULL); + if (error) { ppb_release_bus(ppbus, dev); return (error); } diff --git a/sys/dev/netif/ray/if_ray.c b/sys/dev/netif/ray/if_ray.c index 6c03ffe831..d181991eb6 100644 --- a/sys/dev/netif/ray/if_ray.c +++ b/sys/dev/netif/ray/if_ray.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ray/if_ray.c,v 1.47.2.4 2001/08/14 22:54:05 dmlb Exp $ - * $DragonFly: src/sys/dev/netif/ray/Attic/if_ray.c,v 1.18 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ray/Attic/if_ray.c,v 1.19 2005/05/24 20:59:02 dillon Exp $ * */ @@ -3741,8 +3741,9 @@ ray_res_alloc_irq(struct ray_softc *sc) RAY_PRINTF(sc, "Cannot allocate irq"); return (ENOMEM); } - if ((error = bus_setup_intr(sc->dev, sc->irq_res, INTR_TYPE_NET, - ray_intr, sc, &sc->irq_handle)) != 0) { + error = bus_setup_intr(sc->dev, sc->irq_res, INTR_TYPE_NET, + ray_intr, sc, &sc->irq_handle, NULL); + if (error) { RAY_PRINTF(sc, "Failed to setup irq"); return (error); } diff --git a/sys/dev/netif/re/if_re.c b/sys/dev/netif/re/if_re.c index bcca8f522e..7b5a7c1467 100644 --- a/sys/dev/netif/re/if_re.c +++ b/sys/dev/netif/re/if_re.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $ - * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.10 2005/02/20 00:36:23 joerg Exp $ + * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.11 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -1166,7 +1166,7 @@ re_attach(device_t dev) /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->re_irq, INTR_TYPE_NET, re_intr, sc, - &sc->re_intrhand); + &sc->re_intrhand, NULL); if (error) { device_printf(dev, "couldn't set up irq\n"); diff --git a/sys/dev/netif/rl/if_rl.c b/sys/dev/netif/rl/if_rl.c index 1fb1d645b5..2f2ac8c4ee 100644 --- a/sys/dev/netif/rl/if_rl.c +++ b/sys/dev/netif/rl/if_rl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_rl.c,v 1.38.2.16 2003/03/05 18:42:33 njl Exp $ - * $DragonFly: src/sys/dev/netif/rl/if_rl.c,v 1.20 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/rl/if_rl.c,v 1.21 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -937,7 +937,7 @@ rl_attach(device_t dev) ether_ifattach(ifp, eaddr); error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET, rl_intr, - sc, &sc->rl_intrhand); + sc, &sc->rl_intrhand, NULL); if (error) { device_printf(dev, "couldn't set up irq\n"); diff --git a/sys/dev/netif/sbni/if_sbni_isa.c b/sys/dev/netif/sbni/if_sbni_isa.c index fee330c9e0..cbbe132e0c 100644 --- a/sys/dev/netif/sbni/if_sbni_isa.c +++ b/sys/dev/netif/sbni/if_sbni_isa.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sbni/if_sbni_isa.c,v 1.1.2.5 2002/08/11 09:32:00 fjoe Exp $ - * $DragonFly: src/sys/dev/netif/sbni/Attic/if_sbni_isa.c,v 1.5 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sbni/Attic/if_sbni_isa.c,v 1.6 2005/05/24 20:59:02 dillon Exp $ */ @@ -121,9 +121,9 @@ sbni_attach_isa(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); + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, + sbni_intr, sc, + &sc->irq_handle, NULL); if (error) { printf("sbni%d: bus_setup_intr\n", next_sbni_unit); bus_release_resource( diff --git a/sys/dev/netif/sbni/if_sbni_pci.c b/sys/dev/netif/sbni/if_sbni_pci.c index 03b0f65795..633cd5c79d 100644 --- a/sys/dev/netif/sbni/if_sbni_pci.c +++ b/sys/dev/netif/sbni/if_sbni_pci.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sbni/if_sbni_pci.c,v 1.1.2.4 2002/08/11 09:32:00 fjoe Exp $ - * $DragonFly: src/sys/dev/netif/sbni/if_sbni_pci.c,v 1.5 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sbni/if_sbni_pci.c,v 1.6 2005/05/24 20:59:02 dillon Exp $ */ @@ -138,7 +138,8 @@ 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); + sbni_intr, sc, + &sc->irq_handle, NULL); if (error) { printf("sbni%d: bus_setup_intr\n", next_sbni_unit); goto attach_failed; diff --git a/sys/dev/netif/sbsh/if_sbsh.c b/sys/dev/netif/sbsh/if_sbsh.c index e729463075..98f0edc308 100644 --- a/sys/dev/netif/sbsh/if_sbsh.c +++ b/sys/dev/netif/sbsh/if_sbsh.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sbsh/if_sbsh.c,v 1.3.2.1 2003/04/15 18:15:07 fjoe Exp $ - * $DragonFly: src/sys/dev/netif/sbsh/if_sbsh.c,v 1.16 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sbsh/if_sbsh.c,v 1.17 2005/05/24 20:59:02 dillon Exp $ */ #include @@ -254,7 +254,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); + sbsh_intr, sc, &sc->intr_hand, NULL); 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/netif/sf/if_sf.c b/sys/dev/netif/sf/if_sf.c index 095a988e5c..cca838b83a 100644 --- a/sys/dev/netif/sf/if_sf.c +++ b/sys/dev/netif/sf/if_sf.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_sf.c,v 1.18.2.8 2001/12/16 15:46:07 luigi Exp $ - * $DragonFly: src/sys/dev/netif/sf/if_sf.c,v 1.17 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sf/if_sf.c,v 1.18 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -756,7 +756,7 @@ static int sf_attach(dev) } error = bus_setup_intr(dev, sc->sf_irq, INTR_TYPE_NET, - sf_intr, sc, &sc->sf_intrhand); + sf_intr, sc, &sc->sf_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sf_res); diff --git a/sys/dev/netif/sis/if_sis.c b/sys/dev/netif/sis/if_sis.c index 09c9dc52fc..654b8ae533 100644 --- a/sys/dev/netif/sis/if_sis.c +++ b/sys/dev/netif/sis/if_sis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_sis.c,v 1.13.4.24 2003/03/05 18:42:33 njl Exp $ - * $DragonFly: src/sys/dev/netif/sis/if_sis.c,v 1.21 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sis/if_sis.c,v 1.22 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -1306,7 +1306,8 @@ sis_attach(device_t dev) ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); error = bus_setup_intr(dev, sc->sis_irq, INTR_TYPE_NET, - sis_intr, sc, &sc->sis_intrhand); + sis_intr, sc, + &sc->sis_intrhand, NULL); if (error) { device_printf(dev, "couldn't set up irq\n"); diff --git a/sys/dev/netif/sk/if_sk.c b/sys/dev/netif/sk/if_sk.c index fee7b4500e..7cc02f64bc 100644 --- a/sys/dev/netif/sk/if_sk.c +++ b/sys/dev/netif/sk/if_sk.c @@ -32,7 +32,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_sk.c,v 1.19.2.9 2003/03/05 18:42:34 njl Exp $ - * $DragonFly: src/sys/dev/netif/sk/if_sk.c,v 1.27 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sk/if_sk.c,v 1.28 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -1639,7 +1639,8 @@ static int skc_attach(dev) } error = bus_setup_intr(dev, sc->sk_irq, INTR_TYPE_NET, - sk_intr, sc, &sc->sk_intrhand); + sk_intr, sc, + &sc->sk_intrhand, NULL); if (error) { printf("skc%d: couldn't set up irq\n", unit); diff --git a/sys/dev/netif/sn/if_sn.c b/sys/dev/netif/sn/if_sn.c index 8092f28fd0..454c03bdcd 100644 --- a/sys/dev/netif/sn/if_sn.c +++ b/sys/dev/netif/sn/if_sn.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sn/if_sn.c,v 1.7.2.3 2001/02/04 04:38:38 toshi Exp $ - * $DragonFly: src/sys/dev/netif/sn/if_sn.c,v 1.14 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sn/if_sn.c,v 1.15 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -1251,8 +1251,9 @@ sn_activate(device_t dev) sn_deactivate(dev); return ENOMEM; } - if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, sn_intr, sc, - &sc->intrhand)) != 0) { + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, sn_intr, sc, + &sc->intrhand, NULL); + if (err) { sn_deactivate(dev); return err; } diff --git a/sys/dev/netif/snc/if_snc_cbus.c b/sys/dev/netif/snc/if_snc_cbus.c index 92bfcbd792..620851ac7d 100644 --- a/sys/dev/netif/snc/if_snc_cbus.c +++ b/sys/dev/netif/snc/if_snc_cbus.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/snc/if_snc_cbus.c,v 1.1.2.1 2000/10/21 03:30:03 nyan Exp $ - * $DragonFly: src/sys/dev/netif/snc/Attic/if_snc_cbus.c,v 1.4 2003/08/27 09:38:32 rob Exp $ + * $DragonFly: src/sys/dev/netif/snc/Attic/if_snc_cbus.c,v 1.5 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -194,7 +194,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); + sncintr, sc, &sc->irq_handle, NULL); if (error) { printf("snc_isa_attach: bus_setup_intr() failed\n"); snc_release_resources(dev); diff --git a/sys/dev/netif/snc/if_snc_pccard.c b/sys/dev/netif/snc/if_snc_pccard.c index 4e2b2e984b..1093e24422 100644 --- a/sys/dev/netif/snc/if_snc_pccard.c +++ b/sys/dev/netif/snc/if_snc_pccard.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/snc/if_snc_pccard.c,v 1.1.2.1 2000/10/21 03:30:03 nyan Exp $ - * $DragonFly: src/sys/dev/netif/snc/Attic/if_snc_pccard.c,v 1.5 2004/02/13 22:12:34 joerg Exp $ + * $DragonFly: src/sys/dev/netif/snc/Attic/if_snc_pccard.c,v 1.6 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -145,7 +145,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); + sncintr, sc, &sc->irq_handle, NULL); if (error) { printf("snc_isa_attach: bus_setup_intr() failed\n"); snc_release_resources(dev); diff --git a/sys/dev/netif/sr/if_sr.c b/sys/dev/netif/sr/if_sr.c index f3b177e302..20fca5e350 100644 --- a/sys/dev/netif/sr/if_sr.c +++ b/sys/dev/netif/sr/if_sr.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sr/if_sr.c,v 1.48.2.1 2002/06/17 15:10:58 jhay Exp $ - * $DragonFly: src/sys/dev/netif/sr/if_sr.c,v 1.13 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/sr/if_sr.c,v 1.14 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -399,7 +399,8 @@ sr_attach(device_t device) sr_init_sca(hc); if (BUS_SETUP_INTR(device_get_parent(device), device, hc->res_irq, - INTR_TYPE_NET, srintr, hc, &hc->intr_cookie) != 0) + INTR_TYPE_NET, srintr, hc, + &hc->intr_cookie, NULL) != 0) goto errexit; /* diff --git a/sys/dev/netif/ste/if_ste.c b/sys/dev/netif/ste/if_ste.c index 38d4408fcf..259b1b69d0 100644 --- a/sys/dev/netif/ste/if_ste.c +++ b/sys/dev/netif/ste/if_ste.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_ste.c,v 1.14.2.9 2003/02/05 22:03:57 mbr Exp $ - * $DragonFly: src/sys/dev/netif/ste/if_ste.c,v 1.17 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ste/if_ste.c,v 1.18 2005/05/24 20:59:02 dillon Exp $ */ #include @@ -994,7 +994,7 @@ static int ste_attach(dev) } error = bus_setup_intr(dev, sc->ste_irq, INTR_TYPE_NET, - ste_intr, sc, &sc->ste_intrhand); + ste_intr, sc, &sc->ste_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ste_irq); diff --git a/sys/dev/netif/ti/if_ti.c b/sys/dev/netif/ti/if_ti.c index b050f128d8..d6b8a6b3b1 100644 --- a/sys/dev/netif/ti/if_ti.c +++ b/sys/dev/netif/ti/if_ti.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_ti.c,v 1.25.2.14 2002/02/15 04:20:20 silby Exp $ - * $DragonFly: src/sys/dev/netif/ti/if_ti.c,v 1.20 2005/05/24 09:52:14 joerg Exp $ + * $DragonFly: src/sys/dev/netif/ti/if_ti.c,v 1.21 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -1570,7 +1570,7 @@ static int ti_attach(dev) } error = bus_setup_intr(dev, sc->ti_irq, INTR_TYPE_NET, - ti_intr, sc, &sc->ti_intrhand); + ti_intr, sc, &sc->ti_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq); diff --git a/sys/dev/netif/tl/if_tl.c b/sys/dev/netif/tl/if_tl.c index f56b586fbc..9f0f8670c0 100644 --- a/sys/dev/netif/tl/if_tl.c +++ b/sys/dev/netif/tl/if_tl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_tl.c,v 1.51.2.5 2001/12/16 15:46:08 luigi Exp $ - * $DragonFly: src/sys/dev/netif/tl/if_tl.c,v 1.18 2005/05/24 09:52:15 joerg Exp $ + * $DragonFly: src/sys/dev/netif/tl/if_tl.c,v 1.19 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -1209,7 +1209,7 @@ static int tl_attach(dev) } error = bus_setup_intr(dev, sc->tl_irq, INTR_TYPE_NET, - tl_intr, sc, &sc->tl_intrhand); + tl_intr, sc, &sc->tl_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->tl_irq); diff --git a/sys/dev/netif/tx/if_tx.c b/sys/dev/netif/tx/if_tx.c index 38a83d551e..99cccdaa9e 100644 --- a/sys/dev/netif/tx/if_tx.c +++ b/sys/dev/netif/tx/if_tx.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/tx/if_tx.c,v 1.61.2.1 2002/10/29 01:43:49 semenu Exp $ - * $DragonFly: src/sys/dev/netif/tx/if_tx.c,v 1.17 2005/05/24 09:52:15 joerg Exp $ + * $DragonFly: src/sys/dev/netif/tx/if_tx.c,v 1.18 2005/05/24 20:59:02 dillon Exp $ */ /* @@ -287,7 +287,7 @@ epic_attach(dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - epic_intr, sc, &sc->sc_ih); + epic_intr, sc, &sc->sc_ih, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); diff --git a/sys/dev/netif/txp/if_txp.c b/sys/dev/netif/txp/if_txp.c index 35ccc49bea..a8109142aa 100644 --- a/sys/dev/netif/txp/if_txp.c +++ b/sys/dev/netif/txp/if_txp.c @@ -1,6 +1,6 @@ /* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ /* $FreeBSD: src/sys/dev/txp/if_txp.c,v 1.4.2.4 2001/12/14 19:50:43 jlemon Exp $ */ -/* $DragonFly: src/sys/dev/netif/txp/if_txp.c,v 1.18 2005/05/24 09:52:15 joerg Exp $ */ +/* $DragonFly: src/sys/dev/netif/txp/if_txp.c,v 1.19 2005/05/24 20:59:03 dillon Exp $ */ /* * Copyright (c) 2001 @@ -264,7 +264,7 @@ txp_attach(dev) } error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_NET, - txp_intr, sc, &sc->sc_intrhand); + txp_intr, sc, &sc->sc_intrhand, NULL); if (error) { txp_release_resources(sc); diff --git a/sys/dev/netif/vr/if_vr.c b/sys/dev/netif/vr/if_vr.c index 23e0870bef..85bb403fc3 100644 --- a/sys/dev/netif/vr/if_vr.c +++ b/sys/dev/netif/vr/if_vr.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_vr.c,v 1.26.2.13 2003/02/06 04:46:20 silby Exp $ - * $DragonFly: src/sys/dev/netif/vr/if_vr.c,v 1.21 2005/05/14 08:21:54 joerg Exp $ + * $DragonFly: src/sys/dev/netif/vr/if_vr.c,v 1.22 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -774,7 +774,7 @@ vr_attach(device_t dev) } error = bus_setup_intr(dev, sc->vr_irq, INTR_TYPE_NET, - vr_intr, sc, &sc->vr_intrhand); + vr_intr, sc, &sc->vr_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vr_irq); diff --git a/sys/dev/netif/vx/if_vx_eisa.c b/sys/dev/netif/vx/if_vx_eisa.c index dab3239459..d6503ac1c6 100644 --- a/sys/dev/netif/vx/if_vx_eisa.c +++ b/sys/dev/netif/vx/if_vx_eisa.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/vx/if_vx_eisa.c,v 1.14 2000/01/29 14:50:31 peter Exp $ - * $DragonFly: src/sys/dev/netif/vx/if_vx_eisa.c,v 1.8 2005/05/24 09:52:15 joerg Exp $ + * $DragonFly: src/sys/dev/netif/vx/if_vx_eisa.c,v 1.9 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -156,7 +156,7 @@ vx_eisa_attach(device_t dev) vxattach(sc); - if (bus_setup_intr(dev, irq, INTR_TYPE_NET, vxintr, sc, &ih)) { + if (bus_setup_intr(dev, irq, INTR_TYPE_NET, vxintr, sc, &ih, NULL)) { goto bad; } diff --git a/sys/dev/netif/vx/if_vx_pci.c b/sys/dev/netif/vx/if_vx_pci.c index 2b9cd0dec2..df32ac2203 100644 --- a/sys/dev/netif/vx/if_vx_pci.c +++ b/sys/dev/netif/vx/if_vx_pci.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/vx/if_vx_pci.c,v 1.21 2000/05/28 15:59:52 peter Exp $ - * $DragonFly: src/sys/dev/netif/vx/if_vx_pci.c,v 1.6 2005/05/24 09:52:15 joerg Exp $ + * $DragonFly: src/sys/dev/netif/vx/if_vx_pci.c,v 1.7 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -145,7 +145,7 @@ vx_pci_attach( goto bad; if (bus_setup_intr(dev, sc->vx_irq, INTR_TYPE_NET, - vxintr, sc, &sc->vx_intrhand)) + vxintr, sc, &sc->vx_intrhand, NULL)) goto bad; if (vxattach(sc) == 0) { diff --git a/sys/dev/netif/wb/if_wb.c b/sys/dev/netif/wb/if_wb.c index 0a0ae6608e..22e0af46b7 100644 --- a/sys/dev/netif/wb/if_wb.c +++ b/sys/dev/netif/wb/if_wb.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_wb.c,v 1.26.2.6 2003/03/05 18:42:34 njl Exp $ - * $DragonFly: src/sys/dev/netif/wb/if_wb.c,v 1.18 2005/05/24 09:52:15 joerg Exp $ + * $DragonFly: src/sys/dev/netif/wb/if_wb.c,v 1.19 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -894,7 +894,7 @@ static int wb_attach(dev) } error = bus_setup_intr(dev, sc->wb_irq, INTR_TYPE_NET, - wb_intr, sc, &sc->wb_intrhand); + wb_intr, sc, &sc->wb_intrhand, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->wb_irq); diff --git a/sys/dev/netif/wi/if_wi.c b/sys/dev/netif/wi/if_wi.c index bfdb18a1cb..d21f94c28f 100644 --- a/sys/dev/netif/wi/if_wi.c +++ b/sys/dev/netif/wi/if_wi.c @@ -32,7 +32,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/wi/if_wi.c,v 1.166 2004/04/01 00:38:45 sam Exp $ - * $DragonFly: src/sys/dev/netif/wi/if_wi.c,v 1.20 2005/02/11 22:25:56 joerg Exp $ + * $DragonFly: src/sys/dev/netif/wi/if_wi.c,v 1.21 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -248,7 +248,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); + wi_intr, sc, &sc->wi_intrhand, NULL); if (error) { device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); diff --git a/sys/dev/netif/xe/if_xe.c b/sys/dev/netif/xe/if_xe.c index 7f6c220646..8e0f5738f8 100644 --- a/sys/dev/netif/xe/if_xe.c +++ b/sys/dev/netif/xe/if_xe.c @@ -25,7 +25,7 @@ * * $Id: if_xe.c,v 1.20 1999/06/13 19:17:40 scott Exp $ * $FreeBSD: src/sys/dev/xe/if_xe.c,v 1.13.2.6 2003/02/05 22:03:57 mbr Exp $ - * $DragonFly: src/sys/dev/netif/xe/if_xe.c,v 1.17 2005/05/24 09:52:15 joerg Exp $ + * $DragonFly: src/sys/dev/netif/xe/if_xe.c,v 1.18 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -2203,8 +2203,9 @@ 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) { + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, xe_intr, sc, + &sc->intrhand, NULL); + if (err) { xe_deactivate(dev); return err; } diff --git a/sys/dev/netif/xl/if_xl.c b/sys/dev/netif/xl/if_xl.c index 31dad6dcd4..fb6f25f2e9 100644 --- a/sys/dev/netif/xl/if_xl.c +++ b/sys/dev/netif/xl/if_xl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_xl.c,v 1.72.2.28 2003/10/08 06:01:57 murray Exp $ - * $DragonFly: src/sys/dev/netif/xl/if_xl.c,v 1.21 2005/05/21 08:57:29 joerg Exp $ + * $DragonFly: src/sys/dev/netif/xl/if_xl.c,v 1.22 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -1754,7 +1754,7 @@ done: /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->xl_irq, INTR_TYPE_NET, - xl_intr, sc, &sc->xl_intrhand); + xl_intr, sc, &sc->xl_intrhand, NULL); if (error) { if_printf(ifp, "couldn't set up irq\n"); ether_ifdetach(ifp); diff --git a/sys/dev/pccard/cardbus/cardbus.c b/sys/dev/pccard/cardbus/cardbus.c index 3205c146bc..3a5ef3d253 100644 --- a/sys/dev/pccard/cardbus/cardbus.c +++ b/sys/dev/pccard/cardbus/cardbus.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.28 2002/11/27 17:30:41 imp Exp $ - * $DragonFly: src/sys/dev/pccard/cardbus/cardbus.c,v 1.4 2005/02/08 15:51:24 joerg Exp $ + * $DragonFly: src/sys/dev/pccard/cardbus/cardbus.c,v 1.5 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -142,7 +142,7 @@ static int cardbus_set_resource_method(device_t cbdev, device_t child, int type, int rid, u_long start, u_long count); static int cardbus_setup_intr(device_t cbdev, device_t child, struct resource *irq, int flags, driver_intr_t *intr, - void *arg, void **cookiep); + void *arg, void **cookiep, lwkt_serialize_t); static int cardbus_teardown_intr(device_t cbdev, device_t child, struct resource *irq, void *cookie); static void cardbus_write_config_method(device_t cbdev, device_t child, @@ -791,14 +791,15 @@ cardbus_release_resource(device_t cbdev, device_t child, int type, int rid, static int cardbus_setup_intr(device_t cbdev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep) + int flags, driver_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer) { int ret; device_t cdev; struct cardbus_devinfo *dinfo; ret = bus_generic_setup_intr(cbdev, child, irq, flags, intr, arg, - cookiep); + cookiep, serializer); if (ret != 0) return ret; diff --git a/sys/dev/pccard/pccbb/pccbb.c b/sys/dev/pccard/pccbb/pccbb.c index c02686ae71..500900328e 100644 --- a/sys/dev/pccard/pccbb/pccbb.c +++ b/sys/dev/pccard/pccbb/pccbb.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.64 2002/11/23 23:09:45 imp Exp $ - * $DragonFly: src/sys/dev/pccard/pccbb/pccbb.c,v 1.5 2005/03/31 05:43:34 hsu Exp $ + * $DragonFly: src/sys/dev/pccard/pccbb/pccbb.c,v 1.6 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -652,7 +652,7 @@ cbb_attach(device_t brdev) } if (bus_setup_intr(brdev, sc->irq_res, INTR_TYPE_NET, cbb_intr, sc, - &sc->intrhand)) { + &sc->intrhand, NULL)) { device_printf(brdev, "couldn't establish interrupt"); goto err; } @@ -785,7 +785,8 @@ cbb_shutdown(device_t brdev) static 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_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer) { struct cbb_intrhand *ih; struct cbb_softc *sc = device_get_softc(dev); @@ -796,12 +797,13 @@ cbb_setup_intr(device_t dev, device_t child, struct resource *irq, * the PCI interrupt for the status change interrupts, it can't be * free for use by the driver. Fast interrupts must not be shared. */ - ih = malloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_NOWAIT); + ih = malloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_WAITOK|M_ZERO); if (ih == NULL) return (ENOMEM); *cookiep = ih; ih->intr = intr; ih->arg = arg; + KKASSERT(serializer == NULL); /* not yet supported */ STAILQ_INSERT_TAIL(&sc->intr_handlers, ih, entries); /* * XXX we should do what old card does to ensure that we don't @@ -1912,7 +1914,7 @@ cbb_resume(device_t self) /* re-establish the interrupt. */ if (bus_setup_intr(self, sc->irq_res, INTR_TYPE_NET, cbb_intr, sc, - &sc->intrhand)) { + &sc->intrhand, NULL)) { device_printf(self, "couldn't re-establish interrupt"); bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res); bus_release_resource(self, SYS_RES_MEMORY, CBBR_SOCKBASE, diff --git a/sys/dev/powermng/i386/intpm/intpm.c b/sys/dev/powermng/i386/intpm/intpm.c index 600d78ecbf..f3aa2b5a81 100644 --- a/sys/dev/powermng/i386/intpm/intpm.c +++ b/sys/dev/powermng/i386/intpm/intpm.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/intpm.c,v 1.16.2.1 2001/12/23 08:17:47 pirzyk Exp $ - * $DragonFly: src/sys/dev/powermng/i386/intpm/intpm.c,v 1.6 2004/06/02 14:00:12 joerg Exp $ + * $DragonFly: src/sys/dev/powermng/i386/intpm/intpm.c,v 1.7 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -707,7 +707,9 @@ intpm_attach(device_t dev) device_printf(dev,"could not allocate irq"); return ENOMEM; } - error=bus_setup_intr(dev,res,INTR_TYPE_MISC, (driver_intr_t *) intpm_intr,sciic,&ih); + error = bus_setup_intr(dev, res, INTR_TYPE_MISC, + (driver_intr_t *)intpm_intr, sciic, + &ih, NULL); if(error){ device_printf(dev,"Failed to map intr\n"); return error; diff --git a/sys/dev/powermng/i386/viapm/viapm.c b/sys/dev/powermng/i386/viapm/viapm.c index 27ce85ebdf..69305472aa 100644 --- a/sys/dev/powermng/i386/viapm/viapm.c +++ b/sys/dev/powermng/i386/viapm/viapm.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/viapm.c,v 1.1.2.1 2002/04/19 05:52:15 nsouch Exp $ - * $DragonFly: src/sys/dev/powermng/i386/viapm/viapm.c,v 1.5 2005/02/17 13:59:36 joerg Exp $ + * $DragonFly: src/sys/dev/powermng/i386/viapm/viapm.c,v 1.6 2005/05/24 20:59:03 dillon Exp $ * */ #include @@ -319,6 +319,7 @@ viapm_pro_attach(device_t dev) { struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev); u_int32_t l; + int error; if (!(viapm->iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &viapm->iorid, 0l, ~0l, 1, RF_ACTIVE))) { @@ -341,8 +342,10 @@ viapm_pro_attach(device_t dev) goto error; } - if (bus_setup_intr(dev, viapm->irqres, INTR_TYPE_MISC, - (driver_intr_t *) viasmb_intr, viapm, &viapm->irqih)) { + error = bus_setup_intr(dev, viapm->irqres, INTR_TYPE_MISC, + (driver_intr_t *) viasmb_intr, viapm, + &viapm->irqih, NULL); + if (error) { device_printf(dev, "could not setup irq\n"); goto error; } diff --git a/sys/dev/powermng/ichsmb/ichsmb_pci.c b/sys/dev/powermng/ichsmb/ichsmb_pci.c index a753c81fd6..a6eb024dd7 100644 --- a/sys/dev/powermng/ichsmb/ichsmb_pci.c +++ b/sys/dev/powermng/ichsmb/ichsmb_pci.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/dev/ichsmb/ichsmb_pci.c,v 1.1.2.3 2002/10/20 14:57:19 nyan Exp $ - * $DragonFly: src/sys/dev/powermng/ichsmb/ichsmb_pci.c,v 1.5 2003/08/30 16:57:22 hmp Exp $ + * $DragonFly: src/sys/dev/powermng/ichsmb/ichsmb_pci.c,v 1.6 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -185,7 +185,8 @@ ichsmb_pci_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); + ichsmb_device_intr, sc, + &sc->irq_handle, NULL); if (error != 0) { log(LOG_ERR, "%s: can't setup irq\n", device_get_nameunit(dev)); goto fail; diff --git a/sys/dev/raid/aac/aac_pci.c b/sys/dev/raid/aac/aac_pci.c index 1601174041..4e01bcfc16 100644 --- a/sys/dev/raid/aac/aac_pci.c +++ b/sys/dev/raid/aac/aac_pci.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.3.2.19 2003/11/01 18:44:51 scottl Exp $ - * $DragonFly: src/sys/dev/raid/aac/aac_pci.c,v 1.5 2004/04/21 03:28:07 hmp Exp $ + * $DragonFly: src/sys/dev/raid/aac/aac_pci.c,v 1.6 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -220,7 +220,7 @@ aac_pci_attach(device_t dev) goto out; } if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_TYPE_BIO|INTR_ENTROPY, - aac_intr, sc, &sc->aac_intr)) { + aac_intr, sc, &sc->aac_intr, NULL)) { device_printf(sc->aac_dev, "can't set up interrupt\n"); goto out; } diff --git a/sys/dev/raid/amr/amr_pci.c b/sys/dev/raid/amr/amr_pci.c index 6f0ff637a8..94fcc7d095 100644 --- a/sys/dev/raid/amr/amr_pci.c +++ b/sys/dev/raid/amr/amr_pci.c @@ -53,7 +53,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/amr/amr_pci.c,v 1.1.2.9 2002/12/20 15:12:04 emoore Exp $ - * $DragonFly: src/sys/dev/raid/amr/amr_pci.c,v 1.3 2003/08/07 21:17:08 dillon Exp $ + * $DragonFly: src/sys/dev/raid/amr/amr_pci.c,v 1.4 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -230,7 +230,10 @@ amr_pci_attach(device_t dev) device_printf(sc->amr_dev, "can't allocate interrupt\n"); goto out; } - if (bus_setup_intr(sc->amr_dev, sc->amr_irq, INTR_TYPE_BIO | INTR_ENTROPY, amr_pci_intr, sc, &sc->amr_intr)) { + error = bus_setup_intr(sc->amr_dev, sc->amr_irq, + INTR_TYPE_BIO | INTR_ENTROPY, amr_pci_intr, sc, + &sc->amr_intr, NULL); + if (error) { device_printf(sc->amr_dev, "can't set up interrupt\n"); goto out; } diff --git a/sys/dev/raid/asr/asr.c b/sys/dev/raid/asr/asr.c index 55c68818ca..daa6768e49 100644 --- a/sys/dev/raid/asr/asr.c +++ b/sys/dev/raid/asr/asr.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/asr/asr.c,v 1.3.2.2 2001/08/23 05:21:29 scottl Exp $ */ -/* $DragonFly: src/sys/dev/raid/asr/asr.c,v 1.18 2004/09/17 03:39:39 joerg Exp $ */ +/* $DragonFly: src/sys/dev/raid/asr/asr.c,v 1.19 2005/05/24 20:59:03 dillon Exp $ */ /* * Copyright (c) 1996-2000 Distributed Processing Technology Corporation * Copyright (c) 2000-2001 Adaptec Corporation @@ -2531,15 +2531,18 @@ asr_pci_map_int ( IN device_t tag, IN Asr_softc_t * sc) { - int rid = 0; + int rid = 0; + int error; sc->ha_irq_res = bus_alloc_resource(tag, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); if (sc->ha_irq_res == (struct resource *)NULL) { return (0); } - if (bus_setup_intr(tag, sc->ha_irq_res, INTR_TYPE_CAM, - (driver_intr_t *)asr_intr, (void *)sc, &(sc->ha_intr))) { + error = bus_setup_intr(tag, sc->ha_irq_res, INTR_TYPE_CAM, + (driver_intr_t *)asr_intr, (void *)sc, + &(sc->ha_intr), NULL); + if (error) { return (0); } sc->ha_irq = pci_read_config(tag, PCIR_INTLINE, sizeof(char)); diff --git a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c index d543027f0c..840a3737f1 100644 --- a/sys/dev/raid/ciss/ciss.c +++ b/sys/dev/raid/ciss/ciss.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.2.2.6 2003/02/18 22:27:41 ps Exp $ - * $DragonFly: src/sys/dev/raid/ciss/ciss.c,v 1.13 2005/04/25 07:05:55 joerg Exp $ + * $DragonFly: src/sys/dev/raid/ciss/ciss.c,v 1.14 2005/05/24 20:59:03 dillon Exp $ */ /* @@ -585,8 +585,10 @@ ciss_init_pci(struct ciss_softc *sc) ciss_printf(sc, "can't allocate interrupt\n"); return(ENXIO); } - if (bus_setup_intr(sc->ciss_dev, sc->ciss_irq_resource, INTR_TYPE_CAM, ciss_intr, sc, - &sc->ciss_intr)) { + error = bus_setup_intr(sc->ciss_dev, sc->ciss_irq_resource, + INTR_TYPE_CAM, ciss_intr, sc, + &sc->ciss_intr, NULL); + if (error) { ciss_printf(sc, "can't set up interrupt\n"); return(ENXIO); } diff --git a/sys/dev/raid/dpt/dpt_eisa.c b/sys/dev/raid/dpt/dpt_eisa.c index 79dfe70360..6133ce4070 100644 --- a/sys/dev/raid/dpt/dpt_eisa.c +++ b/sys/dev/raid/dpt/dpt_eisa.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/dpt/dpt_eisa.c,v 1.12.2.1 2000/08/07 18:48:14 peter Exp $ - * $DragonFly: src/sys/dev/raid/dpt/dpt_eisa.c,v 1.3 2003/08/07 21:17:08 dillon Exp $ + * $DragonFly: src/sys/dev/raid/dpt/dpt_eisa.c,v 1.4 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -162,7 +162,9 @@ dpt_eisa_attach (device_t dev) splx(s); - if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, &ih)) { + error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, + &ih, NULL); + if (error) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; diff --git a/sys/dev/raid/dpt/dpt_pci.c b/sys/dev/raid/dpt/dpt_pci.c index a8c8c473f3..2ca4fbfafe 100644 --- a/sys/dev/raid/dpt/dpt_pci.c +++ b/sys/dev/raid/dpt/dpt_pci.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/dpt/dpt_pci.c,v 1.17.2.2 2000/08/26 22:21:21 peter Exp $ - * $DragonFly: src/sys/dev/raid/dpt/dpt_pci.c,v 1.3 2003/08/07 21:17:08 dillon Exp $ + * $DragonFly: src/sys/dev/raid/dpt/dpt_pci.c,v 1.4 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -167,7 +167,9 @@ dpt_pci_attach (device_t dev) splx(s); - if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, &ih)) { + error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, + &ih, NULL); + if (error) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto bad; diff --git a/sys/dev/raid/ida/ida_eisa.c b/sys/dev/raid/ida/ida_eisa.c index b5a9ba49bf..a6c51a4c2e 100644 --- a/sys/dev/raid/ida/ida_eisa.c +++ b/sys/dev/raid/ida/ida_eisa.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ida/ida_eisa.c,v 1.1.2.4 2001/07/30 20:29:58 jlemon Exp $ - * $DragonFly: src/sys/dev/raid/ida/ida_eisa.c,v 1.3 2003/08/07 21:17:09 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ida/ida_eisa.c,v 1.4 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -321,7 +321,7 @@ ida_eisa_attach(device_t dev) } error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO, - ida_intr, ida, &ida->ih); + ida_intr, ida, &ida->ih, NULL); if (error) { device_printf(dev, "can't setup interrupt\n"); ida_free(ida); diff --git a/sys/dev/raid/ida/ida_pci.c b/sys/dev/raid/ida/ida_pci.c index 559c3800d6..3ea46474b1 100644 --- a/sys/dev/raid/ida/ida_pci.c +++ b/sys/dev/raid/ida/ida_pci.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ida/ida_pci.c,v 1.7.2.7 2001/07/30 20:29:58 jlemon Exp $ - * $DragonFly: src/sys/dev/raid/ida/ida_pci.c,v 1.3 2003/08/07 21:17:09 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ida/ida_pci.c,v 1.4 2005/05/24 20:59:03 dillon Exp $ */ #include @@ -284,7 +284,7 @@ ida_pci_attach(device_t dev) return (ENOMEM); } error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO, - ida_intr, ida, &ida->ih); + ida_intr, ida, &ida->ih, NULL); if (error) { device_printf(dev, "can't setup interrupt\n"); ida_free(ida); diff --git a/sys/dev/raid/iir/iir_pci.c b/sys/dev/raid/iir/iir_pci.c index 3b41550c2c..1ce93c2931 100644 --- a/sys/dev/raid/iir/iir_pci.c +++ b/sys/dev/raid/iir/iir_pci.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/iir/iir_pci.c,v 1.3.2.3 2002/05/05 08:18:12 asmodai Exp $ */ -/* $DragonFly: src/sys/dev/raid/iir/iir_pci.c,v 1.3 2003/08/07 21:17:09 dillon Exp $ */ +/* $DragonFly: src/sys/dev/raid/iir/iir_pci.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ /* * Copyright (c) 2000-01 Intel Corporation * All Rights Reserved @@ -337,8 +337,9 @@ iir_pci_attach(device_t dev) iir_attach(gdt); /* associate interrupt handler */ - if (bus_setup_intr( dev, irq, INTR_TYPE_CAM, - iir_intr, gdt, &ih )) { + error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, + iir_intr, gdt, &ih, NULL); + if (error) { device_printf(dev, "Unable to register interrupt handler\n"); error = ENXIO; goto err; diff --git a/sys/dev/raid/ips/ips_pci.c b/sys/dev/raid/ips/ips_pci.c index 8d643fc3ad..49fdce6094 100644 --- a/sys/dev/raid/ips/ips_pci.c +++ b/sys/dev/raid/ips/ips_pci.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.10 2004/03/19 17:36:47 scottl Exp $ - * $DragonFly: src/sys/dev/raid/ips/ips_pci.c,v 1.11 2005/02/04 03:04:40 y0netan1 Exp $ + * $DragonFly: src/sys/dev/raid/ips/ips_pci.c,v 1.12 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -78,6 +78,7 @@ ips_pci_attach(device_t dev) { u_int32_t command; ips_softc_t *sc; + int error; if (resource_disabled(device_get_name(dev), device_get_unit(dev))) { device_printf(dev, "device is disabled\n"); @@ -125,8 +126,10 @@ 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, - sc->ips_adapter_intr, sc, &sc->irqcookie)) { + error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO, + sc->ips_adapter_intr, sc, + &sc->irqcookie, NULL); + if (error) { device_printf(dev, "irq setup failed\n"); goto error; } diff --git a/sys/dev/raid/mlx/mlx.c b/sys/dev/raid/mlx/mlx.c index 438dae681c..a7952aad91 100644 --- a/sys/dev/raid/mlx/mlx.c +++ b/sys/dev/raid/mlx/mlx.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mlx/mlx.c,v 1.14.2.5 2001/09/11 09:49:53 kris Exp $ - * $DragonFly: src/sys/dev/raid/mlx/mlx.c,v 1.11 2005/02/17 13:59:36 joerg Exp $ + * $DragonFly: src/sys/dev/raid/mlx/mlx.c,v 1.12 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -368,7 +368,9 @@ mlx_attach(struct mlx_softc *sc) mlx_free(sc); 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, mlx_intr, sc, + &sc->mlx_intr, NULL); if (error) { device_printf(sc->mlx_dev, "can't set up interrupt\n"); mlx_free(sc); diff --git a/sys/dev/raid/mly/mly_pci.c b/sys/dev/raid/mly/mly_pci.c index b386d07210..8b0aabcdd0 100644 --- a/sys/dev/raid/mly/mly_pci.c +++ b/sys/dev/raid/mly/mly_pci.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mly/mly_pci.c,v 1.1.2.2 2001/03/05 20:17:24 msmith Exp $ - * $DragonFly: src/sys/dev/raid/mly/Attic/mly_pci.c,v 1.3 2003/08/07 21:17:09 dillon Exp $ + * $DragonFly: src/sys/dev/raid/mly/Attic/mly_pci.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -187,7 +187,9 @@ mly_pci_attach(device_t dev) mly_printf(sc, "can't allocate interrupt\n"); goto fail; } - if (bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM, mly_pci_intr, sc, &sc->mly_intr)) { + error = bus_setup_intr(sc->mly_dev, sc->mly_irq, INTR_TYPE_CAM, + mly_pci_intr, sc, &sc->mly_intr, NULL); + if (error) { mly_printf(sc, "can't set up interrupt\n"); goto fail; } diff --git a/sys/dev/raid/pst/pst-iop.c b/sys/dev/raid/pst/pst-iop.c index 09c29c8989..8dd58d7bfd 100644 --- a/sys/dev/raid/pst/pst-iop.c +++ b/sys/dev/raid/pst/pst-iop.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pst/pst-iop.c,v 1.2.2.1 2002/08/18 12:32:36 sos Exp $ - * $DragonFly: src/sys/dev/raid/pst/pst-iop.c,v 1.5 2005/02/04 02:55:48 dillon Exp $ + * $DragonFly: src/sys/dev/raid/pst/pst-iop.c,v 1.6 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -141,7 +141,8 @@ iop_attach(struct iop_softc *sc) } } /* setup and enable interrupts */ - bus_setup_intr(sc->dev, sc->r_irq, INTR_TYPE_BIO, iop_intr, sc,&sc->handle); + bus_setup_intr(sc->dev, sc->r_irq, INTR_TYPE_BIO, iop_intr, sc, + &sc->handle, NULL); sc->reg->oqueue_intr_mask = 0x0; } diff --git a/sys/dev/raid/twa/twa_freebsd.c b/sys/dev/raid/twa/twa_freebsd.c index 581ce6affa..ac4fee835b 100644 --- a/sys/dev/raid/twa/twa_freebsd.c +++ b/sys/dev/raid/twa/twa_freebsd.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD$ - * $DragonFly: src/sys/dev/raid/twa/twa_freebsd.c,v 1.5 2005/02/04 02:55:48 dillon Exp $ + * $DragonFly: src/sys/dev/raid/twa/twa_freebsd.c,v 1.6 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -283,7 +283,7 @@ twa_attach(device_t dev) return(ENXIO); } if (bus_setup_intr(sc->twa_bus_dev, sc->twa_irq_res, INTR_TYPE_CAM, - twa_pci_intr, sc, &sc->twa_intr_handle)) { + twa_pci_intr, sc, &sc->twa_intr_handle, NULL)) { twa_printf(sc, "Can't set up interrupt.\n"); twa_free(sc); return(ENXIO); diff --git a/sys/dev/raid/twe/twe_freebsd.c b/sys/dev/raid/twe/twe_freebsd.c index 43af346b00..209f8d4fee 100644 --- a/sys/dev/raid/twe/twe_freebsd.c +++ b/sys/dev/raid/twe/twe_freebsd.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/twe/twe_freebsd.c,v 1.2.2.5 2002/03/07 09:57:02 msmith Exp $ - * $DragonFly: src/sys/dev/raid/twe/twe_freebsd.c,v 1.12 2005/02/04 02:55:48 dillon Exp $ + * $DragonFly: src/sys/dev/raid/twe/twe_freebsd.c,v 1.13 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -274,7 +274,10 @@ 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)) { + error = bus_setup_intr(sc->twe_dev, sc->twe_irq, + INTR_TYPE_BIO | INTR_ENTROPY, twe_pci_intr, sc, + &sc->twe_intr, NULL); + if (error) { twe_printf(sc, "can't set up interrupt\n"); twe_free(sc); return(ENXIO); diff --git a/sys/dev/serial/digi/digi_pci.c b/sys/dev/serial/digi/digi_pci.c index ccfbd7e7c7..dc6a1650c9 100644 --- a/sys/dev/serial/digi/digi_pci.c +++ b/sys/dev/serial/digi/digi_pci.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/digi/digi_pci.c,v 1.9 2003/08/24 17:46:03 obrien Exp $ - * $DragonFly: src/sys/dev/serial/digi/digi_pci.c,v 1.1 2004/12/22 08:42:47 joerg Exp $ + * $DragonFly: src/sys/dev/serial/digi/digi_pci.c,v 1.2 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -189,7 +189,8 @@ digi_pci_attach(device_t dev) return (ENXIO); } retVal = bus_setup_intr(dev, sc->res.irq, INTR_TYPE_TTY, - digiintr, sc, &sc->res.irqHandler); + digiintr, sc, + &sc->res.irqHandler, NULL); #else DLOG(DIGIDB_IRQ, (sc->dev, "Interrupt support compiled out\n")); #endif diff --git a/sys/dev/serial/si/si_eisa.c b/sys/dev/serial/si/si_eisa.c index 1a1dbd7ce4..945d0472d6 100644 --- a/sys/dev/serial/si/si_eisa.c +++ b/sys/dev/serial/si/si_eisa.c @@ -18,7 +18,7 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/sys/dev/si/si_eisa.c,v 1.1 2000/01/24 07:24:01 peter Exp $ - * $DragonFly: src/sys/dev/serial/si/si_eisa.c,v 1.3 2003/08/07 21:17:11 dillon Exp $ + * $DragonFly: src/sys/dev/serial/si/si_eisa.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -102,7 +102,8 @@ si_eisa_attach(device_t dev) } sc->sc_irq = rman_get_start(sc->sc_irq_res); error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY, - si_intr, sc,&ih); + si_intr, sc, + &ih, NULL); if (error) { device_printf(dev, "couldn't activate interrupt"); goto fail; diff --git a/sys/dev/serial/si/si_isa.c b/sys/dev/serial/si/si_isa.c index 6e05bba0d5..3cf01a8b3d 100644 --- a/sys/dev/serial/si/si_isa.c +++ b/sys/dev/serial/si/si_isa.c @@ -18,7 +18,7 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/sys/dev/si/si_isa.c,v 1.1 2000/01/24 07:24:01 peter Exp $ - * $DragonFly: src/sys/dev/serial/si/si_isa.c,v 1.3 2003/08/07 21:17:11 dillon Exp $ + * $DragonFly: src/sys/dev/serial/si/si_isa.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include "opt_debug_si.h" @@ -283,7 +283,8 @@ si_isa_attach(device_t dev) } sc->sc_irq = rman_get_start(sc->sc_irq_res); error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY, - si_intr, sc,&ih); + si_intr, sc, + &ih, NULL); if (error) { device_printf(dev, "couldn't activate interrupt\n"); goto fail; diff --git a/sys/dev/serial/si/si_pci.c b/sys/dev/serial/si/si_pci.c index 9ecef9deae..08c647f7d5 100644 --- a/sys/dev/serial/si/si_pci.c +++ b/sys/dev/serial/si/si_pci.c @@ -18,7 +18,7 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/sys/dev/si/si_pci.c,v 1.2 2000/01/24 08:11:10 peter Exp $ - * $DragonFly: src/sys/dev/serial/si/si_pci.c,v 1.3 2003/08/07 21:17:11 dillon Exp $ + * $DragonFly: src/sys/dev/serial/si/si_pci.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -96,7 +96,7 @@ si_pci_attach(device_t dev) } sc->sc_irq = rman_get_start(sc->sc_irq_res); error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY, - si_intr, sc, &ih); + si_intr, sc, &ih, NULL); if (error) { device_printf(dev, "could not activate interrupt\n"); goto fail; diff --git a/sys/dev/serial/sio/sio.c b/sys/dev/serial/sio/sio.c index d59c081edf..e759b3efb7 100644 --- a/sys/dev/serial/sio/sio.c +++ b/sys/dev/serial/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/sio.c,v 1.291.2.35 2003/05/18 08:51:15 murray Exp $ - * $DragonFly: src/sys/dev/serial/sio/sio.c,v 1.23 2005/04/30 23:04:21 swildner Exp $ + * $DragonFly: src/sys/dev/serial/sio/sio.c,v 1.24 2005/05/24 20:59:04 dillon Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.234 */ @@ -1225,11 +1225,11 @@ determined_type: ; if (com->irqres) { ret = BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, INTR_TYPE_TTY | INTR_FAST, - siointr, com, &com->cookie); + siointr, com, &com->cookie, NULL); if (ret) { ret = BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, INTR_TYPE_TTY, - siointr, com, &com->cookie); + siointr, com, &com->cookie, NULL); if (ret == 0) device_printf(dev, "unable to activate interrupt in fast mode - using normal mode\n"); } diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c index e2be295382..7284582c60 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/ad1816.c,v 1.7.2.9 2002/12/24 21:17:41 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.2 2003/06/17 04:28:30 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.3 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.2 2003/06/17 04:28:30 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.3 2005/05/24 20:59:04 dillon Exp $"); struct ad1816_info; @@ -602,7 +602,8 @@ ad1816_attach(device_t dev) ad1816_init(ad1816, dev); if (mixer_init(dev, &ad1816mixer_class, ad1816)) goto no; - snd_setup_intr(dev, ad1816->irq, INTR_MPSAFE, ad1816_intr, ad1816, &ad1816->ih); + snd_setup_intr(dev, ad1816->irq, INTR_MPSAFE, ad1816_intr, ad1816, + &ad1816->ih, NULL); if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/BUS_SPACE_MAXADDR, diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index 7b263b99bd..0f40d64185 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/ess.c,v 1.3.2.8 2002/12/24 21:17:41 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/ess.c,v 1.2 2003/06/17 04:28:30 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/ess.c,v 1.3 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ess.c,v 1.2 2003/06/17 04:28:30 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ess.c,v 1.3 2005/05/24 20:59:04 dillon Exp $"); #define ESS_BUFFSIZE (4096) #define ABS(x) (((x) < 0)? -(x) : (x)) @@ -846,7 +846,7 @@ ess_attach(device_t dev) if (sc->newspeed) ess_setmixer(sc, 0x71, 0x22); - snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ess_intr, sc, &sc->ih); + snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ess_intr, sc, &sc->ih, NULL); if (!sc->duplex) pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX); diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c index 692857a336..d3c2d4c490 100644 --- a/sys/dev/sound/isa/gusc.c +++ b/sys/dev/sound/isa/gusc.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/gusc.c,v 1.5.2.6 2002/04/22 15:49:30 cg Exp $ - * $DragonFly: src/sys/dev/sound/isa/gusc.c,v 1.3 2003/08/07 21:17:11 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/gusc.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -48,7 +48,7 @@ #include #endif -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/gusc.c,v 1.3 2003/08/07 21:17:11 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/gusc.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); #define LOGICALID_NOPNP 0 #define LOGICALID_PCM 0x0000561e @@ -321,8 +321,10 @@ gusc_attach(device_t dev) return (ENXIO); } - if (scp->irq != NULL) - bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, gusc_intr, scp, &ih); + if (scp->irq != NULL) { + bus_setup_intr(dev, scp->irq, INTR_TYPE_AV, gusc_intr, scp, + &ih, NULL); + } bus_generic_attach(dev); return (0); @@ -425,7 +427,8 @@ 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_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer) { sc_p scp = (sc_p)device_get_softc(dev); devclass_t devclass; @@ -441,7 +444,7 @@ gusc_setup_intr(device_t dev, device_t child, struct resource *irq, return 0; } return bus_generic_setup_intr(dev, child, irq, flags, intr, - arg, cookiep); + arg, cookiep, serializer); } static device_t diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index 4231ad84ca..d82d748af0 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -27,12 +27,12 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.48.2.11 2002/12/24 21:17:41 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/mss.c,v 1.3 2003/11/10 19:29:42 asmodai Exp $ + * $DragonFly: src/sys/dev/sound/isa/mss.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/mss.c,v 1.3 2003/11/10 19:29:42 asmodai Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/mss.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); /* board-specific include files */ #include @@ -1711,10 +1711,10 @@ mss_doattach(device_t dev, struct mss_info *mss) mixer_init(dev, (mss->bd_id == MD_YM0020)? &ymmix_mixer_class : &mssmix_mixer_class, mss); switch (mss->bd_id) { case MD_OPTI931: - snd_setup_intr(dev, mss->irq, INTR_MPSAFE, opti931_intr, mss, &mss->ih); + snd_setup_intr(dev, mss->irq, INTR_MPSAFE, opti931_intr, mss, &mss->ih, NULL); break; default: - snd_setup_intr(dev, mss->irq, INTR_MPSAFE, mss_intr, mss, &mss->ih); + snd_setup_intr(dev, mss->irq, INTR_MPSAFE, mss_intr, mss, &mss->ih, NULL); } if (pdma == rdma) pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX); diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index bec419e99c..413a611b19 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/sb16.c,v 1.64.2.7 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.3 2004/02/13 01:45:14 joerg Exp $ + * $DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.3 2004/02/13 01:45:14 joerg Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); #define SB16_BUFFSIZE 4096 #define PLAIN_SB16(x) ((((x)->bd_flags) & (BD_F_SB16|BD_F_SB16X)) == BD_F_SB16) @@ -800,7 +800,7 @@ sb16_attach(device_t dev) goto no; if (mixer_init(dev, &sb16mix_mixer_class, sb)) goto no; - if (snd_setup_intr(dev, sb->irq, INTR_MPSAFE, sb_intr, sb, &sb->ih)) + if (snd_setup_intr(dev, sb->irq, INTR_MPSAFE, sb_intr, sb, &sb->ih, NULL)) goto no; if (sb->bd_flags & BD_F_SB16X) diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index c69e46be65..ccfeb9f084 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/sb8.c,v 1.62.2.5 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.2 2003/06/17 04:28:30 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.3 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.2 2003/06/17 04:28:30 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.3 2005/05/24 20:59:04 dillon Exp $"); #define SB_DEFAULT_BUFSZ 4096 @@ -714,7 +714,7 @@ sb_attach(device_t dev) goto no; if (mixer_init(dev, (sb->bd_id < 0x300)? &sbmix_mixer_class : &sbpromix_mixer_class, sb)) goto no; - if (snd_setup_intr(dev, sb->irq, INTR_MPSAFE, sb_intr, sb, &sb->ih)) + if (snd_setup_intr(dev, sb->irq, INTR_MPSAFE, sb_intr, sb, &sb->ih, NULL)) goto no; pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX); diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c index 2932f3feb8..034c6851e4 100644 --- a/sys/dev/sound/isa/sbc.c +++ b/sys/dev/sound/isa/sbc.c @@ -24,14 +24,14 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/sbc.c,v 1.19.2.12 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/sbc.c,v 1.2 2003/06/17 04:28:30 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/sbc.c,v 1.3 2005/05/24 20:59:04 dillon Exp $ */ #include #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sbc.c,v 1.2 2003/06/17 04:28:30 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sbc.c,v 1.3 2005/05/24 20:59:04 dillon Exp $"); #define IO_MAX 3 #define IRQ_MAX 1 @@ -82,7 +82,7 @@ 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); + void **cookiep, lwkt_serialize_t serializer); static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); @@ -431,7 +431,7 @@ sbc_attach(device_t dev) err = "setup_intr"; for (i = 0; i < IRQ_MAX; i++) { scp->ihl[i].parent = scp; - if (snd_setup_intr(dev, scp->irq[i], INTR_MPSAFE, sbc_intr, &scp->ihl[i], &scp->ih[i])) + if (snd_setup_intr(dev, scp->irq[i], INTR_MPSAFE, sbc_intr, &scp->ihl[i], &scp->ih[i], NULL)) goto bad; } @@ -498,12 +498,14 @@ 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) + void **cookiep, lwkt_serialize_t serializer) { struct sbc_softc *scp = device_get_softc(dev); struct sbc_ihl *ihl = NULL; int i, ret; + KKASSERT(serializer == NULL); /* not yet supported */ + sbc_lock(scp); i = 0; while (i < IRQ_MAX) { diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index e599e8216f..05e45fcaac 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/als4000.c,v 1.2.2.5 2002/04/22 15:49:31 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.4 2004/02/13 01:45:14 joerg Exp $ + * $DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.5 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -45,7 +45,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.4 2004/02/13 01:45:14 joerg Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.5 2005/05/24 20:59:04 dillon Exp $"); /* Debugging macro's */ #undef DEB @@ -734,7 +734,7 @@ als_resource_grab(device_t dev, struct sc_info *sc) } if (bus_setup_intr(dev, sc->irq, INTR_TYPE_AV, als_intr, - sc, &sc->ih)) { + sc, &sc->ih, NULL)) { device_printf(dev, "unable to setup interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c index 79b5dae5eb..f1a60593af 100644 --- a/sys/dev/sound/pci/aureal.c +++ b/sys/dev/sound/pci/aureal.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/aureal.c,v 1.8.2.7 2002/04/22 15:49:31 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.5 2005/01/24 15:38:30 drhodus Exp $ + * $DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.6 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.5 2005/01/24 15:38:30 drhodus Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.6 2005/05/24 20:59:04 dillon Exp $"); /* PCI IDs of supported chips */ #define AU8820_PCI_ID 0x000112eb @@ -623,7 +623,7 @@ au_pci_attach(device_t dev) irqid = 0; irq = bus_alloc_resource(dev, SYS_RES_IRQ, &irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!irq || snd_setup_intr(dev, irq, 0, au_intr, au, &ih)) { + if (!irq || snd_setup_intr(dev, irq, 0, au_intr, au, &ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index aa84b670b7..83271eccce 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -40,7 +40,7 @@ * those that don't. * * $FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.1.2.8 2002/08/27 00:17:34 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.4 2003/11/20 22:14:27 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.5 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -54,7 +54,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.4 2003/11/20 22:14:27 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.5 2005/05/24 20:59:04 dillon Exp $"); /* Supported chip ID's */ #define CMI8338A_PCI_ID 0x010013f6 @@ -866,7 +866,7 @@ cmi_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 || - snd_setup_intr(dev, sc->irq, INTR_MPSAFE, cmi_intr, sc, &sc->ih)) { + snd_setup_intr(dev, sc->irq, INTR_MPSAFE, cmi_intr, sc, &sc->ih, NULL)) { device_printf(dev, "cmi_attach: Unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 94c1a84b8d..2dd85854fc 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -29,7 +29,7 @@ * contributed towards power management. * * $FreeBSD: src/sys/dev/sound/pci/cs4281.c,v 1.2.2.8 2002/08/27 00:25:55 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.5 2004/02/13 01:45:14 joerg Exp $ + * $DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.6 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -40,7 +40,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.5 2004/02/13 01:45:14 joerg Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.6 2005/05/24 20:59:04 dillon Exp $"); #define CS4281_DEFAULT_BUFSZ 16384 @@ -820,7 +820,7 @@ cs4281_pci_attach(device_t dev) goto bad; } - if (snd_setup_intr(dev, sc->irq, 0, cs4281_intr, sc, &sc->ih)) { + if (snd_setup_intr(dev, sc->irq, 0, cs4281_intr, sc, &sc->ih, NULL)) { device_printf(dev, "unable to setup interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index bbaea3cf71..34dc98604c 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/csa.c,v 1.8.2.12 2002/10/05 19:53:18 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/csa.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/csa.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -51,7 +51,7 @@ #include "gnu/csaimg.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/csa.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/csa.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); /* This is the pci device id. */ #define CS4610_PCI_ID 0x60011013 @@ -85,7 +85,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_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer); static int csa_teardown_intr(device_t bus, device_t child, struct resource *irq, void *cookie); static driver_intr_t csa_intr; @@ -275,7 +276,7 @@ csa_attach(device_t dev) goto err_mem; /* Enable interrupt. */ - if (snd_setup_intr(dev, resp->irq, INTR_MPSAFE, csa_intr, scp, &scp->ih)) + if (snd_setup_intr(dev, resp->irq, INTR_MPSAFE, csa_intr, scp, &scp->ih, NULL)) goto err_intr; #if 0 if ((csa_readio(resp, BA0_HISR) & HISR_INTENA) == 0) @@ -417,7 +418,8 @@ 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_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer) { sc_p scp; csa_res *resp; @@ -426,6 +428,8 @@ csa_setup_intr(device_t bus, device_t child, scp = device_get_softc(bus); resp = &scp->res; + KKASSERT(serializer == NULL); /* not yet supported */ + /* * Look at the function code of the child to determine * the appropriate hander for it. diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index c0b53f2129..0b8a25d81d 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/csapcm.c,v 1.8.2.7 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -41,7 +41,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); /* Buffer size on dma transfer. Fixed for CS416x. */ #define CS461x_BUFFSIZE (4 * 1024) @@ -793,7 +793,7 @@ pcmcsa_attach(device_t dev) snprintf(status, SND_STATUSLEN, "at irq %ld", rman_get_start(resp->irq)); /* Enable interrupt. */ - if (snd_setup_intr(dev, resp->irq, INTR_MPSAFE, csa_intr, csa, &csa->ih)) { + if (snd_setup_intr(dev, resp->irq, INTR_MPSAFE, csa_intr, csa, &csa->ih, NULL)) { ac97_destroy(codec); csa_releaseres(csa, dev); return (ENXIO); diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c index 9ac5a5c993..543af99ae1 100644 --- a/sys/dev/sound/pci/ds1.c +++ b/sys/dev/sound/pci/ds1.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.8.2.9 2003/04/28 03:59:03 simokawa Exp $ - * $DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -36,7 +36,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -990,7 +990,7 @@ ds_pci_attach(device_t dev) sc->irqid = 0; sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ds_intr, sc, &sc->ih)) { + if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ds_intr, sc, &sc->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index cbc1d19b46..8d53812540 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.6.2.9 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.7 2004/02/25 16:30:21 joerg Exp $ + * $DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.8 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -35,7 +35,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.7 2004/02/25 16:30:21 joerg Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.8 2005/05/24 20:59:04 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -1886,7 +1886,7 @@ emu_pci_attach(device_t dev) i = 0; sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &i, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, emu_intr, sc, &sc->ih)) { + if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, emu_intr, sc, &sc->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 518e29b5fe..cfad17cb96 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -39,7 +39,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/es137x.c,v 1.13.2.10 2002/05/07 17:02:25 greid Exp $ - * $DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -62,7 +62,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); static int debug = 0; SYSCTL_INT(_debug, OID_AUTO, es_debug, CTLFLAG_RW, &debug, 0, ""); @@ -895,7 +895,7 @@ es_pci_attach(device_t dev) es->irqid = 0; es->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &es->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!es->irq || snd_setup_intr(dev, es->irq, 0, es_intr, es, &es->ih)) { + if (!es->irq || snd_setup_intr(dev, es->irq, 0, es_intr, es, &es->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index 6f5f75e184..96e364fc12 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.3.2.8 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.5 2004/08/09 19:49:28 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.6 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -32,7 +32,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.5 2004/08/09 19:49:28 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.6 2005/05/24 20:59:04 dillon Exp $"); #define PCI_VENDOR_FORTEMEDIA 0x1319 #define PCI_DEVICE_FORTEMEDIA1 0x08011319 @@ -625,7 +625,7 @@ fm801_pci_attach(device_t dev) fm801->irqid = 0; fm801->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &fm801->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!fm801->irq || snd_setup_intr(dev, fm801->irq, 0, fm801_intr, fm801, &fm801->ih)) { + if (!fm801->irq || snd_setup_intr(dev, fm801->irq, 0, fm801_intr, fm801, &fm801->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto oops; } diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 1b4aa8cea6..d18045e657 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.3.2.12 2003/01/20 03:59:42 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/ich.c,v 1.8 2005/02/14 14:48:49 joerg Exp $ + * $DragonFly: src/sys/dev/sound/pci/ich.c,v 1.9 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -35,7 +35,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ich.c,v 1.8 2005/02/14 14:48:49 joerg Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ich.c,v 1.9 2005/05/24 20:59:04 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -754,7 +754,7 @@ ich_pci_attach(device_t dev) sc->irqid = 0; sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ich_intr, sc, &sc->ih)) { + if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ich_intr, sc, &sc->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/maestro.c b/sys/dev/sound/pci/maestro.c index d71d0c19c4..ac3952ee51 100644 --- a/sys/dev/sound/pci/maestro.c +++ b/sys/dev/sound/pci/maestro.c @@ -25,7 +25,7 @@ * * $Id: maestro.c,v 1.12 2000/09/06 03:32:34 taku Exp $ * $FreeBSD: src/sys/dev/sound/pci/maestro.c,v 1.2.2.5 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -53,7 +53,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); #define inline __inline @@ -1026,7 +1026,7 @@ agg_attach(device_t dev) irq = bus_alloc_resource(dev, SYS_RES_IRQ, &irqid, 0, BUS_SPACE_UNRESTRICTED, 1, RF_ACTIVE | RF_SHAREABLE); - if (irq == NULL || snd_setup_intr(dev, irq, 0, agg_intr, ess, &ih)) { + if (irq == NULL || snd_setup_intr(dev, irq, 0, agg_intr, ess, &ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index 86d768af49..7b5e05b4be 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/maestro3.c,v 1.2.2.11 2002/09/16 19:52:33 scottl Exp $ - * $DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.4 2003/08/15 08:32:31 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.5 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -64,7 +64,7 @@ #include "gnu/maestro3_reg.h" #include "gnu/maestro3_dsp.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.4 2003/08/15 08:32:31 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.5 2005/05/24 20:59:04 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -1136,7 +1136,7 @@ m3_pci_attach(device_t dev) goto bad; } - if (snd_setup_intr(dev, sc->irq, 0, m3_intr, sc, &sc->ih)) { + if (snd_setup_intr(dev, sc->irq, 0, m3_intr, sc, &sc->ih, NULL)) { device_printf(dev, "unable to setup interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index ec05f8f05e..40eb173ea9 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/neomagic.c,v 1.7.2.11 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -37,7 +37,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -702,7 +702,7 @@ nm_pci_attach(device_t dev) sc->irqid = 0; sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, nm_intr, sc, &sc->ih)) { + if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, nm_intr, sc, &sc->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index 6197bc7203..ac7ff3d035 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/solo.c,v 1.9.2.8 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/solo.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/solo.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -36,7 +36,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/solo.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/solo.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); #define SOLO_DEFAULT_BUFSZ 16384 #define ABS(x) (((x) < 0)? -(x) : (x)) @@ -947,7 +947,7 @@ ess_attach(device_t dev) if (sc->newspeed) ess_setmixer(sc, 0x71, 0x2a); - snd_setup_intr(dev, sc->irq, 0, ess_intr, sc, &sc->ih); + snd_setup_intr(dev, sc->irq, 0, ess_intr, sc, &sc->ih, NULL); if (!sc->duplex) pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX); diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index d5ef720755..8422685b73 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/t4dwave.c,v 1.9.2.11 2002/10/22 08:27:13 cognet Exp $ - * $DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.4 2004/11/05 17:47:48 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.5 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.4 2004/11/05 17:47:48 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.5 2005/05/24 20:59:04 dillon Exp $"); /* -------------------------------------------------------------------- */ #define TDX_PCI_ID 0x20001023 @@ -856,7 +856,7 @@ tr_pci_attach(device_t dev) tr->irqid = 0; tr->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &tr->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!tr->irq || snd_setup_intr(dev, tr->irq, INTR_MPSAFE, tr_intr, tr, &tr->ih)) { + if (!tr->irq || snd_setup_intr(dev, tr->irq, INTR_MPSAFE, tr_intr, tr, &tr->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index da0dac2bdc..329ea86aee 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/via8233.c,v 1.2.2.2 2003/02/06 17:35:56 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ /* Some Credits: @@ -46,7 +46,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); #define VIA8233_PCI_ID 0x30591106 @@ -547,7 +547,7 @@ via_attach(device_t dev) via->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &via->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); if (!via->irq || - snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih)) { + snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih, NULL)) { device_printf(dev, "unable to map interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index 7b889f3b92..7e8a25db91 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/via82c686.c,v 1.4.2.10 2003/05/11 01:45:53 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -36,7 +36,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); #define VIA_PCI_ID 0x30581106 #define NSEGS 4 /* Number of segments in SGD table */ @@ -510,7 +510,7 @@ via_attach(device_t dev) via->irqid = 0; via->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &via->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); - if (!via->irq || snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih)) { + if (!via->irq || snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih, NULL)) { 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 65c3c7c429..bef3cbb801 100644 --- a/sys/dev/sound/pci/vibes.c +++ b/sys/dev/sound/pci/vibes.c @@ -28,7 +28,7 @@ * muting. * * $FreeBSD: src/sys/dev/sound/pci/vibes.c,v 1.4.2.6 2002/04/22 15:49:33 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.4 2004/02/13 01:45:14 joerg Exp $ + * $DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.5 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.4 2004/02/13 01:45:14 joerg Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.5 2005/05/24 20:59:04 dillon Exp $"); /* ------------------------------------------------------------------------- */ /* Constants */ @@ -767,7 +767,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, sv_intr, sc, &sc->ih, NULL)) { 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 71512feb14..ab72b140fc 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.17.2.14 2002/11/07 23:17:18 cognet Exp $ - * $DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.3 2003/11/15 21:05:42 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.4 2005/05/24 20:59:04 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include "feeder_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.3 2003/11/15 21:05:42 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.4 2005/05/24 20:59:04 dillon Exp $"); struct snddev_channel { SLIST_ENTRY(snddev_channel) link; @@ -149,15 +149,21 @@ snd_mtxunlock(void *m) } int -snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand, void *param, void **cookiep) +snd_setup_intr(device_t dev, struct resource *res, int flags, + driver_intr_t hand, void *param, void **cookiep, + lwkt_serialize_t serializer) { + int error; + #ifdef USING_MUTEX flags &= INTR_MPSAFE; flags |= INTR_TYPE_AV; #else flags = INTR_TYPE_AV; #endif - return bus_setup_intr(dev, res, flags, hand, param, cookiep); + error = bus_setup_intr(dev, res, flags, hand, param, + cookiep, serializer); + return (error); } void diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index c6e63757fd..cf913e5c9c 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/sound.h,v 1.10.2.11 2002/04/22 15:49:36 cg Exp $ - * $DragonFly: src/sys/dev/sound/pcm/sound.h,v 1.4 2004/02/13 01:45:14 joerg Exp $ + * $DragonFly: src/sys/dev/sound/pcm/sound.h,v 1.5 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -243,7 +243,8 @@ void pcm_setflags(device_t dev, u_int32_t val); void *pcm_getdevinfo(device_t dev); int snd_setup_intr(device_t dev, struct resource *res, int flags, - driver_intr_t hand, void *param, void **cookiep); + driver_intr_t hand, void *param, + void **cookiep, lwkt_serialize_t serializer); void *snd_mtxcreate(const char *desc, const char *type); void snd_mtxfree(void *m); diff --git a/sys/dev/video/bktr/bktr_os.c b/sys/dev/video/bktr/bktr_os.c index 445b5ab02f..b09ce7f10a 100644 --- a/sys/dev/video/bktr/bktr_os.c +++ b/sys/dev/video/bktr/bktr_os.c @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.45 2004/03/17 17:50:28 njl Exp $ - * $DragonFly: src/sys/dev/video/bktr/bktr_os.c,v 1.10 2004/05/19 22:52:52 dillon Exp $ + * $DragonFly: src/sys/dev/video/bktr/bktr_os.c,v 1.11 2005/05/24 20:59:04 dillon Exp $ */ /* @@ -301,7 +301,7 @@ bktr_attach( device_t dev ) } error = bus_setup_intr(dev, bktr->res_irq, INTR_TYPE_TTY, - bktr_intr, bktr, &bktr->res_ih); + bktr_intr, bktr, &bktr->res_ih, NULL); if (error) { device_printf(dev, "could not setup irq\n"); goto fail; diff --git a/sys/dev/video/tga/tga_pci.c b/sys/dev/video/tga/tga_pci.c index f825030e6b..47c8ff8802 100644 --- a/sys/dev/video/tga/tga_pci.c +++ b/sys/dev/video/tga/tga_pci.c @@ -27,7 +27,7 @@ * Copyright (c) 2000 Andrew Miklic, Andrew Gallatin, and Thomas V. Crimi * * $FreeBSD: src/sys/dev/tga/tga_pci.c,v 1.1.2.1 2001/11/01 08:33:15 obrien Exp $ - * $DragonFly: src/sys/dev/video/tga/Attic/tga_pci.c,v 1.7 2004/05/19 22:52:54 dillon Exp $ + * $DragonFly: src/sys/dev/video/tga/Attic/tga_pci.c,v 1.8 2005/05/24 20:59:05 dillon Exp $ */ #include @@ -166,7 +166,7 @@ tga_attach(device_t dev) } sc->regs = sc->bhandle + TGA_MEM_CREGS; error = bus_setup_intr(dev, sc->irq, INTR_TYPE_TTY, tga_intr, sc, - &sc->intrhand); + &sc->intrhand, NULL); if(error) { device_printf(dev, "couldn't set up irq\n"); goto fail; diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index f725b16238..d780c6bbc9 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.26.2.10 2003/02/22 13:16:45 imp Exp $ - * $DragonFly: src/sys/i386/i386/Attic/nexus.c,v 1.13 2005/05/23 18:19:51 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/nexus.c,v 1.14 2005/05/24 20:59:05 dillon Exp $ */ /* @@ -96,11 +96,10 @@ 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 **); + void (*)(void *), void *, + void **, lwkt_serialize_t); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); -static void nexus_enable_intr(device_t, device_t, void *); -static void nexus_disable_intr(device_t, device_t, void *); static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); static void nexus_delete_resource(device_t, device_t, int, int); @@ -125,8 +124,6 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), - DEVMETHOD(bus_disable_intr, nexus_disable_intr), - DEVMETHOD(bus_enable_intr, nexus_enable_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), @@ -508,7 +505,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, void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer) { intrmask_t *mask; driver_t *driver; @@ -560,7 +558,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, return (error); *cookiep = inthand_add(device_get_nameunit(child), irq->r_start, - ihand, arg, mask, icflags); + ihand, arg, mask, icflags, serializer); if (*cookiep == NULL) error = EINVAL; /* XXX ??? */ @@ -573,18 +571,6 @@ nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) return (inthand_remove(ih)); } -static void -nexus_disable_intr(device_t dev, device_t child, void *ih) -{ - inthand_disabled(ih); -} - -static void -nexus_enable_intr(device_t dev, device_t child, void *ih) -{ - inthand_enabled(ih); -} - static int nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count) { diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 80da09388d..c0b44161ba 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/atomic.h,v 1.9.2.1 2000/07/07 00:38:47 obrien Exp $ - * $DragonFly: src/sys/i386/include/Attic/atomic.h,v 1.9 2005/04/13 04:00:48 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/atomic.h,v 1.10 2005/05/24 20:58:38 dillon Exp $ */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ @@ -162,4 +162,130 @@ atomic_poll_release_int(volatile u_int *p) #endif +/* + * These functions operate on a 32 bit interrupt interlock which is defined + * as follows: + * + * bit 0-30 interrupt handler disabled bits (counter) + * bit 31 interrupt handler currently running bit (1 = run) + * + * + * atomic_intr_cond_enter(P, func, arg) + * Increment the request counter and attempt to + * set bit 31 to acquire the interlock. If + * we are unable to set bit 31 func(arg) is + * called in a loop until we are able to set + * bit 31. + * + * atomic_intr_cond_exit(P, func, arg) + * Decrement the request counter and clear bit + * 31. If the request counter is still non-zero + * call func(arg) once. + * + * atomic_intr_handler_disable(P) + * Set bit 30, indicating that the interrupt + * handler has been disabled. Must be called + * after the hardware is disabled. + * + * Returns bit 31 indicating whether a serialized + * accessor is active (typically the interrupt + * handler is running). 0 == not active, + * non-zero == active. + * + * atomic_intr_handler_enable(P) + * Clear bit 30, indicating that the interrupt + * handler has been enabled. Must be called + * before the hardware is actually enabled. + * + * atomic_intr_handler_is_enabled(P) + * Returns bit 30, 0 indicates that the handler + * is enabled, non-zero indicates that it is + * disabled. The request counter portion of + * the field is ignored. + */ + +#ifndef __ATOMIC_INTR_T +#define __ATOMIC_INTR_T +typedef volatile int atomic_intr_t; +#endif + +#if defined(KLD_MODULE) + +void atomic_intr_init(atomic_intr_t *p); +int atomic_intr_handler_disable(atomic_intr_t *p); +void atomic_intr_handler_enable(atomic_intr_t *p); +int atomic_intr_handler_is_enabled(atomic_intr_t *p); +void atomic_intr_cond_enter(atomic_intr_t *p, void (*func)(void *), void *arg); +void atomic_intr_cond_exit(atomic_intr_t *p, void (*func)(void *), void *arg); + +#else + +static __inline +void +atomic_intr_init(atomic_intr_t *p) +{ + *p = 0; +} + +static __inline +int +atomic_intr_handler_disable(atomic_intr_t *p) +{ + int data; + + __asm __volatile(MPLOCKED "orl $0x40000000,%1; movl %1,%%eax; " \ + "andl $0x80000000,%%eax" \ + : "=&a"(data) : "m"(*p)); + return(data); +} + +static __inline +void +atomic_intr_handler_enable(atomic_intr_t *p) +{ + __asm __volatile(MPLOCKED "andl $0xB0000000,%0" : "+m" (*p)); +} + +static __inline +int +atomic_intr_handler_is_enabled(atomic_intr_t *p) +{ + int data; + + __asm __volatile("movl %1,%%eax; andl $0x40000000,%%eax" \ + : "=a"(data) : "m"(*p)); + return(data); +} + +static __inline +void +atomic_intr_cond_enter(atomic_intr_t *p, void (*func)(void *), void *arg) +{ + __asm __volatile(MPLOCKED "incl %0; " \ + "1: ;" \ + MPLOCKED "btsl $31,%0; jnc 2f; " \ + "pushl %2; call *%1; addl $4,%%esp; " \ + "jmp 1b; " \ + "2: ;" \ + : "+m" (*p) \ + : "r"(func), "m"(arg) \ + : "ax", "cx", "dx"); +} + +static __inline +void +atomic_intr_cond_exit(atomic_intr_t *p, void (*func)(void *), void *arg) +{ + __asm __volatile(MPLOCKED "decl %0; " \ + MPLOCKED "btrl $31,%0; " \ + "testl $0x3FFFFFFF,%0; jz 1f; " \ + "pushl %2; call *%1; addl $4,%%esp; " \ + "1: ;" \ + : "+m" (*p) \ + : "r"(func), "m"(arg) \ + : "ax", "cx", "dx"); +} + +#endif + #endif /* ! _MACHINE_ATOMIC_H_ */ diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index d261ffae54..682d30aa62 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/i386/isa/Attic/clock.c,v 1.22 2005/04/04 17:49:09 joerg Exp $ + * $DragonFly: src/sys/i386/isa/Attic/clock.c,v 1.23 2005/05/24 20:59:05 dillon Exp $ */ /* @@ -926,13 +926,13 @@ cpu_initclocks() } clkdesc = inthand_add("clk", apic_8254_intr, (inthand2_t *)clkintr, - NULL, &clk_imask, INTR_EXCL | INTR_FAST); + NULL, &clk_imask, INTR_EXCL | INTR_FAST, NULL); INTREN(1 << apic_8254_intr); #else /* APIC_IO */ inthand_add("clk", 0, (inthand2_t *)clkintr, NULL, &clk_imask, - INTR_EXCL | INTR_FAST); + INTR_EXCL | INTR_FAST, NULL); INTREN(IRQ0); #endif /* APIC_IO */ @@ -952,7 +952,7 @@ cpu_initclocks() #endif /* APIC_IO */ inthand_add("rtc", 8, (inthand2_t *)rtcintr, NULL, &stat_imask, - INTR_EXCL | INTR_FAST); + INTR_EXCL | INTR_FAST, NULL); #ifdef APIC_IO INTREN(APIC_IRQ8); @@ -1007,7 +1007,8 @@ cpu_initclocks() setup_8254_mixed_mode(); inthand_add("clk", apic_8254_intr, (inthand2_t *)clkintr, - NULL, &clk_imask, INTR_EXCL | INTR_FAST); + NULL, &clk_imask, + INTR_EXCL | INTR_FAST, NULL); INTREN(1 << apic_8254_intr); } diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c index 8b77b20b7a..4074cd3832 100644 --- a/sys/i386/isa/intr_machdep.c +++ b/sys/i386/isa/intr_machdep.c @@ -35,7 +35,7 @@ * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $ - * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.c,v 1.26 2005/05/23 18:19:53 dillon Exp $ + * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.c,v 1.27 2005/05/24 20:59:05 dillon Exp $ */ /* * This file contains an aggregated module marked: @@ -619,18 +619,21 @@ typedef struct intrec { int intr; intrmask_t *maskptr; int flags; - int enabled; + lwkt_serialize_t serializer; + volatile int in_handler; } intrec; static intrec *intreclist_head[ICU_LEN]; /* - * The interrupt multiplexer calls each of the handlers in turn. The - * ipl is initially quite low. It is raised as necessary for each call - * and lowered after the call. Thus out of order handling is possible - * even for interrupts of the same type. This is probably no more - * harmful than out of order handling in general (not harmful except - * for real time response which we don't support anyway). + * The interrupt multiplexer calls each of the handlers in turn. A handler + * is called only if we can successfully obtain the interlock, meaning + * (1) we aren't recursed and (2) the handler has not been disabled via + * inthand_disabled(). + * + * XXX the IPL is currently raised as necessary for the handler. However, + * IPLs are not MP safe so the IPL code will be removed when the device + * drivers, BIO, and VM no longer depend on it. */ static void intr_mux(void *arg) @@ -640,10 +643,18 @@ intr_mux(void *arg) intrmask_t oldspl; for (pp = arg; (p = *pp) != NULL; pp = &p->next) { - oldspl = splq(p->mask); - if (p->enabled) + if (p->serializer) { + /* + * New handler dispatch method. Note that this + * API includes a handler disablement feature. + */ + lwkt_serialize_handler_call(p->serializer, + p->handler, p->argument); + } else { + oldspl = splq(p->mask); p->handler(p->argument); - splx(oldspl); + splx(oldspl); + } } } @@ -818,7 +829,7 @@ add_intrdesc(intrec *idesc) intrec * inthand_add(const char *name, int irq, inthand2_t handler, void *arg, - intrmask_t *maskptr, int flags) + intrmask_t *maskptr, int flags, lwkt_serialize_t serializer) { intrec *idesc; int errcode = -1; @@ -841,7 +852,7 @@ inthand_add(const char *name, int irq, inthand2_t handler, void *arg, if (name == NULL) name = "???"; - idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK); + idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK); if (idesc->name == NULL) { free(idesc, M_DEVBUF); return NULL; @@ -853,7 +864,7 @@ inthand_add(const char *name, int irq, inthand2_t handler, void *arg, idesc->maskptr = maskptr; idesc->intr = irq; idesc->flags = flags; - idesc->enabled = 1; + idesc->serializer = serializer; /* block this irq */ oldspl = splq(1 << irq); @@ -937,25 +948,6 @@ inthand_remove(intrec *idesc) return (0); } -/* - * These functions are used in tandem with the device disabling its - * interrupt in the device hardware to prevent the handler from being - * run. Otherwise it is possible for a device interrupt to occur, - * schedule the handler, for the device to disable the hard interrupt, - * and for the handler to then run because it has already been scheduled. - */ -void -inthand_disabled(intrec *idesc) -{ - idesc->enabled = 0; -} - -void -inthand_enabled(intrec *idesc) -{ - idesc->enabled = 1; -} - /* * ithread_done() * diff --git a/sys/i386/isa/intr_machdep.h b/sys/i386/isa/intr_machdep.h index b343fa2013..b6231a451d 100644 --- a/sys/i386/isa/intr_machdep.h +++ b/sys/i386/isa/intr_machdep.h @@ -31,16 +31,19 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/intr_machdep.h,v 1.19.2.2 2001/10/14 20:05:50 luigi Exp $ - * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.h,v 1.13 2005/05/23 18:19:53 dillon Exp $ + * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.h,v 1.14 2005/05/24 20:59:05 dillon Exp $ */ #ifndef _I386_ISA_INTR_MACHDEP_H_ #define _I386_ISA_INTR_MACHDEP_H_ -#ifndef _SYS_INTERRUPT_H_ #ifndef LOCORE +#ifndef _SYS_INTERRUPT_H_ #include #endif +#ifndef _SYS_SERIALIZE_H_ +#include +#endif #endif /* @@ -220,11 +223,10 @@ int update_intr_masks (void); * They are subject to change without notice. */ struct intrec *inthand_add(const char *name, int irq, inthand2_t handler, - void *arg, intrmask_t *maskptr, int flags); + void *arg, intrmask_t *maskptr, int flags, + lwkt_serialize_t serializer); int inthand_remove(struct intrec *idesc); -void inthand_enabled(struct intrec *idesc); -void inthand_disabled(struct intrec *idesc); void forward_fastint_remote(void *arg); #endif /* LOCORE */ diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 818685205f..fbe48418cc 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -33,7 +33,7 @@ * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/npx.c,v 1.80.2.3 2001/10/20 19:04:38 tegge Exp $ - * $DragonFly: src/sys/i386/isa/Attic/npx.c,v 1.22 2005/01/31 23:44:35 joerg Exp $ + * $DragonFly: src/sys/i386/isa/Attic/npx.c,v 1.23 2005/05/24 20:59:05 dillon Exp $ */ #include "opt_cpu.h" @@ -404,7 +404,7 @@ npx_probe1(device_t dev) panic("npx: can't get IRQ"); BUS_SETUP_INTR(device_get_parent(dev), dev, r, INTR_TYPE_MISC, - npx_intr, 0, &intr); + npx_intr, 0, &intr, NULL); if (intr == 0) panic("npx: can't create intr"); diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m index 89b27a5c15..5f76af3504 100644 --- a/sys/kern/bus_if.m +++ b/sys/kern/bus_if.m @@ -24,7 +24,7 @@ # SUCH DAMAGE. # # $FreeBSD: src/sys/kern/bus_if.m,v 1.16 1999/10/12 21:35:50 dfr Exp $ -# $DragonFly: src/sys/kern/bus_if.m,v 1.6 2005/05/23 18:19:54 dillon Exp $ +# $DragonFly: src/sys/kern/bus_if.m,v 1.7 2005/05/24 20:58:41 dillon Exp $ # #include @@ -193,6 +193,7 @@ METHOD int setup_intr { driver_intr_t *intr; void *arg; void **cookiep; + lwkt_serialize_t serializer; }; METHOD int teardown_intr { @@ -208,13 +209,20 @@ METHOD int teardown_intr { # since the hard interrupt might be disabled after the interrupt thread # has been scheduled but before it runs. # +# The disable function returns an indication as to whether the handler +# is currently running (i.e. the disablement is racing the execution of +# the interrupt handler). 0 is returned if it isn't, non-zero if it is. +# +# The disablement function does NOT interlock against a running handler, it +# simply prevents future handler calls from being made. +# METHOD void enable_intr { device_t dev; device_t child; void *cookie; } DEFAULT bus_generic_enable_intr; -METHOD void disable_intr { +METHOD int disable_intr { device_t dev; device_t child; void *cookie; diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index dcc618fcf0..f197be9be2 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_bus.c,v 1.54.2.9 2002/10/10 15:13:32 jhb Exp $ - * $DragonFly: src/sys/kern/subr_bus.c,v 1.25 2005/05/23 18:19:54 dillon Exp $ + * $DragonFly: src/sys/kern/subr_bus.c,v 1.26 2005/05/24 20:58:41 dillon Exp $ */ #include "opt_bus.h" @@ -1941,12 +1941,12 @@ 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) + void **cookiep, lwkt_serialize_t serializer) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return(BUS_SETUP_INTR(dev->parent, child, irq, flags, - intr, arg, cookiep)); + intr, arg, cookiep, serializer)); else return(EINVAL); } @@ -1962,11 +1962,13 @@ bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq, return(EINVAL); } -void +int bus_generic_disable_intr(device_t dev, device_t child, void *cookie) { if (dev->parent) - BUS_DISABLE_INTR(dev->parent, child, cookie); + return(BUS_DISABLE_INTR(dev->parent, child, cookie)); + else + return(0); } void @@ -2160,12 +2162,13 @@ 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_intr_t handler, void *arg, + void **cookiep, lwkt_serialize_t serializer) { if (dev->parent == 0) return(EINVAL); return(BUS_SETUP_INTR(dev->parent, dev, r, flags, handler, arg, - cookiep)); + cookiep, serializer)); } int @@ -2183,11 +2186,13 @@ bus_enable_intr(device_t dev, void *cookie) BUS_ENABLE_INTR(dev->parent, dev, cookie); } -void +int bus_disable_intr(device_t dev, void *cookie) { if (dev->parent) - BUS_DISABLE_INTR(dev->parent, dev, cookie); + return(BUS_DISABLE_INTR(dev->parent, dev, cookie)); + else + return(0); } int @@ -2278,7 +2283,7 @@ root_print_child(device_t dev, device_t child) static int root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg, - void **cookiep) + void **cookiep, lwkt_serialize_t serializer) { /* * If an interrupt mapping gets to here something bad has happened. diff --git a/sys/net/altq/altq_cbq.c b/sys/net/altq/altq_cbq.c index 5e237c04f7..f84556e35e 100644 --- a/sys/net/altq/altq_cbq.c +++ b/sys/net/altq/altq_cbq.c @@ -1,5 +1,5 @@ /* $KAME: altq_cbq.c,v 1.20 2004/04/17 10:54:48 kjc Exp $ */ -/* $DragonFly: src/sys/net/altq/altq_cbq.c,v 1.1 2005/02/11 22:25:57 joerg Exp $ */ +/* $DragonFly: src/sys/net/altq/altq_cbq.c,v 1.2 2005/05/24 20:59:05 dillon Exp $ */ /* * Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved. @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,8 @@ #include #include +#include + /* * Forward Declarations. */ @@ -154,11 +157,13 @@ cbq_request(struct ifaltq *ifq, int req, void *arg) { cbq_state_t *cbqp = (cbq_state_t *)ifq->altq_disc; + crit_enter(); switch (req) { case ALTRQ_PURGE: cbq_purge(cbqp); break; } + crit_exit(); return (0); } @@ -199,14 +204,14 @@ int cbq_pfattach(struct pf_altq *a) { struct ifnet *ifp; - int s, error; + int error; if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL) return (EINVAL); - s = splimp(); + crit_enter(); error = altq_attach(&ifp->if_snd, ALTQT_CBQ, a->altq_disc, cbq_enqueue, cbq_dequeue, cbq_request, NULL, NULL); - splx(s); + crit_exit(); return (error); } @@ -435,7 +440,6 @@ cbq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes) * layer (e.g. ether_output). cbq_enqueue queues the given packet * to the cbq, then invokes the driver's start routine. * - * Assumptions: called in splimp * Returns: 0 if the queueing is successful. * ENOBUFS if a packet dropping occurred as a result of * the queueing. @@ -446,7 +450,7 @@ cbq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) { cbq_state_t *cbqp = (cbq_state_t *)ifq->altq_disc; struct rm_class *cl; - int len; + int len; /* grab class set by classifier */ if ((m->m_flags & M_PKTHDR) == 0) { @@ -466,17 +470,20 @@ cbq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) return (ENOBUFS); } } + crit_enter(); cl->pktattr_ = NULL; len = m_pktlen(m); if (rmc_queue_packet(cl, m) != 0) { /* drop occurred. some mbuf was freed in rmc_queue_packet. */ PKTCNTR_ADD(&cl->stats_.drop_cnt, len); + crit_exit(); return (ENOBUFS); } /* successfully queued. */ ++cbqp->cbq_qlen; ++ifq->ifq_len; + crit_exit(); return (0); } @@ -486,6 +493,7 @@ cbq_dequeue(struct ifaltq *ifq, int op) cbq_state_t *cbqp = (cbq_state_t *)ifq->altq_disc; struct mbuf *m; + crit_enter(); m = rmc_dequeue_next(&cbqp->ifnp, op); if (m && op == ALTDQ_REMOVE) { @@ -495,13 +503,14 @@ cbq_dequeue(struct ifaltq *ifq, int op) /* Update the class. */ rmc_update_class_util(&cbqp->ifnp); } + crit_exit(); return (m); } /* * void * cbqrestart(queue_t *) - Restart sending of data. - * called from rmc_restart in splimp via timeout after waking up + * called from rmc_restart in a critical section via timeout after waking up * a suspended class. * Returns: NONE */ @@ -530,11 +539,11 @@ static void cbq_purge(cbq_state_t *cbqp) { struct rm_class *cl; - int i; - - for (i = 0; i < CBQ_MAX_CLASSES; i++) + int i; + for (i = 0; i < CBQ_MAX_CLASSES; i++) { if ((cl = cbqp->cbq_class_tbl[i]) != NULL) rmc_dropall(cl); + } if (ifq_is_enabled(cbqp->ifnp.ifq_)) cbqp->ifnp.ifq_->ifq_len = 0; } diff --git a/sys/net/altq/altq_hfsc.c b/sys/net/altq/altq_hfsc.c index 0efcbe413a..4b765086f2 100644 --- a/sys/net/altq/altq_hfsc.c +++ b/sys/net/altq/altq_hfsc.c @@ -1,5 +1,5 @@ /* $KAME: altq_hfsc.c,v 1.25 2004/04/17 10:54:48 kjc Exp $ */ -/* $DragonFly: src/sys/net/altq/altq_hfsc.c,v 1.1 2005/02/11 22:25:57 joerg Exp $ */ +/* $DragonFly: src/sys/net/altq/altq_hfsc.c,v 1.2 2005/05/24 20:59:05 dillon Exp $ */ /* * Copyright (c) 1997-1999 Carnegie Mellon University. All Rights Reserved. @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,8 @@ #include #include +#include + /* * function prototypes */ @@ -308,11 +311,13 @@ hfsc_request(struct ifaltq *ifq, int req, void *arg) { struct hfsc_if *hif = (struct hfsc_if *)ifq->altq_disc; + crit_enter(); switch (req) { case ALTRQ_PURGE: hfsc_purge(hif); break; } + crit_exit(); return (0); } @@ -615,6 +620,7 @@ hfsc_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) m_freem(m); return (ENOBUFS); } + crit_enter(); if (m->m_pkthdr.fw_flags & ALTQ_MBUF_TAGGED) cl = clh_to_clp(hif, m->m_pkthdr.altq_qid); else @@ -623,6 +629,7 @@ hfsc_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) cl = hif->hif_defaultclass; if (cl == NULL) { m_freem(m); + crit_exit(); return (ENOBUFS); } } @@ -631,6 +638,7 @@ hfsc_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) if (hfsc_addq(cl, m) != 0) { /* drop occurred. mbuf was freed in hfsc_addq. */ PKTCNTR_ADD(&cl->cl_stats.drop_cnt, len); + crit_exit(); return (ENOBUFS); } ifq->ifq_len++; @@ -639,7 +647,7 @@ hfsc_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) /* successfully queued. */ if (qlen(cl->cl_q) == 1) set_active(cl, m_pktlen(m)); - + crit_exit(); return (0); } @@ -667,6 +675,7 @@ hfsc_dequeue(struct ifaltq *ifq, int op) return (NULL); } + crit_enter(); cur_time = read_machclk(); if (op == ALTDQ_REMOVE && hif->hif_pollcache != NULL) { @@ -700,7 +709,8 @@ hfsc_dequeue(struct ifaltq *ifq, int op) if (fits > 0) printf("%d fit but none found\n",fits); #endif - return (NULL); + m = NULL; + goto done; } /* * update parent's cl_cvtmin. @@ -717,7 +727,7 @@ hfsc_dequeue(struct ifaltq *ifq, int op) if (op == ALTDQ_POLL) { hif->hif_pollcache = cl; m = hfsc_pollq(cl); - return (m); + goto done; } } @@ -747,7 +757,8 @@ hfsc_dequeue(struct ifaltq *ifq, int op) /* the class becomes passive */ set_passive(cl); } - +done: + crit_exit(); return (m); } diff --git a/sys/net/altq/altq_priq.c b/sys/net/altq/altq_priq.c index b759ffbbc2..9ea2eeb0d7 100644 --- a/sys/net/altq/altq_priq.c +++ b/sys/net/altq/altq_priq.c @@ -1,5 +1,5 @@ /* $KAME: altq_priq.c,v 1.12 2004/04/17 10:54:48 kjc Exp $ */ -/* $DragonFly: src/sys/net/altq/altq_priq.c,v 1.1 2005/02/11 22:25:57 joerg Exp $ */ +/* $DragonFly: src/sys/net/altq/altq_priq.c,v 1.2 2005/05/24 20:59:05 dillon Exp $ */ /* * Copyright (C) 2000-2003 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,8 @@ #include #include +#include + /* * function prototypes */ @@ -217,11 +220,13 @@ priq_request(struct ifaltq *ifq, int req, void *arg) { struct priq_if *pif = (struct priq_if *)ifq->altq_disc; + crit_enter(); switch (req) { case ALTRQ_PURGE: priq_purge(pif); break; } + crit_exit(); return (0); } @@ -375,15 +380,20 @@ priq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) { struct priq_if *pif = (struct priq_if *)ifq->altq_disc; struct priq_class *cl; + int error; int len; + crit_enter(); + /* grab class set by classifier */ if ((m->m_flags & M_PKTHDR) == 0) { /* should not happen */ if_printf(ifq->altq_ifp, "altq: packet does not have pkthdr\n"); m_freem(m); - return (ENOBUFS); + error = ENOBUFS; + goto done; } + if (m->m_pkthdr.fw_flags & ALTQ_MBUF_TAGGED) cl = clh_to_clp(pif, m->m_pkthdr.altq_qid); else @@ -392,7 +402,8 @@ priq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) cl = pif->pif_default; if (cl == NULL) { m_freem(m); - return (ENOBUFS); + error = ENOBUFS; + goto done; } } cl->cl_pktattr = NULL; @@ -400,12 +411,14 @@ priq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) if (priq_addq(cl, m) != 0) { /* drop occurred. mbuf was freed in priq_addq. */ PKTCNTR_ADD(&cl->cl_dropcnt, len); - return (ENOBUFS); + error = ENOBUFS; + goto done; } ifq->ifq_len++; - - /* successfully queued. */ - return (0); + error = 0; +done: + crit_exit(); + return (error); } /* @@ -430,10 +443,14 @@ priq_dequeue(struct ifaltq *ifq, int op) return (NULL); } + crit_enter(); + m = NULL; for (pri = pif->pif_maxpri; pri >= 0; pri--) { if ((cl = pif->pif_classes[pri]) != NULL && !qempty(cl->cl_q)) { - if (op == ALTDQ_POLL) - return (priq_pollq(cl)); + if (op == ALTDQ_POLL) { + m = priq_pollq(cl); + break; + } m = priq_getq(cl); if (m != NULL) { @@ -442,10 +459,11 @@ priq_dequeue(struct ifaltq *ifq, int op) cl->cl_period++; PKTCNTR_ADD(&cl->cl_xmitcnt, m_pktlen(m)); } - return (m); + break; } } - return (NULL); + crit_exit(); + return (m); } static int diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index d233fadc95..b0c13ff453 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -1,5 +1,5 @@ /* $KAME: altq_subr.c,v 1.23 2004/04/20 16:10:06 itojun Exp $ */ -/* $DragonFly: src/sys/net/altq/altq_subr.c,v 1.2 2005/04/04 17:08:16 joerg Exp $ */ +/* $DragonFly: src/sys/net/altq/altq_subr.c,v 1.3 2005/05/24 20:59:05 dillon Exp $ */ /* * Copyright (C) 1997-2003 @@ -196,7 +196,9 @@ tbr_dequeue(struct ifaltq *ifq, int op) struct mbuf *m; int64_t interval; uint64_t now; + int s; + s = splimp(); tbr = ifq->altq_tbr; if (op == ALTDQ_REMOVE && tbr->tbr_lastop == ALTDQ_POLL) { /* if this is a remove after poll, bypass tbr check */ @@ -215,8 +217,10 @@ tbr_dequeue(struct ifaltq *ifq, int op) tbr->tbr_last = now; } /* if token is still negative, don't allow dequeue */ - if (tbr->tbr_token <= 0) + if (tbr->tbr_token <= 0) { + splx(s); return (NULL); + } } if (ifq_is_enabled(ifq)) @@ -229,6 +233,7 @@ tbr_dequeue(struct ifaltq *ifq, int op) if (m != NULL && op == ALTDQ_REMOVE) tbr->tbr_token -= TBR_SCALE(m_pktlen(m)); tbr->tbr_lastop = op; + splx(s); return (m); } diff --git a/sys/net/i4b/capi/iavc/iavc_isa.c b/sys/net/i4b/capi/iavc/iavc_isa.c index 391ae7eca9..ebf956a771 100644 --- a/sys/net/i4b/capi/iavc/iavc_isa.c +++ b/sys/net/i4b/capi/iavc/iavc_isa.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i4b/capi/iavc/iavc_isa.c,v 1.1.2.1 2001/08/10 14:08:34 obrien Exp $ - * $DragonFly: src/sys/net/i4b/capi/iavc/iavc_isa.c,v 1.5 2004/04/16 15:40:21 joerg Exp $ + * $DragonFly: src/sys/net/i4b/capi/iavc/iavc_isa.c,v 1.6 2005/05/24 20:59:05 dillon Exp $ */ #include @@ -185,6 +185,7 @@ iavc_isa_attach(device_t dev) void *ih = 0; int unit = device_get_unit(dev); int irq; + int error; sc = iavc_find_sc(unit); /* get softc */ @@ -243,10 +244,10 @@ iavc_isa_attach(device_t dev) /* setup the interrupt */ - if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, - (void(*)(void*))iavc_isa_intr, - sc, &ih)) - { + error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + (void(*)(void*))iavc_isa_intr, + sc, &ih, NULL); + if (error) { printf("iavc%d: irq setup failed\n", unit); bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0], diff --git a/sys/net/i4b/capi/iavc/iavc_pci.c b/sys/net/i4b/capi/iavc/iavc_pci.c index 44d0ed5ddd..e2aa1db15c 100644 --- a/sys/net/i4b/capi/iavc/iavc_pci.c +++ b/sys/net/i4b/capi/iavc/iavc_pci.c @@ -26,7 +26,7 @@ * The AVM ISDN controllers' PCI bus attachment handling. * * $FreeBSD: src/sys/i4b/capi/iavc/iavc_pci.c,v 1.1.2.1 2001/08/10 14:08:34 obrien Exp $ - * $DragonFly: src/sys/net/i4b/capi/iavc/iavc_pci.c,v 1.5 2004/04/16 15:40:21 joerg Exp $ + * $DragonFly: src/sys/net/i4b/capi/iavc/iavc_pci.c,v 1.6 2005/05/24 20:59:05 dillon Exp $ */ #include @@ -125,6 +125,7 @@ iavc_pci_attach(device_t dev) void *ih = 0; u_int16_t did = pci_get_device(dev); int unit = device_get_unit(dev), ret; + int error; /* check max unit range */ @@ -252,9 +253,10 @@ iavc_pci_attach(device_t dev) /* setup the interrupt */ - if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, - (void(*)(void*))iavc_pci_intr, - sc, &ih)) { + error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + (void(*)(void*))iavc_pci_intr, + sc, &ih, NULL); + if (error) { printf("iavc%d: irq setup failed\n", unit); return(ENXIO); } diff --git a/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c index 59916d8e40..bf254f4af7 100644 --- a/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c +++ b/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c @@ -36,7 +36,7 @@ * $Id: i4b_ifpi_pci.c,v 1.4 2000/06/02 11:58:56 hm Exp $ * * $FreeBSD: src/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.6.2.1 2001/08/10 14:08:37 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.8 2004/09/16 04:36:32 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c,v 1.9 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Fri Jan 12 17:01:26 2001] * @@ -548,7 +548,8 @@ avma1pp_attach_avma1pp(device_t dev) goto fail; } - error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, avma1pp_intr, sc, &ih); + error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + avma1pp_intr, sc, &ih, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq); diff --git a/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c b/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c index 45bcf54678..0a52e973e0 100644 --- a/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c +++ b/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c @@ -36,7 +36,7 @@ * $Id$ * * $FreeBSD: src/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c,v 1.6.2.2 2002/05/15 08:12:42 gj Exp $ - * $DragonFly: src/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c,v 1.7 2004/09/16 04:36:32 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c,v 1.8 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Fri Jan 12 17:01:26 2001] * @@ -504,7 +504,8 @@ avma1pp2_attach_avma1pp(device_t dev) goto fail; } - error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, avma1pp2_intr, sc, &ih); + error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + avma1pp2_intr, sc, &ih, NULL); if (error) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq); diff --git a/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c b/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c index e1e467c044..9a325334be 100644 --- a/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c +++ b/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c @@ -34,7 +34,7 @@ * --------------------------------------------------- * * $FreeBSD: src/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c,v 1.5.2.1 2001/08/10 14:08:37 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c,v 1.5 2004/09/16 04:36:32 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c,v 1.6 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Fri Jan 12 17:05:28 2001] * @@ -518,8 +518,9 @@ avm_pnp_attach(device_t dev) /* not needed */ sc->sc_irq = rman_get_start(sc->sc_resources.irq); - bus_setup_intr(dev,sc->sc_resources.irq,INTR_TYPE_NET, - (void(*)(void*))avm_pnp_intr, sc,&ih); + bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + (void(*)(void*))avm_pnp_intr, sc, + &ih, NULL); sc->sc_unit = unit; /* end of new-bus stuff */ diff --git a/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c b/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c index 8178161b61..883398c4da 100644 --- a/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c +++ b/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c @@ -36,7 +36,7 @@ * $Id: i4b_ihfc_pnp.c,v 1.9 2000/09/19 13:50:36 hm Exp $ * * $FreeBSD: src/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c,v 1.5.2.1 2001/08/10 14:08:37 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c,v 1.3 2003/08/07 21:17:26 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c,v 1.4 2005/05/24 20:59:05 dillon Exp $ * *---------------------------------------------------------------------------*/ @@ -212,8 +212,9 @@ ihfc_pnp_probe(device_t dev) /* setup interrupt routine now to avvoid stray * * interrupts. */ - bus_setup_intr(dev, S_IRQ, INTR_TYPE_NET, (void(*)(void*)) - HFC_INTR, sc, &dummy); + bus_setup_intr(dev, S_IRQ, INTR_TYPE_NET, + (void(*)(void*)), HFC_INTR, sc, + &dummy, NULL); flag = 1; @@ -305,7 +306,7 @@ ihfc_isa_probe(device_t dev) * interrupts. */ bus_setup_intr(dev, S_IRQ, INTR_TYPE_NET, (void(*)(void*)) - HFC_INTR, sc, &dummy); + HFC_INTR, sc, &dummy, NULL); flag = 1; diff --git a/sys/net/i4b/layer1/isic/i4b_avm_a1.c b/sys/net/i4b/layer1/isic/i4b_avm_a1.c index 15aa9839a1..327af8819c 100644 --- a/sys/net/i4b/layer1/isic/i4b_avm_a1.c +++ b/sys/net/i4b/layer1/isic/i4b_avm_a1.c @@ -36,7 +36,7 @@ * ------------------------------------------------------------ * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_avm_a1.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_avm_a1.c,v 1.4 2003/08/07 21:17:26 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_avm_a1.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Jan 24 09:25:23 2001] * @@ -257,7 +257,7 @@ isic_probe_avma1(device_t dev) /* register interupt routine */ bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void *))(isicintr), - sc, &ih); + sc, &ih, NULL); /* check IRQ validity */ diff --git a/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c b/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c index 4f799265cb..ca116ba948 100644 --- a/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c +++ b/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c @@ -28,7 +28,7 @@ * ================================================================ * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_elsa_pcc16.c,v 1.5.2.2 2001/10/24 14:17:20 hm Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c,v 1.4 2003/08/07 21:54:31 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Oct 24 16:15:26 2001] * @@ -356,9 +356,9 @@ isic_probe_Epcc16(device_t dev) } /* register interupt routine */ - bus_setup_intr(dev,sc->sc_resources.irq,INTR_TYPE_NET, + bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void *))(isicintr), - sc,&ih); + sc, &ih, NULL); return (0); diff --git a/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c b/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c index 4644cacfe5..a4f8e745b3 100644 --- a/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c +++ b/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c @@ -28,7 +28,7 @@ * ================================================================== * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_elsa_qs1p.c,v 1.6.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c,v 1.4 2003/08/07 21:54:31 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Jan 24 09:09:28 2001] * @@ -325,9 +325,9 @@ eqs1p_pci_attach(device_t dev) return(ENXIO); } - if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + if (bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void*))isicintr, - sc, &ih)) + sc, &ih, NULL)) { printf("isic%d: Couldn't set up irq for ELSA MicroLink ISDN/PCI!\n", unit); isic_detach_common(dev); diff --git a/sys/net/i4b/layer1/isic/i4b_isic_pnp.c b/sys/net/i4b/layer1/isic/i4b_isic_pnp.c index 106d250400..c8fa29c2e9 100644 --- a/sys/net/i4b/layer1/isic/i4b_isic_pnp.c +++ b/sys/net/i4b/layer1/isic/i4b_isic_pnp.c @@ -38,7 +38,7 @@ * -------------------------------- * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_isic_pnp.c,v 1.5.2.2 2001/12/10 12:18:11 hm Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_isic_pnp.c,v 1.4 2003/08/07 21:54:31 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_isic_pnp.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Fri Jan 26 14:01:04 2001] * @@ -322,9 +322,9 @@ isic_pnp_attach(device_t dev) else { /* setup intr routine */ - bus_setup_intr(dev,sc->sc_resources.irq,INTR_TYPE_NET, + bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void*))isicintr, - sc,&ih); + sc, &ih, NULL); return 0; } } diff --git a/sys/net/i4b/layer1/isic/i4b_itk_ix1.c b/sys/net/i4b/layer1/isic/i4b_itk_ix1.c index cf623701f9..be8bfa4449 100644 --- a/sys/net/i4b/layer1/isic/i4b_itk_ix1.c +++ b/sys/net/i4b/layer1/isic/i4b_itk_ix1.c @@ -29,7 +29,7 @@ * last edit-date: [Wed Jan 24 09:27:06 2001] * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_itk_ix1.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_itk_ix1.c,v 1.3 2003/08/07 21:17:26 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_itk_ix1.c,v 1.4 2005/05/24 20:59:05 dillon Exp $ * *--------------------------------------------------------------------------- * @@ -281,9 +281,8 @@ isic_probe_itkix1(device_t dev) #endif bus_setup_intr(dev, sc->sc_resources.irq, - INTR_TYPE_NET, - (void(*)(void *))(isicintr), - sc, &ih); + INTR_TYPE_NET, (void(*)(void *))(isicintr), + sc, &ih, NULL); #if defined(ITK_PROBE_DEBUG) printf("done.\n"); diff --git a/sys/net/i4b/layer1/isic/i4b_tel_s016.c b/sys/net/i4b/layer1/isic/i4b_tel_s016.c index 7b6c699cbe..1a0c44a37e 100644 --- a/sys/net/i4b/layer1/isic/i4b_tel_s016.c +++ b/sys/net/i4b/layer1/isic/i4b_tel_s016.c @@ -38,7 +38,7 @@ * ================================================================= * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_tel_s016.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s016.c,v 1.4 2004/05/04 12:03:49 hmp Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s016.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Jan 24 09:27:24 2001] * @@ -306,9 +306,9 @@ isic_probe_s016(device_t dev) /* register interupt routine */ bus_setup_intr(dev, sc->sc_resources.irq, - INTR_TYPE_NET, - (void(*)(void *))(isicintr), - sc, &ih); + INTR_TYPE_NET, + (void(*)(void *))(isicintr), + sc, &ih, NULL); /* get the irq number */ diff --git a/sys/net/i4b/layer1/isic/i4b_tel_s0163.c b/sys/net/i4b/layer1/isic/i4b_tel_s0163.c index 49ee07b69c..7dbc1b4857 100644 --- a/sys/net/i4b/layer1/isic/i4b_tel_s0163.c +++ b/sys/net/i4b/layer1/isic/i4b_tel_s0163.c @@ -38,7 +38,7 @@ * ======================================================== * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_tel_s0163.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s0163.c,v 1.3 2003/08/07 21:17:26 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s0163.c,v 1.4 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Jan 24 09:27:40 2001] * @@ -343,9 +343,9 @@ isic_probe_s0163(device_t dev) /* register interupt routine */ bus_setup_intr(dev, sc->sc_resources.irq, - INTR_TYPE_NET, - (void(*)(void *))(isicintr), - sc, &ih); + INTR_TYPE_NET, + (void(*)(void *))(isicintr), + sc, &ih, NULL); return (0); } diff --git a/sys/net/i4b/layer1/isic/i4b_tel_s08.c b/sys/net/i4b/layer1/isic/i4b_tel_s08.c index 1643ed34d1..dd37f3ce29 100644 --- a/sys/net/i4b/layer1/isic/i4b_tel_s08.c +++ b/sys/net/i4b/layer1/isic/i4b_tel_s08.c @@ -38,7 +38,7 @@ * ================================================================ * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_tel_s08.c,v 1.5.2.1 2001/08/10 14:08:39 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s08.c,v 1.4 2004/05/04 12:03:49 hmp Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s08.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Jan 24 09:27:58 2001] * @@ -272,7 +272,7 @@ isic_probe_s08(device_t dev) bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void *))(isicintr), - sc, &ih); + sc, &ih, NULL); return (0); } diff --git a/sys/net/i4b/layer1/isic/i4b_usr_sti.c b/sys/net/i4b/layer1/isic/i4b_usr_sti.c index 1af259c415..81aa361e21 100644 --- a/sys/net/i4b/layer1/isic/i4b_usr_sti.c +++ b/sys/net/i4b/layer1/isic/i4b_usr_sti.c @@ -28,7 +28,7 @@ * ------------------------------------------------------------- * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_usr_sti.c,v 1.5.2.1 2001/08/10 14:08:39 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_usr_sti.c,v 1.4 2003/08/07 21:17:26 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_usr_sti.c,v 1.5 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Wed Jan 24 09:28:12 2001] * @@ -402,7 +402,7 @@ isic_probe_usrtai(device_t dev) /* register interrupt routine */ bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void *))(isicintr), - sc, &ih); + sc, &ih, NULL); /* check IRQ validity */ diff --git a/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c b/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c index e0cf6393a5..622d6953da 100644 --- a/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c +++ b/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c @@ -34,7 +34,7 @@ * ---------------------------------------- * * $FreeBSD: src/sys/i4b/layer1/itjc/i4b_itjc_pci.c,v 1.1.2.1 2001/08/10 14:08:39 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c,v 1.9 2005/01/23 13:47:24 joerg Exp $ + * $DragonFly: src/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c,v 1.10 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Thu Jan 11 11:29:38 2001] * @@ -1573,7 +1573,7 @@ itjc_attach(device_t dev) ++res_init_level; error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, - itjc_intr, sc, &ih); + itjc_intr, sc, &ih, NULL); if (error) { diff --git a/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c b/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c index a52d341ebc..d907ed4f7a 100644 --- a/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c +++ b/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c @@ -28,7 +28,7 @@ * ---------------------------------------- * * $FreeBSD: src/sys/i4b/layer1/iwic/i4b_iwic_pci.c,v 1.6.2.1 2001/08/10 14:08:40 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c,v 1.3 2003/08/07 21:17:28 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c,v 1.4 2005/05/24 20:59:05 dillon Exp $ * * last edit-date: [Tue Jan 16 10:53:03 2001] * @@ -235,9 +235,9 @@ iwic_pci_attach(device_t dev) sc->sc_I430state = ST_F3N; /* Deactivated */ sc->enabled = FALSE; - if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, + if (bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, (void(*)(void*))iwic_pci_intr, - sc, &ih)) + sc, &ih, NULL)) { printf("iwic%d: Couldn't set up irq!\n", unit); return(ENXIO); diff --git a/sys/net/if.c b/sys/net/if.c index 981c384799..9dae7caa35 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -32,7 +32,7 @@ * * @(#)if.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/net/if.c,v 1.185 2004/03/13 02:35:03 brooks Exp $ - * $DragonFly: src/sys/net/if.c,v 1.33 2005/04/15 18:39:13 dillon Exp $ + * $DragonFly: src/sys/net/if.c,v 1.34 2005/05/24 20:58:43 dillon Exp $ */ #include "opt_compat.h" @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -65,6 +66,8 @@ #include #include +#include + #if defined(INET) || defined(INET6) /*XXX*/ #include @@ -1812,11 +1815,14 @@ static int ifq_classic_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pa __unused) { + crit_enter(); if (IF_QFULL(ifq)) { m_freem(m); + crit_exit(); return(ENOBUFS); } else { IF_ENQUEUE(ifq, m); + crit_exit(); return(0); } } @@ -1826,6 +1832,7 @@ ifq_classic_dequeue(struct ifaltq *ifq, int op) { struct mbuf *m; + crit_enter(); switch (op) { case ALTDQ_POLL: IF_POLL(ifq, m); @@ -1836,13 +1843,14 @@ ifq_classic_dequeue(struct ifaltq *ifq, int op) default: panic("unsupported ALTQ dequeue op: %d", op); } - + crit_exit(); return(m); } static int ifq_classic_request(struct ifaltq *ifq, int req, void *arg) { + crit_enter(); switch (req) { case ALTRQ_PURGE: IF_DRAIN(ifq); @@ -1850,6 +1858,7 @@ ifq_classic_request(struct ifaltq *ifq, int req, void *arg) default: panic("unspported ALTQ request: %d", req); } - + crit_exit(); return(0); } + diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 6f0f805d70..53e456d427 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.26.2.10 2003/02/22 13:16:45 imp Exp $ - * $DragonFly: src/sys/platform/pc32/i386/nexus.c,v 1.13 2005/05/23 18:19:51 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/nexus.c,v 1.14 2005/05/24 20:59:05 dillon Exp $ */ /* @@ -96,11 +96,10 @@ 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 **); + void (*)(void *), void *, + void **, lwkt_serialize_t); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); -static void nexus_enable_intr(device_t, device_t, void *); -static void nexus_disable_intr(device_t, device_t, void *); static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); static void nexus_delete_resource(device_t, device_t, int, int); @@ -125,8 +124,6 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), - DEVMETHOD(bus_disable_intr, nexus_disable_intr), - DEVMETHOD(bus_enable_intr, nexus_enable_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), @@ -508,7 +505,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, void (*ihand)(void *), void *arg, + void **cookiep, lwkt_serialize_t serializer) { intrmask_t *mask; driver_t *driver; @@ -560,7 +558,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, return (error); *cookiep = inthand_add(device_get_nameunit(child), irq->r_start, - ihand, arg, mask, icflags); + ihand, arg, mask, icflags, serializer); if (*cookiep == NULL) error = EINVAL; /* XXX ??? */ @@ -573,18 +571,6 @@ nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) return (inthand_remove(ih)); } -static void -nexus_disable_intr(device_t dev, device_t child, void *ih) -{ - inthand_disabled(ih); -} - -static void -nexus_enable_intr(device_t dev, device_t child, void *ih) -{ - inthand_enabled(ih); -} - static int nexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count) { diff --git a/sys/platform/pc32/isa/clock.c b/sys/platform/pc32/isa/clock.c index 9e50d1ddf5..0dd7a51909 100644 --- a/sys/platform/pc32/isa/clock.c +++ b/sys/platform/pc32/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.22 2005/04/04 17:49:09 joerg Exp $ + * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.23 2005/05/24 20:59:05 dillon Exp $ */ /* @@ -926,13 +926,13 @@ cpu_initclocks() } clkdesc = inthand_add("clk", apic_8254_intr, (inthand2_t *)clkintr, - NULL, &clk_imask, INTR_EXCL | INTR_FAST); + NULL, &clk_imask, INTR_EXCL | INTR_FAST, NULL); INTREN(1 << apic_8254_intr); #else /* APIC_IO */ inthand_add("clk", 0, (inthand2_t *)clkintr, NULL, &clk_imask, - INTR_EXCL | INTR_FAST); + INTR_EXCL | INTR_FAST, NULL); INTREN(IRQ0); #endif /* APIC_IO */ @@ -952,7 +952,7 @@ cpu_initclocks() #endif /* APIC_IO */ inthand_add("rtc", 8, (inthand2_t *)rtcintr, NULL, &stat_imask, - INTR_EXCL | INTR_FAST); + INTR_EXCL | INTR_FAST, NULL); #ifdef APIC_IO INTREN(APIC_IRQ8); @@ -1007,7 +1007,8 @@ cpu_initclocks() setup_8254_mixed_mode(); inthand_add("clk", apic_8254_intr, (inthand2_t *)clkintr, - NULL, &clk_imask, INTR_EXCL | INTR_FAST); + NULL, &clk_imask, + INTR_EXCL | INTR_FAST, NULL); INTREN(1 << apic_8254_intr); } diff --git a/sys/platform/pc32/isa/intr_machdep.c b/sys/platform/pc32/isa/intr_machdep.c index e6b77f261a..a271f15dc5 100644 --- a/sys/platform/pc32/isa/intr_machdep.c +++ b/sys/platform/pc32/isa/intr_machdep.c @@ -35,7 +35,7 @@ * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $ - * $DragonFly: src/sys/platform/pc32/isa/intr_machdep.c,v 1.26 2005/05/23 18:19:53 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/intr_machdep.c,v 1.27 2005/05/24 20:59:05 dillon Exp $ */ /* * This file contains an aggregated module marked: @@ -619,18 +619,21 @@ typedef struct intrec { int intr; intrmask_t *maskptr; int flags; - int enabled; + lwkt_serialize_t serializer; + volatile int in_handler; } intrec; static intrec *intreclist_head[ICU_LEN]; /* - * The interrupt multiplexer calls each of the handlers in turn. The - * ipl is initially quite low. It is raised as necessary for each call - * and lowered after the call. Thus out of order handling is possible - * even for interrupts of the same type. This is probably no more - * harmful than out of order handling in general (not harmful except - * for real time response which we don't support anyway). + * The interrupt multiplexer calls each of the handlers in turn. A handler + * is called only if we can successfully obtain the interlock, meaning + * (1) we aren't recursed and (2) the handler has not been disabled via + * inthand_disabled(). + * + * XXX the IPL is currently raised as necessary for the handler. However, + * IPLs are not MP safe so the IPL code will be removed when the device + * drivers, BIO, and VM no longer depend on it. */ static void intr_mux(void *arg) @@ -640,10 +643,18 @@ intr_mux(void *arg) intrmask_t oldspl; for (pp = arg; (p = *pp) != NULL; pp = &p->next) { - oldspl = splq(p->mask); - if (p->enabled) + if (p->serializer) { + /* + * New handler dispatch method. Note that this + * API includes a handler disablement feature. + */ + lwkt_serialize_handler_call(p->serializer, + p->handler, p->argument); + } else { + oldspl = splq(p->mask); p->handler(p->argument); - splx(oldspl); + splx(oldspl); + } } } @@ -818,7 +829,7 @@ add_intrdesc(intrec *idesc) intrec * inthand_add(const char *name, int irq, inthand2_t handler, void *arg, - intrmask_t *maskptr, int flags) + intrmask_t *maskptr, int flags, lwkt_serialize_t serializer) { intrec *idesc; int errcode = -1; @@ -841,7 +852,7 @@ inthand_add(const char *name, int irq, inthand2_t handler, void *arg, if (name == NULL) name = "???"; - idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK); + idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK); if (idesc->name == NULL) { free(idesc, M_DEVBUF); return NULL; @@ -853,7 +864,7 @@ inthand_add(const char *name, int irq, inthand2_t handler, void *arg, idesc->maskptr = maskptr; idesc->intr = irq; idesc->flags = flags; - idesc->enabled = 1; + idesc->serializer = serializer; /* block this irq */ oldspl = splq(1 << irq); @@ -937,25 +948,6 @@ inthand_remove(intrec *idesc) return (0); } -/* - * These functions are used in tandem with the device disabling its - * interrupt in the device hardware to prevent the handler from being - * run. Otherwise it is possible for a device interrupt to occur, - * schedule the handler, for the device to disable the hard interrupt, - * and for the handler to then run because it has already been scheduled. - */ -void -inthand_disabled(intrec *idesc) -{ - idesc->enabled = 0; -} - -void -inthand_enabled(intrec *idesc) -{ - idesc->enabled = 1; -} - /* * ithread_done() * diff --git a/sys/platform/pc32/isa/intr_machdep.h b/sys/platform/pc32/isa/intr_machdep.h index 432fb327f1..7a5eef078f 100644 --- a/sys/platform/pc32/isa/intr_machdep.h +++ b/sys/platform/pc32/isa/intr_machdep.h @@ -31,16 +31,19 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/intr_machdep.h,v 1.19.2.2 2001/10/14 20:05:50 luigi Exp $ - * $DragonFly: src/sys/platform/pc32/isa/intr_machdep.h,v 1.13 2005/05/23 18:19:53 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/intr_machdep.h,v 1.14 2005/05/24 20:59:05 dillon Exp $ */ #ifndef _I386_ISA_INTR_MACHDEP_H_ #define _I386_ISA_INTR_MACHDEP_H_ -#ifndef _SYS_INTERRUPT_H_ #ifndef LOCORE +#ifndef _SYS_INTERRUPT_H_ #include #endif +#ifndef _SYS_SERIALIZE_H_ +#include +#endif #endif /* @@ -220,11 +223,10 @@ int update_intr_masks (void); * They are subject to change without notice. */ struct intrec *inthand_add(const char *name, int irq, inthand2_t handler, - void *arg, intrmask_t *maskptr, int flags); + void *arg, intrmask_t *maskptr, int flags, + lwkt_serialize_t serializer); int inthand_remove(struct intrec *idesc); -void inthand_enabled(struct intrec *idesc); -void inthand_disabled(struct intrec *idesc); void forward_fastint_remote(void *arg); #endif /* LOCORE */ diff --git a/sys/platform/pc32/isa/npx.c b/sys/platform/pc32/isa/npx.c index 2dca217da5..1b603cdf53 100644 --- a/sys/platform/pc32/isa/npx.c +++ b/sys/platform/pc32/isa/npx.c @@ -33,7 +33,7 @@ * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/npx.c,v 1.80.2.3 2001/10/20 19:04:38 tegge Exp $ - * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.22 2005/01/31 23:44:35 joerg Exp $ + * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.23 2005/05/24 20:59:05 dillon Exp $ */ #include "opt_cpu.h" @@ -404,7 +404,7 @@ npx_probe1(device_t dev) panic("npx: can't get IRQ"); BUS_SETUP_INTR(device_get_parent(dev), dev, r, INTR_TYPE_MISC, - npx_intr, 0, &intr); + npx_intr, 0, &intr, NULL); if (intr == 0) panic("npx: can't create intr"); diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 4a0426410a..5ad8942ac3 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/bus.h,v 1.30.2.5 2004/03/17 17:54:25 njl Exp $ - * $DragonFly: src/sys/sys/bus.h,v 1.13 2005/05/23 18:19:55 dillon Exp $ + * $DragonFly: src/sys/sys/bus.h,v 1.14 2005/05/24 20:58:44 dillon Exp $ */ #ifndef _SYS_BUS_H_ @@ -34,6 +34,7 @@ #include #include +#include /* * Forward declarations @@ -198,7 +199,7 @@ int bus_generic_child_present(device_t dev, device_t child); int bus_generic_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int bus_generic_detach(device_t dev); -void bus_generic_disable_intr(device_t dev, device_t child, void *cookie); +int bus_generic_disable_intr(device_t dev, device_t child, void *cookie); void bus_generic_driver_added(device_t dev, driver_t *driver); void bus_generic_enable_intr(device_t dev, device_t child, void *cookie); int bus_print_child_header(device_t dev, device_t child); @@ -212,7 +213,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_intr_t *intr, void *arg, + void **cookiep, lwkt_serialize_t serializer); int bus_generic_shutdown(device_t dev); int bus_generic_suspend(device_t dev); int bus_generic_teardown_intr(device_t dev, device_t child, @@ -242,12 +244,13 @@ int bus_activate_resource(device_t dev, int type, int rid, struct resource *r); int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); -void bus_disable_intr(device_t dev, void *cookie); +int bus_disable_intr(device_t dev, void *cookie); void bus_enable_intr(device_t dev, void *cookie); int 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_intr_t handler, void *arg, + void **cookiep, lwkt_serialize_t serializer); 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/serialize.h b/sys/sys/serialize.h new file mode 100644 index 0000000000..e09a412d98 --- /dev/null +++ b/sys/sys/serialize.h @@ -0,0 +1,37 @@ +/* + * Provides a fast serialization facility that will serialize across blocking + * conditions. This facility is very similar to a lock but much faster for + * the common case. It utilizes the atomic_intr_*() functions to acquire + * and release the serializer and token functions to block. + * + * This API is designed to be used whenever low level serialization is + * required. Unlike tokens this serialization is not safe from deadlocks + * nor is it recursive, and care must be taken when using it. + * + * $DragonFly: src/sys/sys/serialize.h,v 1.1 2005/05/24 20:58:44 dillon Exp $ + */ + +#ifndef _SYS_SERIALIZE_H_ +#define _SYS_SERIALIZE_H_ + +#ifndef _MACHINE_ATOMIC_H_ +#include +#endif + +struct thread; + +struct lwkt_serialize { + atomic_intr_t interlock; + struct thread *last_td; +}; + +typedef struct lwkt_serialize *lwkt_serialize_t; + +void lwkt_serialize_init(lwkt_serialize_t); +void lwkt_serialize_enter(lwkt_serialize_t); +void lwkt_serialize_exit(lwkt_serialize_t); +void lwkt_serialize_handler_disable(lwkt_serialize_t); +void lwkt_serialize_handler_enable(lwkt_serialize_t); +void lwkt_serialize_handler_call(lwkt_serialize_t, void (*)(void *), void *); + +#endif -- 2.41.0