diff options
Diffstat (limited to 'sys/dev/sound')
29 files changed, 169 insertions, 135 deletions
diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c index a7b8fdf..3de4804 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -518,17 +518,17 @@ ad1816_alloc_resources(struct ad1816_info *ad1816, device_t dev) int ok = 1, pdma, rdma; if (!ad1816->io_base) - ad1816->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &ad1816->io_rid, - 0, ~0, 1, RF_ACTIVE); + ad1816->io_base = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, &ad1816->io_rid, RF_ACTIVE); if (!ad1816->irq) - ad1816->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &ad1816->irq_rid, - 0, ~0, 1, RF_ACTIVE); + ad1816->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &ad1816->irq_rid, RF_ACTIVE); if (!ad1816->drq1) - ad1816->drq1 = bus_alloc_resource(dev, SYS_RES_DRQ, &ad1816->drq1_rid, - 0, ~0, 1, RF_ACTIVE); + ad1816->drq1 = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &ad1816->drq1_rid, RF_ACTIVE); if (!ad1816->drq2) - ad1816->drq2 = bus_alloc_resource(dev, SYS_RES_DRQ, &ad1816->drq2_rid, - 0, ~0, 1, RF_ACTIVE); + ad1816->drq2 = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &ad1816->drq2_rid, RF_ACTIVE); if (!ad1816->io_base || !ad1816->drq1 || !ad1816->irq) ok = 0; diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index a8dccfd..fc49efd 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -316,24 +316,20 @@ ess_alloc_resources(struct ess_info *sc, device_t dev) rid = 0; if (!sc->io_base) - sc->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, - &rid, 0, ~0, 1, - RF_ACTIVE); + sc->io_base = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &rid, RF_ACTIVE); rid = 0; if (!sc->irq) - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, - RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_ACTIVE); rid = 0; if (!sc->drq1) - sc->drq1 = bus_alloc_resource(dev, SYS_RES_DRQ, - &rid, 0, ~0, 1, - RF_ACTIVE); + sc->drq1 = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &rid, RF_ACTIVE); rid = 1; if (!sc->drq2) - sc->drq2 = bus_alloc_resource(dev, SYS_RES_DRQ, - &rid, 0, ~0, 1, - RF_ACTIVE); + sc->drq2 = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &rid, RF_ACTIVE); if (sc->io_base && sc->drq1 && sc->irq) { isa_dma_acquire(rman_get_start(sc->drq1)); @@ -968,7 +964,7 @@ esscontrol_attach(device_t dev) int rid, i, x; rid = 0; - io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); x = 0; for (i = 0; i < 0x100; i++) { port_wr(io, 0, i); diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c index 54b2928..908b486 100644 --- a/sys/dev/sound/isa/gusc.c +++ b/sys/dev/sound/isa/gusc.c @@ -504,8 +504,10 @@ alloc_resource(sc_p scp) } if (scp->irq == NULL) { scp->irq_rid = 0; - scp->irq = bus_alloc_resource(scp->dev, SYS_RES_IRQ, &scp->irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + scp->irq = + bus_alloc_resource_any(scp->dev, SYS_RES_IRQ, + &scp->irq_rid, + RF_ACTIVE|RF_SHAREABLE); if (scp->irq == NULL) return (1); scp->irq_alloced = 0; @@ -514,8 +516,11 @@ alloc_resource(sc_p scp) if (scp->drq[i] == NULL) { scp->drq_rid[i] = i; if (base == 0 || i == 0) - scp->drq[i] = bus_alloc_resource(scp->dev, SYS_RES_DRQ, &scp->drq_rid[i], - 0, ~0, 1, RF_ACTIVE); + scp->drq[i] = + bus_alloc_resource_any( + scp->dev, SYS_RES_DRQ, + &scp->drq_rid[i], + RF_ACTIVE); else if ((flags & DV_F_DUAL_DMA) != 0) /* XXX The secondary drq is specified in the flag. */ scp->drq[i] = bus_alloc_resource(scp->dev, SYS_RES_DRQ, &scp->drq_rid[i], diff --git a/sys/dev/sound/isa/gusmidi.c b/sys/dev/sound/isa/gusmidi.c index e5788d1..16a2d18 100644 --- a/sys/dev/sound/isa/gusmidi.c +++ b/sys/dev/sound/isa/gusmidi.c @@ -487,7 +487,8 @@ static int gusmidi_allocres(sc_p scp, device_t dev) { if (scp->io == NULL) { - scp->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &scp->io_rid, 0, ~0, 2, RF_ACTIVE); + scp->io = bus_alloc_resource(dev, SYS_RES_IOPORT, + &scp->io_rid, 0, ~0, 2, RF_ACTIVE); if (scp->io == NULL) return (1); } @@ -496,7 +497,8 @@ gusmidi_allocres(sc_p scp, device_t dev) #else if (scp->irq == NULL) { #endif /* notdef */ - scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &scp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + scp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &scp->irq_rid, RF_ACTIVE | RF_SHAREABLE); if (scp->irq == NULL) return (1); } diff --git a/sys/dev/sound/isa/mpu.c b/sys/dev/sound/isa/mpu.c index 5ca32bd..3f259a7 100644 --- a/sys/dev/sound/isa/mpu.c +++ b/sys/dev/sound/isa/mpu.c @@ -747,7 +747,8 @@ mpu_allocres(sc_p scp, device_t dev) } if (scp->irq == NULL && !(device_get_flags(dev) & MPU_DF_NO_IRQ)) { if (scp->irq_val == 0) - scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &scp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + scp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &scp->irq_rid, RF_ACTIVE | RF_SHAREABLE); else scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &scp->irq_rid, scp->irq_val, scp->irq_val, 1, RF_ACTIVE | RF_SHAREABLE); if (scp->irq == NULL) diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index c71030e..9e2ecce 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -314,20 +314,23 @@ mss_alloc_resources(struct mss_info *mss, device_t dev) { int pdma, rdma, ok = 1; if (!mss->io_base) - mss->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &mss->io_rid, - 0, ~0, 1, RF_ACTIVE); + mss->io_base = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &mss->io_rid, RF_ACTIVE); if (!mss->irq) - mss->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &mss->irq_rid, - 0, ~0, 1, RF_ACTIVE); + mss->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &mss->irq_rid, RF_ACTIVE); if (!mss->drq1) - mss->drq1 = bus_alloc_resource(dev, SYS_RES_DRQ, &mss->drq1_rid, - 0, ~0, 1, RF_ACTIVE); + mss->drq1 = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &mss->drq1_rid, + RF_ACTIVE); if (mss->conf_rid >= 0 && !mss->conf_base) - mss->conf_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &mss->conf_rid, - 0, ~0, 1, RF_ACTIVE); + mss->conf_base = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &mss->conf_rid, + RF_ACTIVE); if (mss->drq2_rid >= 0 && !mss->drq2) - mss->drq2 = bus_alloc_resource(dev, SYS_RES_DRQ, &mss->drq2_rid, - 0, ~0, 1, RF_ACTIVE); + mss->drq2 = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &mss->drq2_rid, + RF_ACTIVE); if (!mss->io_base || !mss->drq1 || !mss->irq) ok = 0; if (mss->conf_rid >= 0 && !mss->conf_base) ok = 0; @@ -705,8 +708,8 @@ mss_init(struct mss_info *mss, device_t dev) /* end of reset */ rid = 0; - alt = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + alt = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (alt == NULL) { printf("XXX couldn't init GUS PnP/MAX\n"); break; @@ -1889,8 +1892,7 @@ azt2320_mss_mode(struct mss_info *mss, device_t dev) rid = 0; ret = -1; - sbport = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sbport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sbport) { for (i = 0; i < 1000; i++) { if ((port_rd(sbport, SBDSP_STATUS) & 0x80)) diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index 753cef8..da82611 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -440,19 +440,23 @@ sb16_alloc_resources(struct sb_info *sb, device_t dev) rid = 0; if (!sb->io_base) - sb->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sb->io_base = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &rid, RF_ACTIVE); rid = 0; if (!sb->irq) - sb->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); + sb->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); rid = 0; if (!sb->drq1) - sb->drq1 = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, 0, ~0, 1, RF_ACTIVE); + sb->drq1 = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, + RF_ACTIVE); rid = 1; if (!sb->drq2) - sb->drq2 = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, 0, ~0, 1, RF_ACTIVE); + sb->drq2 = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, + RF_ACTIVE); if (sb->io_base && sb->drq1 && sb->irq) { isa_dma_acquire(rman_get_start(sb->drq1)); diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 566aa83..877971e 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -286,13 +286,16 @@ sb_alloc_resources(struct sb_info *sb, device_t dev) rid = 0; if (!sb->io_base) - sb->io_base = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sb->io_base = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &rid, RF_ACTIVE); rid = 0; if (!sb->irq) - sb->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); + sb->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_ACTIVE); rid = 0; if (!sb->drq) - sb->drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, 0, ~0, 1, RF_ACTIVE); + sb->drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &rid, RF_ACTIVE); if (sb->io_base && sb->drq && sb->irq) { isa_dma_acquire(rman_get_start(sb->drq)); diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c index 21cb639..6abb596 100644 --- a/sys/dev/sound/isa/sbc.c +++ b/sys/dev/sound/isa/sbc.c @@ -700,8 +700,10 @@ alloc_resource(struct sbc_softc *scp) for (i = 0 ; i < DRQ_MAX ; i++) { if (scp->drq[i] == NULL) { scp->drq_rid[i] = i; - scp->drq[i] = bus_alloc_resource(scp->dev, SYS_RES_DRQ, &scp->drq_rid[i], - 0, ~0, 1, RF_ACTIVE); + scp->drq[i] = bus_alloc_resource_any(scp->dev, + SYS_RES_DRQ, + &scp->drq_rid[i], + RF_ACTIVE); if (i == 0 && scp->drq[i] == NULL) return (1); scp->drq_alloced[i] = 0; @@ -710,8 +712,10 @@ alloc_resource(struct sbc_softc *scp) for (i = 0 ; i < IRQ_MAX ; i++) { if (scp->irq[i] == NULL) { scp->irq_rid[i] = i; - scp->irq[i] = bus_alloc_resource(scp->dev, SYS_RES_IRQ, &scp->irq_rid[i], - 0, ~0, 1, RF_ACTIVE); + scp->irq[i] = bus_alloc_resource_any(scp->dev, + SYS_RES_IRQ, + &scp->irq_rid[i], + RF_ACTIVE); if (i == 0 && scp->irq[i] == NULL) return (1); scp->irq_alloced[i] = 0; diff --git a/sys/dev/sound/isa/uartsio.c b/sys/dev/sound/isa/uartsio.c index ab9fd9d..384e183 100644 --- a/sys/dev/sound/isa/uartsio.c +++ b/sys/dev/sound/isa/uartsio.c @@ -487,7 +487,8 @@ uartsio_allocres(sc_p scp, device_t dev) { if (scp->irq == NULL) { scp->irq_rid = 0; - scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &scp->irq_rid, 0, ~0, 1, RF_ACTIVE); + scp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &scp->irq_rid, RF_ACTIVE); } if (scp->irq == NULL) return (1); diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index 9add8d5..267c506 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -723,8 +723,8 @@ als_resource_grab(device_t dev, struct sc_info *sc) sc->st = rman_get_bustag(sc->reg); sc->sh = rman_get_bushandle(sc->reg); - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, - RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (sc->irq == 0) { device_printf(dev, "unable to allocate interrupt\n"); goto bad; diff --git a/sys/dev/sound/pci/au88x0.c b/sys/dev/sound/pci/au88x0.c index 12691cd..67bc5c2 100644 --- a/sys/dev/sound/pci/au88x0.c +++ b/sys/dev/sound/pci/au88x0.c @@ -597,15 +597,15 @@ au88x0_pci_attach(device_t dev) /* try memory-mapped I/O */ aui->aui_regid = PCIR_BAR(0); aui->aui_regtype = SYS_RES_MEMORY; - aui->aui_reg = bus_alloc_resource(dev, aui->aui_regtype, - &aui->aui_regid, 0, ~0, 1, RF_ACTIVE); + aui->aui_reg = bus_alloc_resource_any(dev, aui->aui_regtype, + &aui->aui_regid, RF_ACTIVE); } if (aui->aui_reg == NULL && (config & PCIM_CMD_PORTEN)) { /* fall back on port I/O */ aui->aui_regid = PCIR_BAR(0); aui->aui_regtype = SYS_RES_IOPORT; - aui->aui_reg = bus_alloc_resource(dev, aui->aui_regtype, - &aui->aui_regid, 0, ~0, 1, RF_ACTIVE); + aui->aui_reg = bus_alloc_resource_any(dev, aui->aui_regtype, + &aui->aui_regid, RF_ACTIVE); } if (aui->aui_reg == NULL) { /* both mmio and pio failed... */ @@ -618,8 +618,8 @@ au88x0_pci_attach(device_t dev) /* IRQ mapping */ aui->aui_irqid = 0; aui->aui_irqtype = SYS_RES_IRQ; - aui->aui_irq = bus_alloc_resource(dev, aui->aui_irqtype, - &aui->aui_irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + aui->aui_irq = bus_alloc_resource_any(dev, aui->aui_irqtype, + &aui->aui_irqid, RF_ACTIVE | RF_SHAREABLE); if (aui->aui_irq == 0) { device_printf(dev, "failed to map IRQ\n"); goto failed; diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c index e11add8..e1cc64d 100644 --- a/sys/dev/sound/pci/aureal.c +++ b/sys/dev/sound/pci/aureal.c @@ -584,12 +584,12 @@ au_pci_attach(device_t dev) #endif regid[j] = PCIR_BAR(i); type[j] = SYS_RES_MEMORY; - reg[j] = bus_alloc_resource(dev, type[j], ®id[j], - 0, ~0, 1, RF_ACTIVE); + reg[j] = bus_alloc_resource_any(dev, type[j], ®id[j], + RF_ACTIVE); if (!reg[j]) { type[j] = SYS_RES_IOPORT; - reg[j] = bus_alloc_resource(dev, type[j], ®id[j], - 0, ~0, 1, RF_ACTIVE); + reg[j] = bus_alloc_resource_any(dev, type[j], + ®id[j], RF_ACTIVE); } if (reg[j]) { au->st[i] = rman_get_bustag(reg[j]); @@ -618,8 +618,8 @@ au_pci_attach(device_t dev) au_wr(au, 0, AU_REG_IRQEN, 0, 4); irqid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid, + RF_ACTIVE | RF_SHAREABLE); if (!irq || snd_setup_intr(dev, irq, 0, au_intr, au, &ih)) { 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 4fd7ee4..de5b386 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -860,8 +860,8 @@ cmi_attach(device_t dev) sc->sh = rman_get_bushandle(sc->reg); sc->irqid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, cmi_intr, sc, &sc->ih)) { device_printf(dev, "cmi_attach: Unable to map interrupt\n"); diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 3396a9e..c20f431 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -810,8 +810,8 @@ cs4281_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); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq) { device_printf(dev, "unable to allocate interrupt\n"); goto bad; diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index 3c45e19..5b28ecd 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -259,15 +259,18 @@ csa_attach(device_t dev) scp->binfo.card = scp->card; printf("csa: card is %s\n", scp->card->name); resp->io_rid = PCIR_BAR(0); - resp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->io_rid, 0, ~0, 1, RF_ACTIVE); + resp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &resp->io_rid, RF_ACTIVE); if (resp->io == NULL) return (ENXIO); resp->mem_rid = PCIR_BAR(1); - resp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->mem_rid, 0, ~0, 1, RF_ACTIVE); + resp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &resp->mem_rid, RF_ACTIVE); if (resp->mem == NULL) goto err_io; resp->irq_rid = 0; - resp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &resp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + resp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &resp->irq_rid, RF_ACTIVE | RF_SHAREABLE); if (resp->irq == NULL) goto err_mem; diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c index 4b9ce3d..4f91b5f 100644 --- a/sys/dev/sound/pci/csamidi.c +++ b/sys/dev/sound/pci/csamidi.c @@ -530,17 +530,20 @@ static int csamidi_allocres(sc_p scp, device_t dev) { if (scp->io == NULL) { - scp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &scp->io_rid, 0, ~0, 1, RF_ACTIVE); + scp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &scp->io_rid, RF_ACTIVE); if (scp->io == NULL) return (1); } if (scp->mem == NULL) { - scp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &scp->mem_rid, 0, ~0, 1, RF_ACTIVE); + scp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &scp->mem_rid, RF_ACTIVE); if (scp->mem == NULL) return (1); } if (scp->irq == NULL) { - scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &scp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + scp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &scp->irq_rid, RF_ACTIVE | RF_SHAREABLE); if (scp->irq == NULL) return (1); } diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index bc2f3b3..47a2e07 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -660,17 +660,20 @@ csa_allocres(struct csa_info *csa, device_t dev) resp = &csa->res; if (resp->io == NULL) { - resp->io = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->io_rid, 0, ~0, 1, RF_ACTIVE); + resp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &resp->io_rid, RF_ACTIVE); if (resp->io == NULL) return (1); } if (resp->mem == NULL) { - resp->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &resp->mem_rid, 0, ~0, 1, RF_ACTIVE); + resp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &resp->mem_rid, RF_ACTIVE); if (resp->mem == NULL) return (1); } if (resp->irq == NULL) { - resp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &resp->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + resp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &resp->irq_rid, RF_ACTIVE | RF_SHAREABLE); if (resp->irq == NULL) return (1); } diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c index 20fc56d..443b15a 100644 --- a/sys/dev/sound/pci/ds1.c +++ b/sys/dev/sound/pci/ds1.c @@ -954,8 +954,8 @@ ds_pci_attach(device_t dev) data = pci_read_config(dev, PCIR_COMMAND, 2); sc->regid = PCIR_BAR(0); - sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid, - 0, ~0, 1, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regid, + RF_ACTIVE); if (!sc->reg) { device_printf(dev, "unable to map register space\n"); goto bad; @@ -989,8 +989,8 @@ ds_pci_attach(device_t dev) mixer_init(dev, ac97_getmixerclass(), codec); sc->irqid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ds_intr, sc, &sc->ih)) { 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 a7fd89c..2ef7aae 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -1909,8 +1909,7 @@ emu_pci_attach(device_t dev) data = pci_read_config(dev, PCIR_COMMAND, 2); i = PCIR_BAR(0); - sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0, 1, - RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &i, RF_ACTIVE); if (sc->reg == NULL) { device_printf(dev, "unable to map register space\n"); goto bad; @@ -1942,7 +1941,7 @@ emu_pci_attach(device_t dev) if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad; i = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &i, 0, ~0, 1, + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, emu_intr, sc, &sc->ih)) { diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 2b4c5c3..5c6d147c 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -855,8 +855,8 @@ es_pci_attach(device_t dev) if (mapped == 0 && (data & PCIM_CMD_MEMEN)) { es->regid = MEM_MAP_REG; es->regtype = SYS_RES_MEMORY; - es->reg = bus_alloc_resource(dev, es->regtype, &es->regid, - 0, ~0, 1, RF_ACTIVE); + es->reg = bus_alloc_resource_any(dev, es->regtype, &es->regid, + RF_ACTIVE); if (es->reg) { es->st = rman_get_bustag(es->reg); es->sh = rman_get_bushandle(es->reg); @@ -866,8 +866,8 @@ es_pci_attach(device_t dev) if (mapped == 0 && (data & PCIM_CMD_PORTEN)) { es->regid = PCIR_BAR(0); es->regtype = SYS_RES_IOPORT; - es->reg = bus_alloc_resource(dev, es->regtype, &es->regid, - 0, ~0, 1, RF_ACTIVE); + es->reg = bus_alloc_resource_any(dev, es->regtype, &es->regid, + RF_ACTIVE); if (es->reg) { es->st = rman_get_bustag(es->reg); es->sh = rman_get_bushandle(es->reg); @@ -906,8 +906,8 @@ es_pci_attach(device_t dev) } else goto bad; es->irqid = 0; - es->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &es->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + es->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &es->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!es->irq || snd_setup_intr(dev, es->irq, 0, es_intr, es, &es->ih)) { 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 87a74f6..007df37 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -589,13 +589,15 @@ fm801_pci_attach(device_t dev) for (i = 0; (mapped == 0) && (i < PCI_MAXMAPS_0); i++) { fm801->regid = PCIR_BAR(i); fm801->regtype = SYS_RES_MEMORY; - fm801->reg = bus_alloc_resource(dev, fm801->regtype, &fm801->regid, - 0, ~0, 1, RF_ACTIVE); + fm801->reg = bus_alloc_resource_any(dev, fm801->regtype, + &fm801->regid, RF_ACTIVE); if(!fm801->reg) { fm801->regtype = SYS_RES_IOPORT; - fm801->reg = bus_alloc_resource(dev, fm801->regtype, &fm801->regid, - 0, ~0, 1, RF_ACTIVE); + fm801->reg = bus_alloc_resource_any(dev, + fm801->regtype, + &fm801->regid, + RF_ACTIVE); } if(fm801->reg) { @@ -620,8 +622,8 @@ fm801_pci_attach(device_t dev) if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto oops; fm801->irqid = 0; - fm801->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &fm801->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + fm801->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &fm801->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!fm801->irq || snd_setup_intr(dev, fm801->irq, 0, fm801_intr, fm801, &fm801->ih)) { device_printf(dev, "unable to map interrupt\n"); goto oops; @@ -714,8 +716,7 @@ fm801_pci_probe( device_t dev ) regid = PCIR_BAR(0); regtype = SYS_RES_IOPORT; - reg = bus_alloc_resource(dev, regtype, ®id, 0, ~0, 1, - RF_ACTIVE); + reg = bus_alloc_resource_any(dev, regtype, ®id, RF_ACTIVE); if (reg == NULL) return ENXIO; diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index e1f9734..376fee8 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -708,8 +708,10 @@ ich_pci_attach(device_t dev) sc->regtype = SYS_RES_IOPORT; } - sc->nambar = bus_alloc_resource(dev, sc->regtype, &sc->nambarid, 0, ~0, 1, RF_ACTIVE); - sc->nabmbar = bus_alloc_resource(dev, sc->regtype, &sc->nabmbarid, 0, ~0, 1, RF_ACTIVE); + sc->nambar = bus_alloc_resource_any(dev, sc->regtype, + &sc->nambarid, RF_ACTIVE); + sc->nabmbar = bus_alloc_resource_any(dev, sc->regtype, + &sc->nabmbarid, RF_ACTIVE); if (!sc->nambar || !sc->nabmbar) { device_printf(dev, "unable to map IO port space\n"); @@ -730,7 +732,8 @@ 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); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(dev, sc->irq, INTR_MPSAFE, ich_intr, sc, &sc->ih)) { 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 c70ce51..41d42ef 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -1111,12 +1111,12 @@ m3_pci_attach(device_t dev) sc->regid = PCIR_BAR(0); sc->regtype = SYS_RES_MEMORY; - sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, - 0, ~0, 1, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, + RF_ACTIVE); if (!sc->reg) { sc->regtype = SYS_RES_IOPORT; - sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, - 0, ~0, 1, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, + RF_ACTIVE); } if (!sc->reg) { device_printf(dev, "unable to allocate register space\n"); @@ -1126,8 +1126,8 @@ m3_pci_attach(device_t dev) sc->sh = rman_get_bushandle(sc->reg); sc->irqid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq) { device_printf(dev, "unable to allocate interrupt\n"); goto bad; diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index 47fffdd..be428e0 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -609,9 +609,9 @@ nm_pci_probe(device_t dev) PCIM_CMD_BUSMASTEREN, 2); sc->regid = PCIR_BAR(1); - sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->regid, 0, ~0, 1, - RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->regid, + RF_ACTIVE); if (!sc->reg) { device_printf(dev, "unable to map register space\n"); @@ -676,11 +676,11 @@ nm_pci_attach(device_t dev) data = pci_read_config(dev, PCIR_COMMAND, 2); sc->bufid = PCIR_BAR(0); - sc->buf = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->bufid, - 0, ~0, 1, RF_ACTIVE); + sc->buf = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->bufid, + RF_ACTIVE); sc->regid = PCIR_BAR(1); - sc->reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regid, - 0, ~0, 1, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regid, + RF_ACTIVE); if (!sc->buf || !sc->reg) { device_printf(dev, "unable to map register space\n"); @@ -697,8 +697,8 @@ nm_pci_attach(device_t dev) if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad; sc->irqid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || snd_setup_intr(dev, sc->irq, 0, nm_intr, sc, &sc->ih)) { 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 1e213b6..8990fef 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -850,22 +850,23 @@ ess_alloc_resources(struct ess_info *sc, device_t dev) int rid; rid = PCIR_BAR(0); - sc->io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sc->io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); rid = PCIR_BAR(1); - sc->sb = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sc->sb = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); rid = PCIR_BAR(2); - sc->vc = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sc->vc = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); rid = PCIR_BAR(3); - sc->mpu = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sc->mpu = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); rid = PCIR_BAR(4); - sc->gp = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + sc->gp = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); return (sc->irq && sc->io && sc->sb && sc->vc && sc->mpu && sc->gp)? 0 : ENXIO; } diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index e2a62e1..a61be39 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -820,7 +820,8 @@ tr_pci_attach(device_t dev) tr->regid = PCIR_BAR(0); tr->regtype = SYS_RES_IOPORT; - tr->reg = bus_alloc_resource(dev, tr->regtype, &tr->regid, 0, ~0, 1, RF_ACTIVE); + tr->reg = bus_alloc_resource_any(dev, tr->regtype, &tr->regid, + RF_ACTIVE); if (tr->reg) { tr->st = rman_get_bustag(tr->reg); tr->sh = rman_get_bushandle(tr->reg); @@ -842,8 +843,8 @@ tr_pci_attach(device_t dev) if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto bad; tr->irqid = 0; - tr->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &tr->irqid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + tr->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &tr->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!tr->irq || snd_setup_intr(dev, tr->irq, INTR_MPSAFE, tr_intr, tr, &tr->ih)) { 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 1429a8a..3a346ae 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -766,8 +766,8 @@ via_attach(device_t dev) pci_enable_busmaster(dev); via->regid = PCIR_BAR(0); - via->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &via->regid, 0, ~0, - 1, RF_ACTIVE); + via->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &via->regid, + RF_ACTIVE); if (!via->reg) { device_printf(dev, "cannot allocate bus resource."); goto bad; @@ -778,8 +778,8 @@ via_attach(device_t dev) via->bufsz = pcm_getbuffersize(dev, 4096, VIA_DEFAULT_BUFSZ, 65536); via->irqid = 0; - via->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &via->irqid, 0, ~0, 1, - RF_ACTIVE | RF_SHAREABLE); + via->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &via->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!via->irq || snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih)) { device_printf(dev, "unable to map interrupt\n"); diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index c68887e..342ea54 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -507,7 +507,8 @@ via_attach(device_t dev) } via->regid = PCIR_BAR(0); - via->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &via->regid, 0, ~0, 1, RF_ACTIVE); + via->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &via->regid, RF_ACTIVE); if (!via->reg) { device_printf(dev, "cannot allocate bus resource."); goto bad; @@ -518,7 +519,8 @@ via_attach(device_t dev) via->bufsz = pcm_getbuffersize(dev, 4096, VIA_DEFAULT_BUFSZ, 65536); via->irqid = 0; - via->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &via->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + via->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &via->irqid, + RF_ACTIVE | RF_SHAREABLE); if (!via->irq || snd_setup_intr(dev, via->irq, 0, via_intr, via, &via->ih)) { device_printf(dev, "unable to map interrupt\n"); goto bad; |