diff options
267 files changed, 1090 insertions, 1125 deletions
diff --git a/sys/amd64/isa/atpic.c b/sys/amd64/isa/atpic.c index 23979ea..6d726eb 100644 --- a/sys/amd64/isa/atpic.c +++ b/sys/amd64/isa/atpic.c @@ -392,7 +392,7 @@ atpic_attach(device_t dev) /* Try to allocate our IRQ and then free it. */ rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, 0); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); if (res != NULL) bus_release_resource(dev, SYS_RES_IRQ, rid, res); return (0); diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c index 499580f..0275431 100644 --- a/sys/contrib/dev/oltr/if_oltr.c +++ b/sys/contrib/dev/oltr/if_oltr.c @@ -378,7 +378,7 @@ oltr_pci_attach(device_t dev) * Allocate interrupt and DMA channel */ rid = 0; - sc->oltr_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->oltr_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, (sc->config.mode & TRLLD_MODE_SHARE_INTERRUPT ? RF_ACTIVE | RF_SHAREABLE : RF_ACTIVE)); if (sc->oltr_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); diff --git a/sys/dev/aac/aac_pci.c b/sys/dev/aac/aac_pci.c index 06473e7..cc5cc59 100644 --- a/sys/dev/aac/aac_pci.c +++ b/sys/dev/aac/aac_pci.c @@ -197,11 +197,11 @@ aac_pci_attach(device_t dev) * Allocate the PCI register window. */ sc->aac_regs_rid = PCIR_BAR(0); - if ((sc->aac_regs_resource = bus_alloc_resource(sc->aac_dev, - SYS_RES_MEMORY, - &sc->aac_regs_rid, - 0, ~0, 1, - RF_ACTIVE)) == NULL) { + if ((sc->aac_regs_resource = bus_alloc_resource_any(sc->aac_dev, + SYS_RES_MEMORY, + &sc->aac_regs_rid, + RF_ACTIVE)) == + NULL) { device_printf(sc->aac_dev, "couldn't allocate register window\n"); goto out; @@ -213,10 +213,10 @@ aac_pci_attach(device_t dev) * Allocate and connect our interrupt. */ sc->aac_irq_rid = 0; - if ((sc->aac_irq = bus_alloc_resource(sc->aac_dev, SYS_RES_IRQ, - &sc->aac_irq_rid, 0, ~0, 1, - RF_SHAREABLE | - RF_ACTIVE)) == NULL) { + if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, + &sc->aac_irq_rid, + RF_SHAREABLE | + RF_ACTIVE)) == NULL) { device_printf(sc->aac_dev, "can't allocate interrupt\n"); goto out; } diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c index e95ee80..42974cc 100644 --- a/sys/dev/acpica/Osd/OsdInterrupt.c +++ b/sys/dev/acpica/Osd/OsdInterrupt.c @@ -90,8 +90,8 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine InterruptNumber = InterruptOverride; } bus_set_resource(sc->acpi_dev, SYS_RES_IRQ, 0, InterruptNumber, 1); - if ((sc->acpi_irq = bus_alloc_resource(sc->acpi_dev, SYS_RES_IRQ, &sc->acpi_irq_rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE)) == NULL) { + if ((sc->acpi_irq = bus_alloc_resource_any(sc->acpi_dev, SYS_RES_IRQ, + &sc->acpi_irq_rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(sc->acpi_dev, "could not allocate SCI interrupt\n"); return_ACPI_STATUS(AE_ALREADY_EXISTS); } diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 4b7a34e..187999a 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -882,7 +882,7 @@ acpi_bus_alloc_gas(device_t dev, int *rid, ACPI_GENERIC_ADDRESS *gas) } bus_set_resource(dev, type, *rid, gas->Address, gas->RegisterBitWidth / 8); - return (bus_alloc_resource(dev, type, rid, 0, ~0, 1, RF_ACTIVE)); + return (bus_alloc_resource_any(dev, type, rid, RF_ACTIVE)); } /* diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index 5eca9a8..4b2ac8a 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -530,8 +530,8 @@ acpi_ec_attach(device_t dev) /* Attach bus resources for data and command/status ports. */ sc->ec_data_rid = 0; - sc->ec_data_res = bus_alloc_resource(sc->ec_dev, SYS_RES_IOPORT, - &sc->ec_data_rid, 0, ~0, 1, RF_ACTIVE); + sc->ec_data_res = bus_alloc_resource_any(sc->ec_dev, SYS_RES_IOPORT, + &sc->ec_data_rid, RF_ACTIVE); if (sc->ec_data_res == NULL) { device_printf(dev, "can't allocate data port\n"); errval = ENXIO; @@ -541,8 +541,8 @@ acpi_ec_attach(device_t dev) sc->ec_data_handle = rman_get_bushandle(sc->ec_data_res); sc->ec_csr_rid = 1; - sc->ec_csr_res = bus_alloc_resource(sc->ec_dev, SYS_RES_IOPORT, - &sc->ec_csr_rid, 0, ~0, 1, RF_ACTIVE); + sc->ec_csr_res = bus_alloc_resource_any(sc->ec_dev, SYS_RES_IOPORT, + &sc->ec_csr_rid, RF_ACTIVE); if (sc->ec_csr_res == NULL) { device_printf(dev, "can't allocate command/status port\n"); errval = ENXIO; diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index 23ac064..e471f82 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -593,12 +593,11 @@ acpi_sysresource_attach(device_t dev) */ for (i = 0; i < 100; i++) { rid = i; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, 0); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, 0); rid = i; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, 0); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0); rid = i; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); } return (0); diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index d9867c6..41e16b6 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -176,7 +176,7 @@ acpi_timer_identify(driver_t *driver, device_t parent) ? SYS_RES_IOPORT : SYS_RES_MEMORY; rstart = AcpiGbl_FADT->XPmTmrBlk.Address; bus_set_resource(dev, rtype, rid, rstart, rlen); - acpi_timer_reg = bus_alloc_resource(dev, rtype, &rid, 0, ~0, 1, RF_ACTIVE); + acpi_timer_reg = bus_alloc_resource_any(dev, rtype, &rid, RF_ACTIVE); if (acpi_timer_reg == NULL) { device_printf(dev, "couldn't allocate I/O resource (%s 0x%lx)\n", rtype == SYS_RES_IOPORT ? "port" : "mem", rstart); diff --git a/sys/dev/adlink/adlink.c b/sys/dev/adlink/adlink.c index a66ccf5..7e9eb79 100644 --- a/sys/dev/adlink/adlink.c +++ b/sys/dev/adlink/adlink.c @@ -430,8 +430,7 @@ adlink_attach(device_t self) * chip. */ rid = 0x10; - sc->r0 = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->r0 = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sc->r0 == NULL) return(ENODEV); sc->t0 = rman_get_bustag(sc->r0); @@ -443,8 +442,7 @@ adlink_attach(device_t self) * are described in the manual which comes with the card. */ rid = 0x14; - sc->r1 = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->r1 = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sc->r1 == NULL) return(ENODEV); sc->t1 = rman_get_bustag(sc->r1); @@ -452,8 +450,8 @@ adlink_attach(device_t self) printf("Res1 %x %x\n", sc->t1, sc->h1); rid = 0x0; - sc->ri = bus_alloc_resource(self, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->ri = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); if (sc->ri == NULL) return (ENODEV); diff --git a/sys/dev/advansys/adv_eisa.c b/sys/dev/advansys/adv_eisa.c index 2da4d9d..d718938 100644 --- a/sys/dev/advansys/adv_eisa.c +++ b/sys/dev/advansys/adv_eisa.c @@ -145,16 +145,15 @@ adv_eisa_attach(device_t dev) adv_b = NULL; 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); if (!io) { device_printf(dev, "No I/O space?!\n"); return ENOMEM; } rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (!irq) { device_printf(dev, "No irq?!\n"); bus_release_resource(dev, SYS_RES_IOPORT, 0, io); diff --git a/sys/dev/advansys/adv_isa.c b/sys/dev/advansys/adv_isa.c index 0a4e759..5b51ce1 100644 --- a/sys/dev/advansys/adv_isa.c +++ b/sys/dev/advansys/adv_isa.c @@ -158,8 +158,8 @@ adv_isa_probe(device_t dev) continue; /* XXX what is the real portsize? */ - iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (iores == NULL) continue; @@ -327,8 +327,8 @@ adv_isa_probe(device_t dev) else adv_set_chip_irq(adv, irq); - irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE); + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih)) { diff --git a/sys/dev/advansys/adv_pci.c b/sys/dev/advansys/adv_pci.c index e4ba944..fd704b3 100644 --- a/sys/dev/advansys/adv_pci.c +++ b/sys/dev/advansys/adv_pci.c @@ -169,8 +169,8 @@ adv_pci_attach(device_t dev) } rid = PCI_BASEADR0; - iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (iores == NULL) return ENXIO; @@ -306,8 +306,8 @@ adv_pci_attach(device_t dev) } irqrid = 0; - irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &irqrid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqrid, + RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, adv_intr, adv, &ih)) { adv_free(adv); diff --git a/sys/dev/advansys/adw_pci.c b/sys/dev/advansys/adw_pci.c index 578cb37..e6050b8 100644 --- a/sys/dev/advansys/adw_pci.c +++ b/sys/dev/advansys/adw_pci.c @@ -217,15 +217,15 @@ adw_pci_attach(device_t dev) if ((command & PCIM_CMD_MEMEN) != 0) { regs_type = SYS_RES_MEMORY; regs_id = ADW_PCI_MEMBASE; - regs = bus_alloc_resource(dev, regs_type, - ®s_id, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, regs_type, + ®s_id, RF_ACTIVE); } #endif if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) { regs_type = SYS_RES_IOPORT; regs_id = ADW_PCI_IOBASE; - regs = bus_alloc_resource(dev, regs_type, - ®s_id, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, regs_type, + ®s_id, RF_ACTIVE); } if (regs == NULL) { @@ -305,8 +305,8 @@ adw_pci_attach(device_t dev) zero = 0; adw->irq_res_type = SYS_RES_IRQ; - adw->irq = bus_alloc_resource(dev, adw->irq_res_type, &zero, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + adw->irq = bus_alloc_resource_any(dev, adw->irq_res_type, &zero, + RF_ACTIVE | RF_SHAREABLE); if (adw->irq == NULL) { adw_free(adw); return (ENOMEM); diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 6a01e20..fc4fd1f 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -230,8 +230,8 @@ agp_generic_attach(device_t dev) * Find and map the aperture. */ rid = AGP_APBASE; - sc->as_aperture = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->as_aperture) return ENOMEM; diff --git a/sys/dev/agp/agp_amd.c b/sys/dev/agp/agp_amd.c index 2b1bd12..37bd11d 100644 --- a/sys/dev/agp/agp_amd.c +++ b/sys/dev/agp/agp_amd.c @@ -229,8 +229,8 @@ agp_amd_attach(device_t dev) return error; rid = AGP_AMD751_REGISTERS; - sc->regs = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->regs) { agp_generic_detach(dev); return ENOMEM; diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index 9f39955..b79ce13 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -274,8 +274,8 @@ agp_i810_attach(device_t dev) /* Same for i810 and i830 */ rid = AGP_I810_MMADR; - sc->regs = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->regs) { agp_generic_detach(dev); return ENOMEM; diff --git a/sys/dev/aha/aha_isa.c b/sys/dev/aha/aha_isa.c index 5e7831e..7215cb0 100644 --- a/sys/dev/aha/aha_isa.c +++ b/sys/dev/aha/aha_isa.c @@ -204,7 +204,7 @@ aha_isa_attach(device_t dev) } aha->irqrid = 0; - aha->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &aha->irqrid, 0, ~0, 1, + aha->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &aha->irqrid, RF_ACTIVE); if (!aha->irq) { device_printf(dev, "Unable to allocate excluse use of irq\n"); @@ -213,7 +213,7 @@ aha_isa_attach(device_t dev) } aha->drqrid = 0; - aha->drq = bus_alloc_resource(dev, SYS_RES_DRQ, &aha->drqrid, 0, ~0, 1, + aha->drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &aha->drqrid, RF_ACTIVE); if (!aha->drq) { device_printf(dev, "Unable to allocate drq\n"); diff --git a/sys/dev/aha/aha_mca.c b/sys/dev/aha/aha_mca.c index caa110f..730e57e 100644 --- a/sys/dev/aha/aha_mca.c +++ b/sys/dev/aha/aha_mca.c @@ -126,8 +126,7 @@ aha_mca_attach (device_t dev) void * ih; 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); if (!io) { device_printf(dev, "No I/O space?!\n"); error = ENOMEM; @@ -135,8 +134,7 @@ aha_mca_attach (device_t dev) } rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (irq == NULL) { device_printf(dev, "No IRQ?!\n"); error = ENOMEM; @@ -144,8 +142,7 @@ aha_mca_attach (device_t dev) } rid = 0; - drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, RF_ACTIVE); if (drq == NULL) { device_printf(dev, "No DRQ?!\n"); error = ENOMEM; diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c index c5c7ff7..34b16af 100644 --- a/sys/dev/ahb/ahb.c +++ b/sys/dev/ahb/ahb.c @@ -266,8 +266,7 @@ ahbattach(device_t dev) void *ih; 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); if (!io) { device_printf(dev, "No I/O space?!\n"); return ENOMEM; @@ -281,8 +280,7 @@ ahbattach(device_t dev) goto error_exit; rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (!irq) { device_printf(dev, "Can't allocate interrupt\n"); goto error_exit; diff --git a/sys/dev/aic/aic_cbus.c b/sys/dev/aic/aic_cbus.c index 8156426..d95f648 100644 --- a/sys/dev/aic/aic_cbus.c +++ b/sys/dev/aic/aic_cbus.c @@ -121,8 +121,8 @@ aic_isa_alloc_resources(device_t dev) if (isa_get_irq(dev) != -1) { rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (!sc->sc_irq) { device_printf(dev, "IRQ allocation failed\n"); aic_isa_release_resources(dev); @@ -132,8 +132,8 @@ aic_isa_alloc_resources(device_t dev) if (isa_get_drq(dev) != -1) { rid = 0; - sc->sc_drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->sc_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, + RF_ACTIVE); if (!sc->sc_drq) { device_printf(dev, "DRQ allocation failed\n"); aic_isa_release_resources(dev); diff --git a/sys/dev/aic/aic_isa.c b/sys/dev/aic/aic_isa.c index 17189df..0fd2125 100644 --- a/sys/dev/aic/aic_isa.c +++ b/sys/dev/aic/aic_isa.c @@ -82,8 +82,8 @@ aic_isa_alloc_resources(device_t dev) if (isa_get_irq(dev) != -1) { rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (!sc->sc_irq) { device_printf(dev, "IRQ allocation failed\n"); aic_isa_release_resources(dev); @@ -93,8 +93,8 @@ aic_isa_alloc_resources(device_t dev) if (isa_get_drq(dev) != -1) { rid = 0; - sc->sc_drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->sc_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, + RF_ACTIVE); if (!sc->sc_drq) { device_printf(dev, "DRQ allocation failed\n"); aic_isa_release_resources(dev); diff --git a/sys/dev/aic/aic_pccard.c b/sys/dev/aic/aic_pccard.c index f222f9c..bebee3f 100644 --- a/sys/dev/aic/aic_pccard.c +++ b/sys/dev/aic/aic_pccard.c @@ -82,8 +82,7 @@ aic_pccard_alloc_resources(device_t dev) return (ENOMEM); rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (!sc->sc_irq) { aic_pccard_release_resources(dev); return (ENOMEM); diff --git a/sys/dev/aic7xxx/ahc_eisa.c b/sys/dev/aic7xxx/ahc_eisa.c index d51fcdf..9c773aa 100644 --- a/sys/dev/aic7xxx/ahc_eisa.c +++ b/sys/dev/aic7xxx/ahc_eisa.c @@ -61,8 +61,7 @@ aic7770_probe(device_t dev) eisa_add_iospace(dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE); rid = 0; - regs = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (regs == NULL) { device_printf(dev, "Unable to map I/O space?!\n"); return ENOMEM; @@ -167,8 +166,8 @@ aic7770_map_registers(struct ahc_softc *ahc, u_int unused_ioport_arg) int rid; rid = 0; - regs = bus_alloc_resource(ahc->dev_softc, SYS_RES_IOPORT, - &rid, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(ahc->dev_softc, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (regs == NULL) { device_printf(ahc->dev_softc, "Unable to map I/O space?!\n"); return ENOMEM; @@ -188,8 +187,8 @@ aic7770_map_int(struct ahc_softc *ahc, int irq) zero = 0; ahc->platform_data->irq = - bus_alloc_resource(ahc->dev_softc, SYS_RES_IRQ, &zero, - 0, ~0, 1, RF_ACTIVE); + bus_alloc_resource_any(ahc->dev_softc, SYS_RES_IRQ, &zero, + RF_ACTIVE); if (ahc->platform_data->irq == NULL) return (ENOMEM); ahc->platform_data->irq_res_type = SYS_RES_IRQ; diff --git a/sys/dev/aic7xxx/ahc_pci.c b/sys/dev/aic7xxx/ahc_pci.c index 86e0a60..4050d7f 100644 --- a/sys/dev/aic7xxx/ahc_pci.c +++ b/sys/dev/aic7xxx/ahc_pci.c @@ -172,8 +172,8 @@ ahc_pci_map_registers(struct ahc_softc *ahc) regs_type = SYS_RES_MEMORY; regs_id = AHC_PCI_MEMADDR; - regs = bus_alloc_resource(ahc->dev_softc, regs_type, - ®s_id, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(ahc->dev_softc, regs_type, + ®s_id, RF_ACTIVE); if (regs != NULL) { ahc->tag = rman_get_bustag(regs); ahc->bsh = rman_get_bushandle(regs); @@ -204,8 +204,8 @@ ahc_pci_map_registers(struct ahc_softc *ahc) if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) { regs_type = SYS_RES_IOPORT; regs_id = AHC_PCI_IOADDR; - regs = bus_alloc_resource(ahc->dev_softc, regs_type, - ®s_id, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(ahc->dev_softc, regs_type, + ®s_id, RF_ACTIVE); if (regs != NULL) { ahc->tag = rman_get_bustag(regs); ahc->bsh = rman_get_bushandle(regs); @@ -245,8 +245,8 @@ ahc_pci_map_int(struct ahc_softc *ahc) zero = 0; ahc->platform_data->irq = - bus_alloc_resource(ahc->dev_softc, SYS_RES_IRQ, &zero, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + bus_alloc_resource_any(ahc->dev_softc, SYS_RES_IRQ, &zero, + RF_ACTIVE | RF_SHAREABLE); if (ahc->platform_data->irq == NULL) { device_printf(ahc->dev_softc, "bus_alloc_resource() failed to allocate IRQ\n"); diff --git a/sys/dev/aic7xxx/ahd_pci.c b/sys/dev/aic7xxx/ahd_pci.c index 24cd5ab..18ac5f3 100644 --- a/sys/dev/aic7xxx/ahd_pci.c +++ b/sys/dev/aic7xxx/ahd_pci.c @@ -171,8 +171,8 @@ ahd_pci_map_registers(struct ahd_softc *ahd) regs_type = SYS_RES_MEMORY; regs_id = AHD_PCI_MEMADDR; - regs = bus_alloc_resource(ahd->dev_softc, regs_type, - ®s_id, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(ahd->dev_softc, regs_type, + ®s_id, RF_ACTIVE); if (regs != NULL) { int error; @@ -209,8 +209,8 @@ ahd_pci_map_registers(struct ahd_softc *ahd) if (regs == NULL && (command & PCIM_CMD_PORTEN) != 0) { regs_type = SYS_RES_IOPORT; regs_id = AHD_PCI_IOADDR0; - regs = bus_alloc_resource(ahd->dev_softc, regs_type, - ®s_id, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(ahd->dev_softc, regs_type, + ®s_id, RF_ACTIVE); if (regs == NULL) { device_printf(ahd->dev_softc, "can't allocate register resources\n"); @@ -221,8 +221,8 @@ ahd_pci_map_registers(struct ahd_softc *ahd) /* And now the second BAR */ regs_id2 = AHD_PCI_IOADDR1; - regs2 = bus_alloc_resource(ahd->dev_softc, regs_type, - ®s_id2, 0, ~0, 1, RF_ACTIVE); + regs2 = bus_alloc_resource_any(ahd->dev_softc, regs_type, + ®s_id2, RF_ACTIVE); if (regs2 == NULL) { device_printf(ahd->dev_softc, "can't allocate register resources\n"); @@ -250,8 +250,8 @@ ahd_pci_map_int(struct ahd_softc *ahd) zero = 0; ahd->platform_data->irq = - bus_alloc_resource(ahd->dev_softc, SYS_RES_IRQ, &zero, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + bus_alloc_resource_any(ahd->dev_softc, SYS_RES_IRQ, &zero, + RF_ACTIVE | RF_SHAREABLE); if (ahd->platform_data->irq == NULL) return (ENOMEM); ahd->platform_data->irq_res_type = SYS_RES_IRQ; diff --git a/sys/dev/amd/amd.c b/sys/dev/amd/amd.c index 22d52ca..101c9f1 100644 --- a/sys/dev/amd/amd.c +++ b/sys/dev/amd/amd.c @@ -2286,8 +2286,7 @@ amd_init(device_t dev) u_int bval; rid = PCI_BASE_ADDR0; - iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (iores == NULL) { if (bootverbose) printf("amd_init: bus_alloc_resource failure!\n"); @@ -2432,8 +2431,8 @@ amd_attach(device_t dev) /* After setting up the adapter, map our interrupt */ rid = 0; - irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || bus_setup_intr(dev, irqres, INTR_TYPE_CAM | INTR_ENTROPY, amd_intr, amd, &ih)) { diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c index 5a67a55..85ffaaa 100644 --- a/sys/dev/amr/amr_pci.c +++ b/sys/dev/amr/amr_pci.c @@ -212,7 +212,7 @@ amr_pci_attach(device_t dev) */ rid = PCIR_BAR(0); rtype = AMR_IS_QUARTZ(sc) ? SYS_RES_MEMORY : SYS_RES_IOPORT; - sc->amr_reg = bus_alloc_resource(dev, rtype, &rid, 0, ~0, 1, RF_ACTIVE); + sc->amr_reg = bus_alloc_resource_any(dev, rtype, &rid, RF_ACTIVE); if (sc->amr_reg == NULL) { device_printf(sc->amr_dev, "can't allocate register window\n"); goto out; @@ -224,7 +224,8 @@ amr_pci_attach(device_t dev) * Allocate and connect our interrupt. */ rid = 0; - sc->amr_irq = bus_alloc_resource(sc->amr_dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->amr_irq = bus_alloc_resource_any(sc->amr_dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->amr_irq == NULL) { device_printf(sc->amr_dev, "can't allocate interrupt\n"); goto out; diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index ae50861..87a6d61 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -432,8 +432,8 @@ an_alloc_irq(dev, rid, flags) struct an_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, (RF_ACTIVE | flags)); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + (RF_ACTIVE | flags)); if (res) { sc->irq_rid = rid; sc->irq_res = res; diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c index a98c533..c06a285 100644 --- a/sys/dev/ar/if_ar.c +++ b/sys/dev/ar/if_ar.c @@ -402,8 +402,8 @@ ar_allocate_irq(device_t device, int rid, u_long size) struct ar_hardc *hc = device_get_softc(device); hc->rid_irq = rid; - hc->res_irq = bus_alloc_resource(device, SYS_RES_IRQ, - &hc->rid_irq, 0ul, ~0ul, 1, RF_SHAREABLE|RF_ACTIVE); + hc->res_irq = bus_alloc_resource_any(device, SYS_RES_IRQ, + &hc->rid_irq, RF_SHAREABLE|RF_ACTIVE); if (hc->res_irq == NULL) { goto errexit; } diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c index 2d2ba20..0166e83 100644 --- a/sys/dev/asr/asr.c +++ b/sys/dev/asr/asr.c @@ -2756,8 +2756,8 @@ asr_pci_map_int ( #if __FreeBSD_version >= 400000 int rid = 0; - sc->ha_irq_res = bus_alloc_resource(tag, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->ha_irq_res = bus_alloc_resource_any(tag, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); if (sc->ha_irq_res == (struct resource *)NULL) { return (0); } diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 8fff15a..f94f977 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -140,8 +140,8 @@ ata_attach(device_t dev) return ENXIO; rid = ATA_IRQ_RID; - ch->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (!ch->r_irq) { ata_printf(ch, -1, "unable to allocate interrupt\n"); return ENXIO; diff --git a/sys/dev/ata/ata-cbus.c b/sys/dev/ata/ata-cbus.c index 008883a..54569ca 100644 --- a/sys/dev/ata/ata-cbus.c +++ b/sys/dev/ata/ata-cbus.c @@ -136,8 +136,8 @@ ata_cbus_attach(device_t dev) } rid = ATA_IRQ_RID; - if (!(ctlr->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE))) { + if (!(ctlr->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE))) { device_printf(dev, "unable to alloc interrupt\n"); bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io); bus_release_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, ctlr->altio); diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index 4bc172a..659bce0 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -218,8 +218,8 @@ ata_acard_chipinit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(dev); int rid = ATA_IRQ_RID; - if (!(ctlr->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE))) { + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, "unable to map interrupt\n"); return ENXIO; } @@ -660,8 +660,8 @@ ata_highpoint_chipinit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(dev); int rid = ATA_IRQ_RID; - if (!(ctlr->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE))) { + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, "unable to map interrupt\n"); return ENXIO; } @@ -1136,8 +1136,8 @@ ata_promise_chipinit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(dev); int rid = ATA_IRQ_RID; - if (!(ctlr->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE))) { + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, "unable to map interrupt\n"); return ENXIO; } @@ -1173,8 +1173,8 @@ ata_promise_chipinit(device_t dev) ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = 0x1c; if (!(ctlr->r_res2 = - bus_alloc_resource(dev, ctlr->r_type2, &ctlr->r_rid2, - 0, ~0, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, ctlr->r_type2, &ctlr->r_rid2, + RF_ACTIVE))) return ENXIO; ctlr->dmainit = ata_promise_mio_dmainit; @@ -1619,8 +1619,8 @@ ata_sii_chipinit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(dev); int rid = ATA_IRQ_RID; - if (!(ctlr->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE))) { + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, "unable to map interrupt\n"); return ENXIO; } @@ -1635,8 +1635,8 @@ ata_sii_chipinit(device_t dev) ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = 0x24; if (!(ctlr->r_res2 = - bus_alloc_resource(dev, ctlr->r_type2, &ctlr->r_rid2, - 0, ~0, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, ctlr->r_type2, &ctlr->r_rid2, + RF_ACTIVE))) return ENXIO; if (ctlr->chip->cfg2 & SIISETCLK) { @@ -2330,8 +2330,8 @@ ata_setup_interrupt(device_t dev) int rid = ATA_IRQ_RID; if (!ATA_MASTERDEV(dev)) { - if (!(ctlr->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE))) { + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, "unable to map interrupt\n"); return ENXIO; } diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 8fab433..414175f 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -177,8 +177,8 @@ ata_pci_attach(device_t dev) if ((cmd & PCIM_CMD_BUSMASTEREN) == PCIM_CMD_BUSMASTEREN) { ctlr->r_type1 = SYS_RES_IOPORT; ctlr->r_rid1 = ATA_BMADDR_RID; - ctlr->r_res1 = bus_alloc_resource(dev, ctlr->r_type1, &ctlr->r_rid1, - 0, ~0, 1, RF_ACTIVE); + ctlr->r_res1 = bus_alloc_resource_any(dev, ctlr->r_type1, &ctlr->r_rid1, + RF_ACTIVE); } ctlr->chipinit(dev); diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c index 40ec01b..4a4361a 100644 --- a/sys/dev/ath/if_ath_pci.c +++ b/sys/dev/ath/if_ath_pci.c @@ -144,8 +144,8 @@ ath_pci_attach(device_t dev) * Setup memory-mapping of PCI registers. */ rid = BS_BAR; - psc->sc_sr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + psc->sc_sr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (psc->sc_sr == NULL) { device_printf(dev, "cannot map register space\n"); goto bad; @@ -162,8 +162,8 @@ ath_pci_attach(device_t dev) * Arrange interrupt line. */ rid = 0; - psc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE|RF_ACTIVE); + psc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE|RF_ACTIVE); if (psc->sc_irq == NULL) { device_printf(dev, "could not map interrupt\n"); goto bad1; diff --git a/sys/dev/atkbdc/atkbd_atkbdc.c b/sys/dev/atkbdc/atkbd_atkbdc.c index 6b99e91..715ab05 100644 --- a/sys/dev/atkbdc/atkbd_atkbdc.c +++ b/sys/dev/atkbdc/atkbd_atkbdc.c @@ -96,8 +96,8 @@ atkbdprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_KBD; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (res == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -134,8 +134,8 @@ atkbdattach(device_t dev) return error; /* declare our interrupt handler */ - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return ENXIO; error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, atkbd_isa_intr, diff --git a/sys/dev/atkbdc/atkbd_isa.c b/sys/dev/atkbdc/atkbd_isa.c index 6b99e91..715ab05 100644 --- a/sys/dev/atkbdc/atkbd_isa.c +++ b/sys/dev/atkbdc/atkbd_isa.c @@ -96,8 +96,8 @@ atkbdprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_KBD; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (res == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -134,8 +134,8 @@ atkbdattach(device_t dev) return error; /* declare our interrupt handler */ - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return ENXIO; error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, atkbd_isa_intr, diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c index 2618adf..1750336 100644 --- a/sys/dev/atkbdc/atkbdc_isa.c +++ b/sys/dev/atkbdc/atkbdc_isa.c @@ -143,16 +143,14 @@ atkbdc_probe(device_t dev) return ENXIO; if (count > 1) /* adjust the count */ bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1); - port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port0 == NULL) return ENXIO; rid = 1; if (bus_get_resource(dev, SYS_RES_IOPORT, rid, NULL, NULL) != 0) bus_set_resource(dev, SYS_RES_IOPORT, 1, start + KBD_STATUS_PORT, 1); - port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port1 == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, port0); return ENXIO; @@ -193,13 +191,13 @@ atkbdc_attach(device_t dev) } rid = 0; - sc->port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (sc->port0 == NULL) return ENXIO; rid = 1; - sc->port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (sc->port1 == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0); return ENXIO; diff --git a/sys/dev/atkbdc/atkbdc_subr.c b/sys/dev/atkbdc/atkbdc_subr.c index 2618adf..1750336 100644 --- a/sys/dev/atkbdc/atkbdc_subr.c +++ b/sys/dev/atkbdc/atkbdc_subr.c @@ -143,16 +143,14 @@ atkbdc_probe(device_t dev) return ENXIO; if (count > 1) /* adjust the count */ bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1); - port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port0 == NULL) return ENXIO; rid = 1; if (bus_get_resource(dev, SYS_RES_IOPORT, rid, NULL, NULL) != 0) bus_set_resource(dev, SYS_RES_IOPORT, 1, start + KBD_STATUS_PORT, 1); - port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port1 == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, port0); return ENXIO; @@ -193,13 +191,13 @@ atkbdc_attach(device_t dev) } rid = 0; - sc->port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (sc->port0 == NULL) return ENXIO; rid = 1; - sc->port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (sc->port1 == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0); return ENXIO; diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index dd2fd7e..a414ba6 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -943,8 +943,8 @@ psmprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -1254,8 +1254,8 @@ psmattach(device_t dev) /* Setup our interrupt handler */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, psmintr, sc, &sc->ih); @@ -3058,8 +3058,8 @@ psmcpnp_probe(device_t dev) "assuming irq %ld\n", irq); bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1); } - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE); bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* keep quiet */ @@ -3087,8 +3087,7 @@ psmcpnp_attach(device_t dev) * (See psmidentify() above.) */ rid = 0; - bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE); + bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); } return 0; diff --git a/sys/dev/awi/if_awi_pccard.c b/sys/dev/awi/if_awi_pccard.c index f29708d..56f36a8 100644 --- a/sys/dev/awi/if_awi_pccard.c +++ b/sys/dev/awi/if_awi_pccard.c @@ -162,8 +162,8 @@ awi_pccard_attach(device_t dev) sc->sc_chip.sc_ioh = rman_get_bushandle(psc->sc_port_res); psc->sc_irq_rid = 0; - psc->sc_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &psc->sc_irq_rid, 0, ~0, 1, RF_ACTIVE); + psc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &psc->sc_irq_rid, RF_ACTIVE); if (!psc->sc_irq_res) { device_printf(dev, "awi_pccard_attach: irq alloc failed\n"); goto fail; diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index 2ea40f5..42491ea 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -359,7 +359,7 @@ bfe_attach(device_t dev) pci_enable_busmaster(dev); rid = BFE_PCI_MEMLO; - sc->bfe_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, + sc->bfe_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->bfe_res == NULL) { printf ("bfe%d: couldn't map memory\n", unit); @@ -374,7 +374,7 @@ bfe_attach(device_t dev) /* Allocate interrupt */ rid = 0; - sc->bfe_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->bfe_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->bfe_irq == NULL) { printf("bfe%d: couldn't map interrupt\n", unit); diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index bb6b454..f16414b 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2250,8 +2250,8 @@ bge_attach(dev) pci_enable_busmaster(dev); rid = BGE_PCI_BAR0; - sc->bge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE|PCI_RF_DENSE); + sc->bge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE|PCI_RF_DENSE); if (sc->bge_res == NULL) { printf ("bge%d: couldn't map memory\n", unit); @@ -2266,7 +2266,7 @@ bge_attach(dev) /* Allocate interrupt */ rid = 0; - sc->bge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->bge_irq == NULL) { diff --git a/sys/dev/bktr/bktr_os.c b/sys/dev/bktr/bktr_os.c index be2ed08..baa3058 100644 --- a/sys/dev/bktr/bktr_os.c +++ b/sys/dev/bktr/bktr_os.c @@ -345,9 +345,8 @@ bktr_attach( device_t dev ) * Map control/status registers. */ bktr->mem_rid = PCIR_BAR(0); - bktr->res_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &bktr->mem_rid, - 0, ~0, 1, RF_ACTIVE); - + bktr->res_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &bktr->mem_rid, RF_ACTIVE); if (!bktr->res_mem) { device_printf(dev, "could not map memory\n"); @@ -377,8 +376,8 @@ bktr_attach( device_t dev ) * Allocate our interrupt. */ bktr->irq_rid = 0; - bktr->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &bktr->irq_rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + bktr->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &bktr->irq_rid, RF_SHAREABLE | RF_ACTIVE); if (bktr->res_irq == NULL) { device_printf(dev, "could not map interrupt\n"); error = ENXIO; diff --git a/sys/dev/buslogic/bt_eisa.c b/sys/dev/buslogic/bt_eisa.c index eb28e75..3157503 100644 --- a/sys/dev/buslogic/bt_eisa.c +++ b/sys/dev/buslogic/bt_eisa.c @@ -123,8 +123,7 @@ bt_eisa_alloc_resources(device_t dev) * order. */ rid = 0; - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (!port) return (ENOMEM); @@ -133,8 +132,8 @@ bt_eisa_alloc_resources(device_t dev) if (eisa_get_irq(dev) != -1) { shared = bt->level_trigger_ints ? RF_SHAREABLE : 0; rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, shared | RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + shared | RF_ACTIVE); if (!irq) { if (port) bus_release_resource(dev, SYS_RES_IOPORT, diff --git a/sys/dev/buslogic/bt_isa.c b/sys/dev/buslogic/bt_isa.c index 24c7d7b..3241abd 100644 --- a/sys/dev/buslogic/bt_isa.c +++ b/sys/dev/buslogic/bt_isa.c @@ -68,8 +68,7 @@ bt_isa_alloc_resources(device_t dev, u_long portstart, u_long portend) if (isa_get_irq(dev) != -1) { rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (!irq) { if (port) bus_release_resource(dev, SYS_RES_IOPORT, @@ -81,8 +80,7 @@ bt_isa_alloc_resources(device_t dev, u_long portstart, u_long portend) if (isa_get_drq(dev) != -1) { rid = 0; - drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, RF_ACTIVE); if (!drq) { if (port) bus_release_resource(dev, SYS_RES_IOPORT, diff --git a/sys/dev/buslogic/bt_mca.c b/sys/dev/buslogic/bt_mca.c index 1b9a2f3..1bdfbe8 100644 --- a/sys/dev/buslogic/bt_mca.c +++ b/sys/dev/buslogic/bt_mca.c @@ -122,8 +122,7 @@ bt_mca_alloc_resources(device_t dev, int mode) int rid; 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); if (io == NULL) { printf("bt_mca_alloc_resources() failed to allocate IOPORT\n"); return (ENOMEM); @@ -132,16 +131,14 @@ bt_mca_alloc_resources(device_t dev, int mode) if (mode == BT_MCA_ATTACH) { rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (irq == NULL) { printf("bt_mca_alloc_resources() failed to allocate IRQ\n"); goto bad; } rid = 0; - drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &rid, RF_ACTIVE); if (drq == NULL) { printf("bt_mca_alloc_resources() failed to allocate DRQ\n"); goto bad; diff --git a/sys/dev/buslogic/bt_pci.c b/sys/dev/buslogic/bt_pci.c index 5ebfe9a..121bb25 100644 --- a/sys/dev/buslogic/bt_pci.c +++ b/sys/dev/buslogic/bt_pci.c @@ -68,23 +68,21 @@ bt_pci_alloc_resources(device_t dev) if (command & PCIM_CMD_MEMEN) { type = SYS_RES_MEMORY; rid = BT_PCI_MEMADDR; - regs = bus_alloc_resource(dev, type, &rid, - 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); } #else if (!regs && (command & PCIM_CMD_PORTEN)) { type = SYS_RES_IOPORT; rid = BT_PCI_IOADDR; - regs = bus_alloc_resource(dev, type, &rid, - 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); } #endif if (!regs) return (ENOMEM); zero = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &zero, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &zero, + RF_ACTIVE | RF_SHAREABLE); if (!irq) { bus_release_resource(dev, type, rid, regs); return (ENOMEM); diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c index 326bdc6..4105432 100644 --- a/sys/dev/cardbus/cardbus_cis.c +++ b/sys/dev/cardbus/cardbus_cis.c @@ -913,8 +913,7 @@ cardbus_alloc_resources(device_t cbdev, device_t child) /* Allocate IRQ */ rid = 0; - res = bus_alloc_resource(cbdev, SYS_RES_IRQ, &rid, 0, ~0UL, 1, - RF_SHAREABLE); + res = bus_alloc_resource_any(cbdev, SYS_RES_IRQ, &rid, RF_SHAREABLE); if (res == NULL) { device_printf(cbdev, "Can't get memory for irq\n"); free(barlist, M_DEVBUF); diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 9a4603c..18d2fc6 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -475,8 +475,8 @@ ciss_init_pci(struct ciss_softc *sc) error = ENXIO; sc->ciss_regs_rid = CISS_TL_SIMPLE_BAR_REGS; if ((sc->ciss_regs_resource = - bus_alloc_resource(sc->ciss_dev, SYS_RES_MEMORY, &sc->ciss_regs_rid, - 0, ~0, 1, RF_ACTIVE)) == NULL) { + bus_alloc_resource_any(sc->ciss_dev, SYS_RES_MEMORY, + &sc->ciss_regs_rid, RF_ACTIVE)) == NULL) { ciss_printf(sc, "can't allocate register window\n"); return(ENXIO); } @@ -490,8 +490,8 @@ ciss_init_pci(struct ciss_softc *sc) sc->ciss_cfg_rid = CISS_TL_SIMPLE_READ(sc, CISS_TL_SIMPLE_CFG_BAR) & 0xffff; if (sc->ciss_cfg_rid != sc->ciss_regs_rid) { if ((sc->ciss_cfg_resource = - bus_alloc_resource(sc->ciss_dev, SYS_RES_MEMORY, &sc->ciss_cfg_rid, - 0, ~0, 1, RF_ACTIVE)) == NULL) { + bus_alloc_resource_any(sc->ciss_dev, SYS_RES_MEMORY, + &sc->ciss_cfg_rid, RF_ACTIVE)) == NULL) { ciss_printf(sc, "can't allocate config window\n"); return(ENXIO); } @@ -574,8 +574,8 @@ ciss_init_pci(struct ciss_softc *sc) */ sc->ciss_irq_rid = 0; if ((sc->ciss_irq_resource = - bus_alloc_resource(sc->ciss_dev, SYS_RES_IRQ, &sc->ciss_irq_rid, 0, ~0, 1, - RF_ACTIVE | RF_SHAREABLE)) == NULL) { + bus_alloc_resource_any(sc->ciss_dev, SYS_RES_IRQ, &sc->ciss_irq_rid, + RF_ACTIVE | RF_SHAREABLE)) == NULL) { ciss_printf(sc, "can't allocate interrupt\n"); return(ENXIO); } diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index 89a3415..14c6a57 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -230,8 +230,7 @@ cm_alloc_irq(dev, rid) struct cm_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res) { sc->irq_rid = rid; sc->irq_res = res; diff --git a/sys/dev/cnw/if_cnw.c b/sys/dev/cnw/if_cnw.c index 801d715..b60cb74 100644 --- a/sys/dev/cnw/if_cnw.c +++ b/sys/dev/cnw/if_cnw.c @@ -1674,8 +1674,8 @@ static int cnw_alloc(dev) int error; rid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->mem_res) { device_printf(dev, "Cannot allocate attribute memory\n"); return (ENOMEM); @@ -1701,8 +1701,7 @@ static int cnw_alloc(dev) } rid = 0; - 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); if (!sc->irq) { device_printf(dev, "No irq?!\n"); return (ENXIO); diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index da8f6b1..3b28691 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -551,8 +551,8 @@ int cs_alloc_irq(device_t dev, int rid, int flags) struct cs_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, (RF_ACTIVE | flags)); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + (RF_ACTIVE | flags)); if (res) { sc->irq_rid = rid; sc->irq_res = res; diff --git a/sys/dev/ct/ct_isa.c b/sys/dev/ct/ct_isa.c index 2bebf349..15173e2 100644 --- a/sys/dev/ct/ct_isa.c +++ b/sys/dev/ct/ct_isa.c @@ -219,11 +219,11 @@ ct_isa_attach(device_t dev) chp->ch_bus_weight = ct_isa_bus_access_weight; irq_rid = 0; - ct->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0, ~0, - 1, RF_ACTIVE); + ct->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid, + RF_ACTIVE); drq_rid = 0; - ct->drq_res = bus_alloc_resource(dev, SYS_RES_DRQ, &drq_rid, 0, ~0, - 1, RF_ACTIVE); + ct->drq_res = bus_alloc_resource_any(dev, SYS_RES_DRQ, &drq_rid, + RF_ACTIVE); if (ct->irq_res == NULL || ct->drq_res == NULL) { ct_space_unmap(dev, ct); return ENXIO; diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 84c3019..b614db9 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1907,8 +1907,7 @@ dc_attach(device_t dev) pci_enable_busmaster(dev); rid = DC_RID; - sc->dc_res = bus_alloc_resource(dev, DC_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->dc_res = bus_alloc_resource_any(dev, DC_RES, &rid, RF_ACTIVE); if (sc->dc_res == NULL) { printf("dc%d: couldn't map ports/memory\n", unit); @@ -1921,7 +1920,7 @@ dc_attach(device_t dev) /* Allocate interrupt. */ rid = 0; - sc->dc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->dc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->dc_irq == NULL) { diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index c8a4da6..fb784dc 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -5151,12 +5151,10 @@ tulip_pci_attach(device_t dev) sc->tulip_if.if_softc = sc; #if defined(TULIP_IOMAPPED) rid = PCI_CBIO; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); #else rid = PCI_CBMA; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); #endif if (!res) return ENXIO; @@ -5219,8 +5217,8 @@ tulip_pci_attach(device_t dev) void *ih; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + 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)) { printf("%s: couldn't map interrupt\n", diff --git a/sys/dev/digi/digi_pci.c b/sys/dev/digi/digi_pci.c index a97345e..d80150d 100644 --- a/sys/dev/digi/digi_pci.c +++ b/sys/dev/digi/digi_pci.c @@ -177,13 +177,13 @@ digi_pci_attach(device_t dev) pci_write_config(dev, 0x40, 0, 4); pci_write_config(dev, 0x46, 0, 4); - sc->res.mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->res.mrid, - 0, ~0, 1, RF_ACTIVE); + sc->res.mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->res.mrid, + RF_ACTIVE); #ifdef DIGI_INTERRUPT sc->res.irqrid = 0; - sc->res.irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->res.irqrid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->res.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->res.irqrid, + RF_SHAREABLE | RF_ACTIVE); if (sc->res.irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); return (ENXIO); diff --git a/sys/dev/dpt/dpt_isa.c b/sys/dev/dpt/dpt_isa.c index 0cf97be..c0ede88 100644 --- a/sys/dev/dpt/dpt_isa.c +++ b/sys/dev/dpt/dpt_isa.c @@ -167,8 +167,8 @@ dpt_isa_attach (device_t dev) } dpt->drq_rid = 0; - dpt->drq_res = bus_alloc_resource(dev, SYS_RES_DRQ, &dpt->drq_rid, - 0, ~0, 1, RF_ACTIVE); + dpt->drq_res = bus_alloc_resource_any(dev, SYS_RES_DRQ, &dpt->drq_rid, + RF_ACTIVE); if (!dpt->drq_res) { device_printf(dev, "No DRQ!\n"); error = ENOMEM; diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c index 445606e..7385215 100644 --- a/sys/dev/dpt/dpt_pci.c +++ b/sys/dev/dpt/dpt_pci.c @@ -90,17 +90,15 @@ dpt_pci_attach (device_t dev) if ((command & PCIM_CMD_MEMEN) != 0) { dpt->io_rid = DPT_PCI_MEMADDR; dpt->io_type = SYS_RES_MEMORY; - dpt->io_res = bus_alloc_resource(dev, dpt->io_type, - &dpt->io_rid, - 0, ~0, 1, RF_ACTIVE); + dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type, + &dpt->io_rid, RF_ACTIVE); } #endif if (dpt->io_res == NULL && (command & PCIM_CMD_PORTEN) != 0) { dpt->io_rid = DPT_PCI_IOADDR; dpt->io_type = SYS_RES_IOPORT; - dpt->io_res = bus_alloc_resource(dev, dpt->io_type, - &dpt->io_rid, - 0, ~0, 1, RF_ACTIVE); + dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type, + &dpt->io_rid, RF_ACTIVE); } if (dpt->io_res == NULL) { @@ -111,8 +109,8 @@ dpt_pci_attach (device_t dev) dpt->io_offset = 0x10; dpt->irq_rid = 0; - dpt->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &dpt->irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + dpt->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &dpt->irq_rid, + RF_ACTIVE | RF_SHAREABLE); if (dpt->irq_res == NULL) { device_printf(dev, "No irq?!\n"); error = ENOMEM; diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c index 533ac93..5925687 100644 --- a/sys/dev/dpt/dpt_scsi.c +++ b/sys/dev/dpt/dpt_scsi.c @@ -1225,16 +1225,16 @@ dpt_alloc_resources (device_t dev) dpt = device_get_softc(dev); - dpt->io_res = bus_alloc_resource(dev, dpt->io_type, &dpt->io_rid, - 0, ~0, 1, RF_ACTIVE); + dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type, &dpt->io_rid, + RF_ACTIVE); if (dpt->io_res == NULL) { device_printf(dev, "No I/O space?!\n"); error = ENOMEM; goto bad; } - dpt->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &dpt->irq_rid, - 0, ~0, 1, RF_ACTIVE); + dpt->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &dpt->irq_rid, + RF_ACTIVE); if (dpt->irq_res == NULL) { device_printf(dev, "No IRQ!\n"); error = ENOMEM; diff --git a/sys/dev/drm/drm_irq.h b/sys/dev/drm/drm_irq.h index 7275269..8f7d747 100644 --- a/sys/dev/drm/drm_irq.h +++ b/sys/dev/drm/drm_irq.h @@ -98,8 +98,8 @@ int DRM(irq_install)(drm_device_t *dev) /* Install handler */ #ifdef __FreeBSD__ dev->irqrid = 0; - dev->irqr = bus_alloc_resource(dev->device, SYS_RES_IRQ, &dev->irqrid, - 0, ~0, 1, RF_SHAREABLE); + dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ, + &dev->irqrid, RF_SHAREABLE); if (!dev->irqr) { retcode = ENOENT; goto err; diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 43d8c5e..5bac677 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1655,8 +1655,8 @@ ed_alloc_irq(dev, rid, flags) struct ed_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, (RF_ACTIVE | flags)); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + (RF_ACTIVE | flags)); if (res) { sc->irq_rid = rid; sc->irq_res = res; diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index c643228..4bbe603 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -1680,9 +1680,8 @@ em_allocate_pci_resources(struct adapter * adapter) device_t dev = adapter->dev; rid = EM_MMBA; - adapter->res_memory = bus_alloc_resource(dev, SYS_RES_MEMORY, - &rid, 0, ~0, 1, - RF_ACTIVE); + adapter->res_memory = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); if (!(adapter->res_memory)) { printf("em%d: Unable to allocate bus resource: memory\n", adapter->unit); @@ -1707,9 +1706,10 @@ em_allocate_pci_resources(struct adapter * adapter) rid += 4; } - adapter->res_ioport = bus_alloc_resource(dev, SYS_RES_IOPORT, - &adapter->io_rid, 0, ~0, 1, - RF_ACTIVE); + adapter->res_ioport = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, + &adapter->io_rid, + RF_ACTIVE); if (!(adapter->res_ioport)) { printf("em%d: Unable to allocate bus resource: ioport\n", adapter->unit); @@ -1721,9 +1721,9 @@ em_allocate_pci_resources(struct adapter * adapter) } rid = 0x0; - adapter->res_interrupt = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + adapter->res_interrupt = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | + RF_ACTIVE); if (!(adapter->res_interrupt)) { printf("em%d: Unable to allocate bus resource: interrupt\n", adapter->unit); diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c index dac053e..19c0a48 100644 --- a/sys/dev/en/if_en_pci.c +++ b/sys/dev/en/if_en_pci.c @@ -212,8 +212,8 @@ en_pci_attach(device_t dev) * Map control/status registers. */ rid = PCI_CBMA; - scp->res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + scp->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (scp->res == NULL) { device_printf(dev, "could not map memory\n"); error = ENXIO; @@ -228,7 +228,7 @@ en_pci_attach(device_t dev) * Allocate our interrupt. */ rid = 0; - scp->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + scp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (scp->irq == NULL) { device_printf(dev, "could not map interrupt\n"); diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index 6eb1f6a..93bf5d5 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -175,16 +175,15 @@ ep_alloc(device_t dev) u_int16_t result; rid = 0; - sc->iobase = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->iobase = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (!sc->iobase) { device_printf(dev, "No I/O space?!\n"); error = ENXIO; goto bad; } rid = 0; - 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); if (!sc->irq) { device_printf(dev, "No irq?!\n"); error = ENXIO; diff --git a/sys/dev/ep/if_ep_eisa.c b/sys/dev/ep/if_ep_eisa.c index d5e0c74..eaab7ea 100644 --- a/sys/dev/ep/if_ep_eisa.c +++ b/sys/dev/ep/if_ep_eisa.c @@ -182,8 +182,7 @@ ep_eisa_attach(device_t dev) int rid; rid = 1; - eisa_io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + eisa_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (!eisa_io) { device_printf(dev, "No I/O space?!\n"); error = ENXIO; diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 02dcd62..9d8b9b0 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -169,16 +169,16 @@ ex_alloc_resources (device_t dev) struct ex_softc * sc = device_get_softc(dev); int error = 0; - sc->ioport = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->ioport_rid, - 0, ~0, 1, RF_ACTIVE); + sc->ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->ioport_rid, RF_ACTIVE); if (!sc->ioport) { device_printf(dev, "No I/O space?!\n"); error = ENOMEM; goto bad; } - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (!sc->irq) { device_printf(dev, "No IRQ?!\n"); diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index 64304f6..8335e92 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -2831,8 +2831,8 @@ fatm_attach(device_t dev) goto fail; } sc->memid = 0x10; - sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, - 0, ~0, 1, RF_ACTIVE); + sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, + RF_ACTIVE); if (sc->memres == NULL) { if_printf(ifp, "could not map memory\n"); error = ENXIO; @@ -2852,8 +2852,8 @@ fatm_attach(device_t dev) * Allocate interrupt (activate at the end) */ sc->irqid = 0; - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_SHAREABLE | RF_ACTIVE); if (sc->irqres == NULL) { if_printf(ifp, "could not allocate irq\n"); error = ENXIO; diff --git a/sys/dev/fb/s3_pci.c b/sys/dev/fb/s3_pci.c index c47caa6..6096bdf 100644 --- a/sys/dev/fb/s3_pci.c +++ b/sys/dev/fb/s3_pci.c @@ -498,8 +498,8 @@ s3pci_attach(device_t dev) sc->enh_sh = rman_get_bushandle(sc->enh_res); rid = PCI_BASE_MEMORY; - if (!(sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE))) { + if (!(sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE))) { printf("%s: mem resource allocation failed!\n", __func__); goto error; diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 265ae1b..2dc88b9 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -762,9 +762,8 @@ fdc_alloc_resources(struct fdc_data *fdc) /* * Now (finally!) allocate the control port. */ - fdc->res_ctl = bus_alloc_resource(dev, SYS_RES_IOPORT, - &fdc->rid_ctl, - 0ul, ~0ul, 1, RF_ACTIVE); + fdc->res_ctl = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &fdc->rid_ctl, RF_ACTIVE); if (fdc->res_ctl == 0) { device_printf(dev, "cannot reserve control I/O port range (control port)\n"); @@ -774,18 +773,17 @@ fdc_alloc_resources(struct fdc_data *fdc) fdc->ctlh = rman_get_bushandle(fdc->res_ctl); } - fdc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &fdc->rid_irq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &fdc->rid_irq, RF_ACTIVE); if (fdc->res_irq == 0) { device_printf(dev, "cannot reserve interrupt line\n"); return ENXIO; } if ((fdc->flags & FDC_NODMA) == 0) { - fdc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, - &fdc->rid_drq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &fdc->rid_drq, + RF_ACTIVE); if (fdc->res_drq == 0) { device_printf(dev, "cannot reserve DMA request line\n"); return ENXIO; diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index c806167..613c76a 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -892,8 +892,7 @@ fe_alloc_irq(device_t dev, int flags) int rid; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, RF_ACTIVE | flags); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | flags); if (res) { sc->irq_res = res; return (0); diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c index 1ebb8f0..59086dd 100644 --- a/sys/dev/firewire/fwohci_pci.c +++ b/sys/dev/firewire/fwohci_pci.c @@ -254,8 +254,7 @@ fwohci_pci_attach(device_t self) fwohci_pci_init(self); rid = PCI_CBMEM; - sc->bsr = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->bsr = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->bsr) { device_printf(self, "Could not map memory\n"); return ENXIO; @@ -265,7 +264,7 @@ fwohci_pci_attach(device_t self) sc->bsh = rman_get_bushandle(sc->bsr); rid = 0; - sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { device_printf(self, "Could not allocate irq\n"); diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index b6c20f0..a83bc02 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -442,14 +442,13 @@ fxp_attach(device_t dev) sc->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; sc->rgd = (m1 == PCIM_CMD_MEMEN)? FXP_PCI_MMBA : FXP_PCI_IOBA; - sc->mem = bus_alloc_resource(dev, sc->rtp, &sc->rgd, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, sc->rtp, &sc->rgd, RF_ACTIVE); if (sc->mem == NULL) { sc->rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; sc->rgd = (m2 == PCIM_CMD_MEMEN)? FXP_PCI_MMBA : FXP_PCI_IOBA; - sc->mem = bus_alloc_resource(dev, sc->rtp, &sc->rgd, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, sc->rtp, &sc->rgd, + RF_ACTIVE); } if (!sc->mem) { @@ -468,7 +467,7 @@ fxp_attach(device_t dev) * Allocate our interrupt. */ rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq == NULL) { device_printf(dev, "could not map interrupt\n"); diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c index cdf5c71..8a401e6 100644 --- a/sys/dev/gem/if_gem_pci.c +++ b/sys/dev/gem/if_gem_pci.c @@ -175,16 +175,16 @@ gem_pci_attach(dev) sc->sc_pci = 1; /* XXX */ gsc->gsc_srid = PCI_GEM_BASEADDR; - gsc->gsc_sres = bus_alloc_resource(dev, SYS_RES_MEMORY, &gsc->gsc_srid, - 0, ~0, 1, RF_ACTIVE); + gsc->gsc_sres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &gsc->gsc_srid, RF_ACTIVE); if (gsc->gsc_sres == NULL) { device_printf(dev, "failed to allocate bus space resource\n"); return (ENXIO); } gsc->gsc_irid = 0; - gsc->gsc_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &gsc->gsc_irid, 0, - ~0, 1, RF_SHAREABLE | RF_ACTIVE); + gsc->gsc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &gsc->gsc_irid, RF_SHAREABLE | RF_ACTIVE); if (gsc->gsc_ires == NULL) { device_printf(dev, "failed to allocate interrupt resource\n"); goto fail_sres; diff --git a/sys/dev/gfb/gfb_pci.c b/sys/dev/gfb/gfb_pci.c index d36e2d8..7fb3878 100644 --- a/sys/dev/gfb/gfb_pci.c +++ b/sys/dev/gfb/gfb_pci.c @@ -104,7 +104,7 @@ pcigfb_attach(device_t dev) sc = device_get_softc(dev); sc->rev = pci_get_revid(dev); rid = GFB_MEM_BASE_RID; - sc->res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE|PCI_RF_DENSE); if(sc->res == NULL) { device_printf(dev, "couldn't map memory\n"); @@ -115,7 +115,7 @@ pcigfb_attach(device_t dev) /* Allocate interrupt (irq)... */ rid = 0x0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE|RF_ACTIVE); if(sc->irq == NULL) { device_printf(dev, "Couldn't map interrupt\n"); diff --git a/sys/dev/gx/if_gx.c b/sys/dev/gx/if_gx.c index dc5a01c..9c54680 100644 --- a/sys/dev/gx/if_gx.c +++ b/sys/dev/gx/if_gx.c @@ -272,13 +272,13 @@ gx_attach(device_t dev) } rid = GX_PCI_LOMEM; - gx->gx_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + gx->gx_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); #if 0 /* support PIO mode */ rid = PCI_LOIO; - gx->gx_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + gx->gx_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); #endif if (gx->gx_res == NULL) { @@ -292,7 +292,7 @@ gx_attach(device_t dev) /* Allocate interrupt */ rid = 0; - gx->gx_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + gx->gx_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (gx->gx_irq == NULL) { diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c index 80c8ff0..8238017 100644 --- a/sys/dev/hatm/if_hatm.c +++ b/sys/dev/hatm/if_hatm.c @@ -1698,8 +1698,8 @@ hatm_attach(device_t dev) goto failed; } sc->memid = PCIR_BAR(0); - sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, - 0, ~0, 1, RF_ACTIVE); + sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, + RF_ACTIVE); if (sc->memres == NULL) { device_printf(dev, "could not map memory\n"); error = ENXIO; @@ -1753,8 +1753,8 @@ hatm_attach(device_t dev) * Setup the interrupt */ sc->irqid = 0; - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_SHAREABLE | RF_ACTIVE); if (sc->irqres == 0) { device_printf(dev, "could not allocate irq\n"); error = ENXIO; diff --git a/sys/dev/hfa/hfa_freebsd.c b/sys/dev/hfa/hfa_freebsd.c index 94b5ff0..48a15ac 100644 --- a/sys/dev/hfa/hfa_freebsd.c +++ b/sys/dev/hfa/hfa_freebsd.c @@ -136,16 +136,16 @@ hfa_alloc (device_t dev) sc = (struct hfa_softc *)device_get_softc(dev); error = 0; - sc->mem = bus_alloc_resource(dev, sc->mem_type, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, sc->mem_type, &sc->mem_rid, + RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENXIO; goto fail; } - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->irq == NULL) { device_printf(dev, "Unable to allocate interrupt resource.\n"); error = ENXIO; diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index 77e4c65..43cf54a 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -320,8 +320,8 @@ hifn_attach(device_t dev) * and WRITE_REG_1 macros throughout the driver. */ rid = HIFN_BAR0; - sc->sc_bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_bar0res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->sc_bar0res == NULL) { device_printf(dev, "cannot map bar%d register space\n", 0); goto fail_pci; @@ -331,8 +331,8 @@ hifn_attach(device_t dev) sc->sc_bar0_lastreg = (bus_size_t) -1; rid = HIFN_BAR1; - sc->sc_bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_bar1res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->sc_bar1res == NULL) { device_printf(dev, "cannot map bar%d register space\n", 1); goto fail_io0; @@ -434,8 +434,8 @@ hifn_attach(device_t dev) * Arrange the interrupt line. */ rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE|RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE|RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "could not map interrupt\n"); goto fail_mem; diff --git a/sys/dev/hme/if_hme_pci.c b/sys/dev/hme/if_hme_pci.c index 1d205ff..6519577 100644 --- a/sys/dev/hme/if_hme_pci.c +++ b/sys/dev/hme/if_hme_pci.c @@ -156,15 +156,15 @@ hme_pci_attach(device_t dev) * */ hsc->hsc_srid = PCI_HME_BASEADDR; - hsc->hsc_sres = bus_alloc_resource(dev, SYS_RES_MEMORY, &hsc->hsc_srid, - 0, ~0, 1, RF_ACTIVE); + hsc->hsc_sres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &hsc->hsc_srid, RF_ACTIVE); if (hsc->hsc_sres == NULL) { device_printf(dev, "could not map device registers\n"); return (ENXIO); } hsc->hsc_irid = 0; - hsc->hsc_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &hsc->hsc_irid, 0, - ~0, 1, RF_SHAREABLE | RF_ACTIVE); + hsc->hsc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &hsc->hsc_irid, RF_SHAREABLE | RF_ACTIVE); if (hsc->hsc_ires == NULL) { device_printf(dev, "could not allocate interrupt\n"); error = ENXIO; diff --git a/sys/dev/hme/if_hme_sbus.c b/sys/dev/hme/if_hme_sbus.c index 503eb67..e2e44be 100644 --- a/sys/dev/hme/if_hme_sbus.c +++ b/sys/dev/hme/if_hme_sbus.c @@ -164,8 +164,8 @@ hme_sbus_attach(device_t dev) */ sc->sc_sebo = sc->sc_etxo = sc->sc_erxo = sc->sc_maco = sc->sc_mifo = 0; hsc->hsc_seb_rid = 0; - hsc->hsc_seb_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &hsc->hsc_seb_rid, 0, ~0, 1, RF_ACTIVE); + hsc->hsc_seb_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &hsc->hsc_seb_rid, RF_ACTIVE); if (hsc->hsc_seb_res == NULL) { device_printf(dev, "cannot map SEB registers\n"); return (ENXIO); @@ -174,8 +174,8 @@ hme_sbus_attach(device_t dev) sc->sc_sebh = rman_get_bushandle(hsc->hsc_seb_res); hsc->hsc_etx_rid = 1; - hsc->hsc_etx_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &hsc->hsc_etx_rid, 0, ~0, 1, RF_ACTIVE); + hsc->hsc_etx_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &hsc->hsc_etx_rid, RF_ACTIVE); if (hsc->hsc_etx_res == NULL) { device_printf(dev, "cannot map ETX registers\n"); goto fail_seb_res; @@ -184,8 +184,8 @@ hme_sbus_attach(device_t dev) sc->sc_etxh = rman_get_bushandle(hsc->hsc_etx_res); hsc->hsc_erx_rid = 2; - hsc->hsc_erx_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &hsc->hsc_erx_rid, 0, ~0, 1, RF_ACTIVE); + hsc->hsc_erx_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &hsc->hsc_erx_rid, RF_ACTIVE); if (hsc->hsc_erx_res == NULL) { device_printf(dev, "cannot map ERX registers\n"); goto fail_etx_res; @@ -194,8 +194,8 @@ hme_sbus_attach(device_t dev) sc->sc_erxh = rman_get_bushandle(hsc->hsc_erx_res); hsc->hsc_mac_rid = 3; - hsc->hsc_mac_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &hsc->hsc_mac_rid, 0, ~0, 1, RF_ACTIVE); + hsc->hsc_mac_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &hsc->hsc_mac_rid, RF_ACTIVE); if (hsc->hsc_mac_res == NULL) { device_printf(dev, "cannot map MAC registers\n"); goto fail_erx_res; @@ -208,8 +208,8 @@ hme_sbus_attach(device_t dev) * range, so map try to kluge around it. */ hsc->hsc_mif_rid = 4; - hsc->hsc_mif_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &hsc->hsc_mif_rid, 0, ~0, 1, RF_ACTIVE); + hsc->hsc_mif_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &hsc->hsc_mif_rid, RF_ACTIVE); if (hsc->hsc_mif_res == NULL) { if (bus_get_resource(dev, SYS_RES_MEMORY, hsc->hsc_mif_rid, &start, &count) != 0) { @@ -232,8 +232,8 @@ hme_sbus_attach(device_t dev) } hsc->hsc_irid = 0; - hsc->hsc_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &hsc->hsc_irid, 0, - ~0, 1, RF_SHAREABLE | RF_ACTIVE); + hsc->hsc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &hsc->hsc_irid, RF_SHAREABLE | RF_ACTIVE); if (hsc->hsc_ires == NULL) { device_printf(dev, "could not allocate interrupt\n"); error = ENXIO; diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index 94a56ec..7ce696e 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -176,8 +176,8 @@ ichsmb_pci_attach(device_t dev) /* Allocate interrupt */ sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->irq_rid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->irq_rid, RF_ACTIVE | RF_SHAREABLE); if (sc->irq_res == NULL) { log(LOG_ERR, "%s: can't get IRQ\n", device_get_nameunit(dev)); error = ENXIO; diff --git a/sys/dev/ida/ida_eisa.c b/sys/dev/ida/ida_eisa.c index cd9741c..7bf0036 100644 --- a/sys/dev/ida/ida_eisa.c +++ b/sys/dev/ida/ida_eisa.c @@ -285,8 +285,8 @@ ida_eisa_attach(device_t dev) ida->regs_res_type = SYS_RES_IOPORT; ida->regs_res_id = 0; - ida->regs = bus_alloc_resource(dev, ida->regs_res_type, - &ida->regs_res_id, 0, ~0, 1, RF_ACTIVE); + ida->regs = bus_alloc_resource_any(dev, ida->regs_res_type, + &ida->regs_res_id, RF_ACTIVE); if (ida->regs == NULL) { device_printf(dev, "can't allocate register resources\n"); return (ENOMEM); @@ -316,8 +316,8 @@ ida_eisa_attach(device_t dev) rid = 0; ida->irq_res_type = SYS_RES_IRQ; - ida->irq = bus_alloc_resource(dev, ida->irq_res_type, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + ida->irq = bus_alloc_resource_any(dev, ida->irq_res_type, &rid, + RF_ACTIVE | RF_SHAREABLE); if (ida->irq == NULL) { ida_free(ida); return (ENOMEM); diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c index b394b04..d1cdc4e 100644 --- a/sys/dev/ida/ida_pci.c +++ b/sys/dev/ida/ida_pci.c @@ -256,8 +256,8 @@ ida_pci_attach(device_t dev) if (id == IDA_DEVICEID_DEC_SMART) ida->regs_res_id = PCIR_BAR(0); - ida->regs = bus_alloc_resource(dev, ida->regs_res_type, - &ida->regs_res_id, 0, ~0, 1, RF_ACTIVE); + ida->regs = bus_alloc_resource_any(dev, ida->regs_res_type, + &ida->regs_res_id, RF_ACTIVE); if (ida->regs == NULL) { device_printf(dev, "can't allocate memory resources\n"); return (ENOMEM); @@ -277,8 +277,8 @@ ida_pci_attach(device_t dev) rid = 0; ida->irq_res_type = SYS_RES_IRQ; - ida->irq = bus_alloc_resource(dev, ida->irq_res_type, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + ida->irq = bus_alloc_resource_any(dev, ida->irq_res_type, &rid, + RF_ACTIVE | RF_SHAREABLE); if (ida->irq == NULL) { ida_free(ida); return (ENOMEM); diff --git a/sys/dev/idt/idt_pci.c b/sys/dev/idt/idt_pci.c index e3bfe79..1112d31 100644 --- a/sys/dev/idt/idt_pci.c +++ b/sys/dev/idt/idt_pci.c @@ -141,8 +141,8 @@ idt_attach(device_t dev) /* Map IDT registers */ sc->mem_rid = 0x14; sc->mem_type = SYS_RES_MEMORY; - sc->mem = bus_alloc_resource(dev, sc->mem_type, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, sc->mem_type, &sc->mem_rid, + RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "could not map registers.\n"); error = ENXIO; @@ -153,8 +153,8 @@ idt_attach(device_t dev) /* Map interrupt */ sc->irq_rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE | RF_SHAREABLE); if (sc->irq == NULL) { device_printf(dev, "could not map interrupt.\n"); error = ENXIO; diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index b1f66ab..11239b4 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -1714,8 +1714,8 @@ ie_alloc_resources (device_t dev) error = 0; sc = device_get_softc(dev); - sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->io_rid, - 0, ~0, 1, RF_ACTIVE); + sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->io_rid, + RF_ACTIVE); if (!sc->io_res) { device_printf(dev, "No I/O space?!\n"); error = ENOMEM; @@ -1724,8 +1724,8 @@ ie_alloc_resources (device_t dev) sc->io_bt = rman_get_bustag(sc->io_res); sc->io_bh = rman_get_bushandle(sc->io_res); - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + RF_ACTIVE); if (!sc->mem_res) { device_printf(dev, "No Memory!\n"); error = ENOMEM; @@ -1734,8 +1734,8 @@ ie_alloc_resources (device_t dev) sc->mem_bt = rman_get_bustag(sc->mem_res); sc->mem_bh = rman_get_bushandle(sc->mem_res); - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (!sc->irq_res) { device_printf(dev, "No IRQ!\n"); error = ENOMEM; diff --git a/sys/dev/if_ndis/if_ndis_pccard.c b/sys/dev/if_ndis/if_ndis_pccard.c index c89ce04..ef13299 100644 --- a/sys/dev/if_ndis/if_ndis_pccard.c +++ b/sys/dev/if_ndis/if_ndis_pccard.c @@ -194,9 +194,9 @@ ndis_attach_pccard(dev) sc->ndis_dev = dev; sc->ndis_io_rid = 0; - sc->ndis_res_io = bus_alloc_resource(dev, + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -206,8 +206,8 @@ ndis_attach_pccard(dev) sc->ndis_rescnt++; rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ndis_irq = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c index bcf081c..8ab1f55 100644 --- a/sys/dev/if_ndis/if_ndis_pci.c +++ b/sys/dev/if_ndis/if_ndis_pci.c @@ -184,9 +184,9 @@ ndis_attach_pci(dev) switch (rle->type) { case SYS_RES_IOPORT: sc->ndis_io_rid = rle->rid; - sc->ndis_res_io = bus_alloc_resource(dev, + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -205,10 +205,10 @@ ndis_attach_pci(dev) if (rle->rid == PCIR_BAR(2)) { sc->ndis_altmem_rid = rle->rid; sc->ndis_res_altmem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_altmem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_altmem == NULL) { device_printf(dev, "couldn't map alt " @@ -219,10 +219,10 @@ ndis_attach_pci(dev) } else { sc->ndis_mem_rid = rle->rid; sc->ndis_res_mem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_mem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_mem == NULL) { device_printf(dev, "couldn't map memory\n"); @@ -233,8 +233,8 @@ ndis_attach_pci(dev) break; case SYS_RES_IRQ: rid = rle->rid; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ndis_irq = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, diff --git a/sys/dev/iir/iir_pci.c b/sys/dev/iir/iir_pci.c index f2e81d4..d0ff7bb 100644 --- a/sys/dev/iir/iir_pci.c +++ b/sys/dev/iir/iir_pci.c @@ -192,7 +192,7 @@ iir_pci_attach(device_t dev) /* map DPMEM */ rid = PCI_DPMEM; - io = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); + io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (io == NULL) { device_printf(dev, "can't allocate register resources\n"); error = ENOMEM; @@ -201,8 +201,8 @@ iir_pci_attach(device_t dev) /* get IRQ */ rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE | RF_SHAREABLE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); if (io == NULL) { device_printf(dev, "can't find IRQ value\n"); error = ENOMEM; diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c index c4a2db3..80681c7 100644 --- a/sys/dev/ips/ips_pci.c +++ b/sys/dev/ips/ips_pci.c @@ -92,13 +92,15 @@ static int ips_pci_attach(device_t dev) else sc->rid = PCIR_BAR(1); sc->iotype = SYS_RES_MEMORY; - sc->iores = bus_alloc_resource(dev, sc->iotype, &sc->rid, 0, ~0, 1, RF_ACTIVE); + sc->iores = bus_alloc_resource_any(dev, sc->iotype, + &sc->rid, RF_ACTIVE); } if(!sc->iores && command & PCIM_CMD_PORTEN){ PRINTF(10, "trying PORTIO\n"); sc->rid = PCIR_BAR(0); sc->iotype = SYS_RES_IOPORT; - sc->iores = bus_alloc_resource(dev, sc->iotype, &sc->rid, 0, ~0, 1, RF_ACTIVE); + sc->iores = bus_alloc_resource_any(dev, sc->iotype, + &sc->rid, RF_ACTIVE); } if(sc->iores == NULL){ device_printf(dev, "resource allocation failed\n"); @@ -108,7 +110,8 @@ static int ips_pci_attach(device_t dev) sc->bushandle = rman_get_bushandle(sc->iores); /*allocate an interrupt. when does the irq become active? after leaving attach? */ sc->irqrid = 0; - if(!(sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqrid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE))){ + if(!(sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->irqrid, RF_SHAREABLE | RF_ACTIVE))){ device_printf(dev, "irq allocation failed\n"); goto error; } diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index aa5d60a..f23a048 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -416,12 +416,12 @@ isp_pci_attach(device_t dev) if (cmd & m1) { rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - regs = bus_alloc_resource(dev, rtp, &rgd, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, rtp, &rgd, RF_ACTIVE); } if (regs == NULL && (cmd & m2)) { rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; rgd = (m2 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - regs = bus_alloc_resource(dev, rtp, &rgd, 0, ~0, 1, RF_ACTIVE); + regs = bus_alloc_resource_any(dev, rtp, &rgd, RF_ACTIVE); } if (regs == NULL) { device_printf(dev, "unable to map any ports\n"); @@ -591,8 +591,8 @@ isp_pci_attach(device_t dev) pci_write_config(dev, PCIR_ROMADDR, data, 4); iqd = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &iqd, 0, ~0, - 1, RF_ACTIVE | RF_SHAREABLE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, + RF_ACTIVE | RF_SHAREABLE); if (irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c index 5b0e501..ad88a95 100644 --- a/sys/dev/isp/isp_sbus.c +++ b/sys/dev/isp/isp_sbus.c @@ -175,7 +175,7 @@ isp_sbus_attach(device_t dev) rid = 0; regs = - bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (regs == 0) { device_printf(dev, "unable to map registers\n"); goto bad; @@ -259,8 +259,8 @@ isp_sbus_attach(device_t dev) } iqd = 0; - sbs->sbus_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &iqd, 0, ~0, - 1, RF_ACTIVE | RF_SHAREABLE); + sbs->sbus_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, + RF_ACTIVE | RF_SHAREABLE); if (sbs->sbus_ires == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c index 4746e77..0b4efe7 100644 --- a/sys/dev/joy/joy.c +++ b/sys/dev/joy/joy.c @@ -103,7 +103,7 @@ joy_attach(device_t dev) struct joy_softc *joy = device_get_softc(dev); joy->rid = 0; - joy->res = bus_alloc_resource(dev, SYS_RES_IOPORT, &joy->rid, 0, ~0, 1, + joy->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &joy->rid, RF_ACTIVE); if (joy->res == NULL) return ENXIO; diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index 1e2385d..f801d8d 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -528,8 +528,7 @@ lge_attach(dev) pci_enable_busmaster(dev); rid = LGE_RID; - sc->lge_res = bus_alloc_resource(dev, LGE_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->lge_res = bus_alloc_resource_any(dev, LGE_RES, &rid, RF_ACTIVE); if (sc->lge_res == NULL) { printf("lge%d: couldn't map ports/memory\n", unit); @@ -542,7 +541,7 @@ lge_attach(dev) /* Allocate interrupt */ rid = 0; - sc->lge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->lge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->lge_irq == NULL) { diff --git a/sys/dev/lnc/if_lnc_cbus.c b/sys/dev/lnc/if_lnc_cbus.c index 824f9ed..a6bc56d 100644 --- a/sys/dev/lnc/if_lnc_cbus.c +++ b/sys/dev/lnc/if_lnc_cbus.c @@ -164,8 +164,8 @@ lnc_isa_attach(device_t dev) bus_set_resource(dev, SYS_RES_IRQ, 0, 6, 1); sc->irqrid = 0; - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqrid, 0, ~0, 1, - RF_ACTIVE); + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqrid, + RF_ACTIVE); if (! sc->irqres) { device_printf(dev, "Failed to allocate irq\n"); diff --git a/sys/dev/lnc/if_lnc_isa.c b/sys/dev/lnc/if_lnc_isa.c index 5a0ecc6..3669571 100644 --- a/sys/dev/lnc/if_lnc_isa.c +++ b/sys/dev/lnc/if_lnc_isa.c @@ -62,8 +62,8 @@ lnc_legacy_probe(device_t dev) struct lnc_softc *sc = device_get_softc(dev); sc->portrid = 0; - sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->portrid, - 0, ~0, 1, RF_ACTIVE); + sc->portres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->portrid, + RF_ACTIVE); if (! sc->portres) { device_printf(dev, "Failed to allocate I/O ports\n"); @@ -141,8 +141,8 @@ lnc_isa_attach(device_t dev) device_printf(dev, "Attaching %s\n", device_get_desc(dev)); sc->portrid = 0; - sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->portrid, - 0, ~0, 1, RF_ACTIVE); + sc->portres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->portrid, + RF_ACTIVE); if (! sc->portres) { device_printf(dev, "Failed to allocate I/O ports\n"); @@ -151,8 +151,8 @@ lnc_isa_attach(device_t dev) } sc->drqrid = 0; - sc->drqres = bus_alloc_resource(dev, SYS_RES_DRQ, &sc->drqrid, - 0, ~0, 1, RF_ACTIVE); + sc->drqres = bus_alloc_resource_any(dev, SYS_RES_DRQ, &sc->drqrid, + RF_ACTIVE); if (! sc->drqres) { device_printf(dev, "Failed to allocate DMA channel\n"); @@ -164,8 +164,8 @@ lnc_isa_attach(device_t dev) bus_set_resource(dev, SYS_RES_IRQ, 0, 10, 1); sc->irqrid = 0; - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqrid, 0, ~0, 1, - RF_ACTIVE); + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqrid, + RF_ACTIVE); if (! sc->irqres) { device_printf(dev, "Failed to allocate irq\n"); diff --git a/sys/dev/lnc/if_lnc_pci.c b/sys/dev/lnc/if_lnc_pci.c index 72d0ab8..e35ae61 100644 --- a/sys/dev/lnc/if_lnc_pci.c +++ b/sys/dev/lnc/if_lnc_pci.c @@ -102,8 +102,8 @@ lnc_pci_attach(device_t dev) pci_write_config(dev, PCIR_COMMAND, command, 4); sc->portrid = PCIR_BAR(0); - sc->portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->portrid, 0, ~0, 1, - RF_ACTIVE); + sc->portres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->portrid, + RF_ACTIVE); if (! sc->portres) { device_printf(dev, "Cannot allocate I/O ports\n"); @@ -111,8 +111,8 @@ lnc_pci_attach(device_t dev) return (ENXIO); } - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqrid, 0, ~0, 1, - RF_ACTIVE|RF_SHAREABLE); + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqrid, + RF_ACTIVE|RF_SHAREABLE); if (! sc->irqres) { device_printf(dev, "Cannot allocate irq\n"); diff --git a/sys/dev/matcd/matcd_isa.c b/sys/dev/matcd/matcd_isa.c index 7e81a52..48d01dd 100644 --- a/sys/dev/matcd/matcd_isa.c +++ b/sys/dev/matcd/matcd_isa.c @@ -149,8 +149,8 @@ static int matcd_alloc_resources (device_t dev) sc = device_get_softc(dev); if (sc->port_type) { - sc->port=bus_alloc_resource(dev, sc->port_type, &sc->port_rid, - 0, ~0, 1, RF_ACTIVE); + sc->port=bus_alloc_resource_any(dev, sc->port_type, + &sc->port_rid, RF_ACTIVE); if (sc->port == NULL) { device_printf(dev, "Port resource not available.\n"); diff --git a/sys/dev/mcd/mcd_isa.c b/sys/dev/mcd/mcd_isa.c index 3c78749..f631672 100644 --- a/sys/dev/mcd/mcd_isa.c +++ b/sys/dev/mcd/mcd_isa.c @@ -129,8 +129,8 @@ mcd_alloc_resources (device_t dev) error = 0; if (sc->port_type) { - sc->port = bus_alloc_resource(dev, sc->port_type, &sc->port_rid, - 0, ~0, 1, RF_ACTIVE); + sc->port = bus_alloc_resource_any(dev, sc->port_type, + &sc->port_rid, RF_ACTIVE); if (sc->port == NULL) { device_printf(dev, "Unable to allocate PORT resource.\n"); error = ENOMEM; @@ -141,8 +141,8 @@ mcd_alloc_resources (device_t dev) } if (sc->irq_type) { - sc->irq = bus_alloc_resource(dev, sc->irq_type, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, sc->irq_type, + &sc->irq_rid, RF_ACTIVE); if (sc->irq == NULL) { device_printf(dev, "Unable to allocate IRQ resource.\n"); error = ENOMEM; @@ -151,8 +151,8 @@ mcd_alloc_resources (device_t dev) } if (sc->drq_type) { - sc->drq = bus_alloc_resource(dev, sc->drq_type, &sc->drq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->drq = bus_alloc_resource_any(dev, sc->drq_type, + &sc->drq_rid, RF_ACTIVE); if (sc->drq == NULL) { device_printf(dev, "Unable to allocate DRQ resource.\n"); error = ENOMEM; diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 4862323..bf7b8cd 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -362,7 +362,8 @@ mlx_attach(struct mlx_softc *sc) * Allocate and connect our interrupt. */ rid = 0; - sc->mlx_irq = bus_alloc_resource(sc->mlx_dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->mlx_irq = bus_alloc_resource_any(sc->mlx_dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->mlx_irq == NULL) { device_printf(sc->mlx_dev, "can't allocate interrupt\n"); mlx_free(sc); diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c index 7640b43..0a4548b 100644 --- a/sys/dev/mlx/mlx_pci.c +++ b/sys/dev/mlx/mlx_pci.c @@ -164,18 +164,21 @@ mlx_pci_attach(device_t dev) case MLX_IFTYPE_3: sc->mlx_mem_type = SYS_RES_MEMORY; sc->mlx_mem_rid = MLX_CFG_BASE1; - sc->mlx_mem = bus_alloc_resource(dev, sc->mlx_mem_type, &sc->mlx_mem_rid, 0, ~0, 1, RF_ACTIVE); + sc->mlx_mem = bus_alloc_resource_any(dev, sc->mlx_mem_type, + &sc->mlx_mem_rid, RF_ACTIVE); if (sc->mlx_mem == NULL) { sc->mlx_mem_type = SYS_RES_IOPORT; sc->mlx_mem_rid = MLX_CFG_BASE0; - sc->mlx_mem = bus_alloc_resource(dev, sc->mlx_mem_type, &sc->mlx_mem_rid, 0, ~0, 1, RF_ACTIVE); + sc->mlx_mem = bus_alloc_resource_any(dev, sc->mlx_mem_type, + &sc->mlx_mem_rid, RF_ACTIVE); } break; case MLX_IFTYPE_4: case MLX_IFTYPE_5: sc->mlx_mem_type = SYS_RES_MEMORY; sc->mlx_mem_rid = MLX_CFG_BASE0; - sc->mlx_mem = bus_alloc_resource(dev, sc->mlx_mem_type, &sc->mlx_mem_rid, 0, ~0, 1, RF_ACTIVE); + sc->mlx_mem = bus_alloc_resource_any(dev, sc->mlx_mem_type, + &sc->mlx_mem_rid, RF_ACTIVE); break; } if (sc->mlx_mem == NULL) { diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index 5f4c1ec..eb035d0 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -368,8 +368,8 @@ mly_pci_attach(struct mly_softc *sc) * Allocate the PCI register window. */ sc->mly_regs_rid = PCIR_BAR(0); /* first base address register */ - if ((sc->mly_regs_resource = bus_alloc_resource(sc->mly_dev, SYS_RES_MEMORY, &sc->mly_regs_rid, - 0, ~0, 1, RF_ACTIVE)) == NULL) { + if ((sc->mly_regs_resource = bus_alloc_resource_any(sc->mly_dev, + SYS_RES_MEMORY, &sc->mly_regs_rid, RF_ACTIVE)) == NULL) { mly_printf(sc, "can't allocate register window\n"); goto fail; } @@ -380,8 +380,8 @@ mly_pci_attach(struct mly_softc *sc) * Allocate and connect our interrupt. */ sc->mly_irq_rid = 0; - if ((sc->mly_irq = bus_alloc_resource(sc->mly_dev, SYS_RES_IRQ, &sc->mly_irq_rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + if ((sc->mly_irq = bus_alloc_resource_any(sc->mly_dev, SYS_RES_IRQ, + &sc->mly_irq_rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { mly_printf(sc, "can't allocate interrupt\n"); goto fail; } diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c index f0b8003..874ee3e 100644 --- a/sys/dev/mpt/mpt_pci.c +++ b/sys/dev/mpt/mpt_pci.c @@ -319,8 +319,8 @@ mpt_attach(device_t dev) /* Get a handle to the interrupt */ iqd = 0; - mpt->pci_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &iqd, 0, ~0, - 1, RF_ACTIVE | RF_SHAREABLE); + mpt->pci_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, + RF_ACTIVE | RF_SHAREABLE); if (mpt->pci_irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c index 8cd40f1..3f4acc5 100644 --- a/sys/dev/mse/mse.c +++ b/sys/dev/mse/mse.c @@ -331,8 +331,7 @@ mse_attach(dev) MSE_IOSIZE, RF_ACTIVE); if (sc->sc_port == NULL) return ENXIO; - sc->sc_intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_intr == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); return ENXIO; diff --git a/sys/dev/musycc/musycc.c b/sys/dev/musycc/musycc.c index 9eae567..b4a70f2 100644 --- a/sys/dev/musycc/musycc.c +++ b/sys/dev/musycc/musycc.c @@ -1468,8 +1468,7 @@ musycc_attach(device_t self) csc->f[f] = self; device_set_softc(self, csc); rid = PCIR_BAR(0); - res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(self, "Could not map memory\n"); return ENXIO; @@ -1479,8 +1478,8 @@ musycc_attach(device_t self) /* Allocate interrupt */ rid = 0; - csc->irq[f] = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, - 1, RF_SHAREABLE | RF_ACTIVE); + csc->irq[f] = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (csc->irq[f] == NULL) { printf("couldn't map interrupt\n"); diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index 9ad5371..6f42a59 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -918,8 +918,7 @@ my_attach(device_t dev) } rid = MY_RID; - sc->my_res = bus_alloc_resource(dev, MY_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->my_res = bus_alloc_resource_any(dev, MY_RES, &rid, RF_ACTIVE); if (sc->my_res == NULL) { printf("my%d: couldn't map ports/memory\n", unit); @@ -930,8 +929,8 @@ my_attach(device_t dev) sc->my_bhandle = rman_get_bushandle(sc->my_res); rid = 0; - sc->my_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->my_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->my_irq == NULL) { printf("my%d: couldn't map interrupt\n", unit); diff --git a/sys/dev/ncv/ncr53c500_pccard.c b/sys/dev/ncv/ncr53c500_pccard.c index d72b5af..d3724ef 100644 --- a/sys/dev/ncv/ncr53c500_pccard.c +++ b/sys/dev/ncv/ncr53c500_pccard.c @@ -175,8 +175,8 @@ ncv_alloc_resource(DEVPORT_PDEVICE dev) } sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (sc->irq_res == NULL) { ncv_release_resource(dev); return(ENOMEM); @@ -193,8 +193,8 @@ ncv_alloc_resource(DEVPORT_PDEVICE dev) } sc->mem_rid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + RF_ACTIVE); if (sc->mem_res == NULL) { ncv_release_resource(dev); return(ENOMEM); diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 1d9e105..c41424e 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -862,8 +862,7 @@ nge_attach(dev) pci_enable_busmaster(dev); rid = NGE_RID; - sc->nge_res = bus_alloc_resource(dev, NGE_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->nge_res = bus_alloc_resource_any(dev, NGE_RES, &rid, RF_ACTIVE); if (sc->nge_res == NULL) { printf("nge%d: couldn't map ports/memory\n", unit); @@ -876,7 +875,7 @@ nge_attach(dev) /* Allocate interrupt */ rid = 0; - sc->nge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->nge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->nge_irq == NULL) { diff --git a/sys/dev/nsp/nsp_pccard.c b/sys/dev/nsp/nsp_pccard.c index a908ac0..31f6fac 100644 --- a/sys/dev/nsp/nsp_pccard.c +++ b/sys/dev/nsp/nsp_pccard.c @@ -138,8 +138,8 @@ nsp_alloc_resource(DEVPORT_PDEVICE dev) } sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (sc->irq_res == NULL) { nsp_release_resource(dev); return(ENOMEM); @@ -162,8 +162,8 @@ nsp_alloc_resource(DEVPORT_PDEVICE dev) } sc->mem_rid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + RF_ACTIVE); if (sc->mem_res == NULL) { nsp_release_resource(dev); return(ENOMEM); diff --git a/sys/dev/owi/if_owi.c b/sys/dev/owi/if_owi.c index 918370b..6b26cd0 100644 --- a/sys/dev/owi/if_owi.c +++ b/sys/dev/owi/if_owi.c @@ -1967,8 +1967,8 @@ owi_alloc(dev, rid) sc->wi_bhandle = rman_get_bushandle(sc->iobase); } else { sc->mem_rid = rid; - sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mem_rid, 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mem_rid, RF_ACTIVE); if (!sc->mem) { device_printf(dev, "No Mem space on prism2.5?\n"); @@ -1981,8 +1981,8 @@ owi_alloc(dev, rid) sc->irq_rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE | + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE | ((sc->wi_bus_type == WI_BUS_PCCARD) ? 0 : RF_SHAREABLE)); if (!sc->irq) { diff --git a/sys/dev/patm/if_patm_attach.c b/sys/dev/patm/if_patm_attach.c index ab4894d..dd4a52d 100644 --- a/sys/dev/patm/if_patm_attach.c +++ b/sys/dev/patm/if_patm_attach.c @@ -219,8 +219,8 @@ patm_attach(device_t dev) pci_enable_busmaster(dev); rid = IDT_PCI_REG_MEMBASE; - sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->memres == NULL) { patm_printf(sc, "could not map memory\n"); error = ENXIO; @@ -233,8 +233,8 @@ patm_attach(device_t dev) * Allocate the interrupt (enable it later) */ sc->irqid = 0; - sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, + RF_SHAREABLE | RF_ACTIVE); if (sc->irqres == 0) { patm_printf(sc, "could not allocate irq\n"); error = ENXIO; diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index 419d27d..55679b1 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -450,8 +450,8 @@ pccard_function_init(struct pccard_function *pf) } if (cfe->irqmask) { cfe->irqrid = 0; - r = cfe->irqres = bus_alloc_resource(bus, SYS_RES_IRQ, - &cfe->irqrid, 0, ~0, 1, 0); + r = cfe->irqres = bus_alloc_resource_any(bus, + SYS_RES_IRQ, &cfe->irqrid, 0); if (cfe->irqres == NULL) goto not_this_one; resource_list_add(rl, SYS_RES_IRQ, cfe->irqrid, diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index ad3810f..785091a 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -707,8 +707,8 @@ cbb_attach(device_t brdev) */ #endif rid = CBBR_SOCKBASE; - sc->base_res = bus_alloc_resource(brdev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->base_res = bus_alloc_resource_any(brdev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->base_res) { #ifdef BURN_BRIDGES device_printf(brdev, "Could not map register memory\n"); @@ -778,7 +778,7 @@ cbb_attach(device_t brdev) /* Map and establish the interrupt. */ rid = 0; - sc->irq_res = bus_alloc_resource(brdev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq_res = bus_alloc_resource_any(brdev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { printf("cbb: Unable to map IRQ...\n"); diff --git a/sys/dev/pci/isa_pci.c b/sys/dev/pci/isa_pci.c index e4455e0..e1013b5 100644 --- a/sys/dev/pci/isa_pci.c +++ b/sys/dev/pci/isa_pci.c @@ -175,7 +175,7 @@ pci_isab_attach(device_t dev) */ rid = 0; bus_set_resource(dev, SYS_RES_IOPORT, rid, ELCR_IOADDR, ELCR_IOLEN); - sc->elcr_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, + sc->elcr_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sc->elcr_res == NULL) device_printf(dev, "failed to allocate ELCR resource\n"); diff --git a/sys/dev/pcic/i82365.c b/sys/dev/pcic/i82365.c index c1ded62..6582746 100644 --- a/sys/dev/pcic/i82365.c +++ b/sys/dev/pcic/i82365.c @@ -212,8 +212,8 @@ pcic_activate(device_t dev) } sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (sc->irq_res) { sc->irq = rman_get_start(sc->irq_res); if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, diff --git a/sys/dev/pcic/i82365_isa.c b/sys/dev/pcic/i82365_isa.c index af3d134..0a46415 100644 --- a/sys/dev/pcic/i82365_isa.c +++ b/sys/dev/pcic/i82365_isa.c @@ -297,7 +297,7 @@ pcic_isa_probe(device_t dev) if (bus_get_resource_start(dev, SYS_RES_IOPORT, 0) == 0) return (ENXIO); rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res == NULL) { /* * No IRQ specified, find one. This can be due to the PnP diff --git a/sys/dev/pdq/if_fea.c b/sys/dev/pdq/if_fea.c index 2c1dc43..ea01423 100644 --- a/sys/dev/pdq/if_fea.c +++ b/sys/dev/pdq/if_fea.c @@ -192,8 +192,8 @@ pdq_eisa_attach (dev) sc->io_rid = 0; sc->io_type = SYS_RES_IOPORT; - sc->io = bus_alloc_resource(dev, sc->io_type, &sc->io_rid, - 0, ~0, 1, RF_ACTIVE); + sc->io = bus_alloc_resource_any(dev, sc->io_type, &sc->io_rid, + RF_ACTIVE); if (!sc->io) { device_printf(dev, "Unable to allocate I/O space resource.\n"); error = ENXIO; @@ -204,8 +204,8 @@ pdq_eisa_attach (dev) sc->mem_rid = 0; sc->mem_type = SYS_RES_MEMORY; - sc->mem = bus_alloc_resource(dev, sc->mem_type, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, sc->mem_type, &sc->mem_rid, + RF_ACTIVE); if (!sc->mem) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENXIO; @@ -215,8 +215,8 @@ pdq_eisa_attach (dev) sc->mem_bst = rman_get_bustag(sc->mem); sc->irq_rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_SHAREABLE | RF_ACTIVE); if (!sc->irq) { device_printf(dev, "Unable to allocate interrupt resource.\n"); error = ENXIO; diff --git a/sys/dev/pdq/if_fpa.c b/sys/dev/pdq/if_fpa.c index 997f0cc..e8082f5 100644 --- a/sys/dev/pdq/if_fpa.c +++ b/sys/dev/pdq/if_fpa.c @@ -130,8 +130,8 @@ pdq_pci_attach(device_t dev) sc->mem_rid = PCI_CBMA; sc->mem_type = SYS_RES_MEMORY; - sc->mem = bus_alloc_resource(dev, sc->mem_type, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, sc->mem_type, &sc->mem_rid, + RF_ACTIVE); if (!sc->mem) { device_printf(dev, "Unable to allocate I/O space resource.\n"); error = ENXIO; @@ -141,8 +141,8 @@ pdq_pci_attach(device_t dev) sc->mem_bst = rman_get_bustag(sc->mem); sc->irq_rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_SHAREABLE | RF_ACTIVE); if (!sc->irq) { device_printf(dev, "Unable to allocate interrupt resource.\n"); error = ENXIO; diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c index 6a82169..6cc0bca 100644 --- a/sys/dev/ppc/ppc.c +++ b/sys/dev/ppc/ppc.c @@ -1913,10 +1913,12 @@ ppc_probe(device_t dev) ppc->ppc_flags = device_get_flags(dev); if (!(ppc->ppc_flags & 0x20)) { - ppc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &ppc->rid_irq, - 0ul, ~0ul, 1, RF_SHAREABLE); - ppc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, &ppc->rid_drq, - 0ul, ~0ul, 1, RF_ACTIVE); + ppc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &ppc->rid_irq, + RF_SHAREABLE); + ppc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &ppc->rid_drq, + RF_ACTIVE); } if (ppc->res_irq) diff --git a/sys/dev/pst/pst-pci.c b/sys/dev/pst/pst-pci.c index f3aadbb..15dd337 100644 --- a/sys/dev/pst/pst-pci.c +++ b/sys/dev/pst/pst-pci.c @@ -78,14 +78,14 @@ iop_pci_attach(device_t dev) /* get resources */ rid = 0x10; sc->r_mem = - bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->r_mem) return 0; rid = 0x00; - sc->r_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, - 1, RF_SHAREABLE | RF_ACTIVE); + sc->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); /* now setup the infrastructure to talk to the device */ pci_write_config(dev, PCIR_COMMAND, diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index 3703ae3..315cff2 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -188,7 +188,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) printf("puc: name: %s\n", sc->sc_desc.name); #endif rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (!res) return (ENXIO); @@ -223,13 +223,13 @@ puc_attach(device_t dev, const struct puc_device_description *desc) type = (sc->sc_desc.ports[i].flags & PUC_FLAGS_MEMORY) ? SYS_RES_MEMORY : SYS_RES_IOPORT; - res = bus_alloc_resource(dev, type, &rid, 0ul, ~0ul, 1, + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); if (res == NULL && sc->sc_desc.ports[i].flags & PUC_FLAGS_ALTRES) { type = (type == SYS_RES_IOPORT) ? SYS_RES_MEMORY : SYS_RES_IOPORT; - res = bus_alloc_resource(dev, type, &rid, 0ul, ~0ul, 1, + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); } if (res == NULL) { diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index 514be96..c7dd67a 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -3727,8 +3727,8 @@ ray_res_alloc_irq(struct ray_softc *sc) bus_get_resource_count(sc->dev, SYS_RES_IRQ, 0)); sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (!sc->irq_res) { RAY_PRINTF(sc, "Cannot allocate irq"); return (ENOMEM); diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index b7a8e12..967b06b 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -281,8 +281,8 @@ rc_attach(device_t dev) sc->sc_bt = rman_get_bustag(sc->sc_port[0]); sc->sc_bh = rman_get_bushandle(sc->sc_port[0]); - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irqrid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqrid, + RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "failed to alloc IRQ\n"); goto fail; diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 28e6108..4459ff2 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -851,8 +851,8 @@ re_probe(dev) * so we can read the chip ID register. */ rid = RL_RID; - sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, + RF_ACTIVE); if (sc->rl_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); @@ -1136,8 +1136,8 @@ re_attach(dev) pci_enable_busmaster(dev); rid = RL_RID; - sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, + RF_ACTIVE); if (sc->rl_res == NULL) { printf ("re%d: couldn't map ports/memory\n", unit); @@ -1150,7 +1150,7 @@ re_attach(dev) /* Allocate interrupt */ rid = 0; - sc->rl_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->rl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->rl_irq == NULL) { diff --git a/sys/dev/rp/rp_pci.c b/sys/dev/rp/rp_pci.c index b7c1ad7..9994804 100644 --- a/sys/dev/rp/rp_pci.c +++ b/sys/dev/rp/rp_pci.c @@ -177,7 +177,8 @@ rp_pciattach(device_t dev) ctlp->bus_ctlp = NULL; ctlp->io_rid[0] = 0x10; - ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 1, RF_ACTIVE); + ctlp->io[0] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &ctlp->io_rid[0], RF_ACTIVE); if(ctlp->io[0] == NULL) { device_printf(dev, "ioaddr mapping failed for RocketPort(PCI).\n"); retval = ENXIO; diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c index af1bf13..9856961 100644 --- a/sys/dev/sab/sab.c +++ b/sys/dev/sab/sab.c @@ -255,7 +255,7 @@ sab_probe(device_t dev) strcmp(ebus_get_name(dev), "serial") != 0) return (ENXIO); rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (res == NULL) return (ENXIO); @@ -295,11 +295,11 @@ sab_attach(device_t dev) irqrid = 0; irqres = NULL; sc = device_get_softc(dev); - iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &iorid, 0, ~0, 1, + iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &iorid, RF_ACTIVE); if (iores == NULL) goto error; - irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &irqrid, 0, ~0, 1, + irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqrid, RF_ACTIVE); if (irqres == NULL) goto error; diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index 015eb8e..77beb51 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -241,8 +241,8 @@ safe_attach(device_t dev) * Setup memory-mapping of PCI registers. */ rid = BS_BAR; - sc->sc_sr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_sr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->sc_sr == NULL) { device_printf(dev, "cannot map register space\n"); goto bad; @@ -254,8 +254,8 @@ safe_attach(device_t dev) * Arrange interrupt line. */ rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE|RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE|RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "could not map interrupt\n"); goto bad1; diff --git a/sys/dev/sbni/if_sbni_isa.c b/sys/dev/sbni/if_sbni_isa.c index cb7b02c..0cd88ba 100644 --- a/sys/dev/sbni/if_sbni_isa.c +++ b/sys/dev/sbni/if_sbni_isa.c @@ -116,8 +116,8 @@ sbni_attach_isa(device_t dev) printf("sbni%d: <Granch SBNI12/ISA adapter> port 0x%lx", next_sbni_unit, rman_get_start(sc->io_res)); - sc->irq_res = bus_alloc_resource( - dev, SYS_RES_IRQ, &sc->irq_rid, 0ul, ~0ul, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any( + dev, SYS_RES_IRQ, &sc->irq_rid, RF_ACTIVE); if (sc->irq_res) { printf(" irq %ld\n", rman_get_start(sc->irq_res)); diff --git a/sys/dev/sbni/if_sbni_pci.c b/sys/dev/sbni/if_sbni_pci.c index bba4f24..92e864e 100644 --- a/sys/dev/sbni/if_sbni_pci.c +++ b/sys/dev/sbni/if_sbni_pci.c @@ -131,8 +131,8 @@ sbni_pci_attach(device_t dev) printf("sbni%d: <Granch SBNI12/PCI%sadapter> port 0x%lx", next_sbni_unit, sc->slave_sc ? " Dual " : " ", rman_get_start(sc->io_res)); - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0ul, ~0ul, 1, RF_SHAREABLE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_SHAREABLE); if (sc->irq_res) { printf(" irq %ld\n", rman_get_start(sc->irq_res)); diff --git a/sys/dev/sbsh/if_sbsh.c b/sys/dev/sbsh/if_sbsh.c index 0360e20..7e72212 100644 --- a/sys/dev/sbsh/if_sbsh.c +++ b/sys/dev/sbsh/if_sbsh.c @@ -238,7 +238,7 @@ sbsh_attach(device_t dev) } rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { diff --git a/sys/dev/scd/scd_isa.c b/sys/dev/scd/scd_isa.c index c905ec0..da2fe6a 100644 --- a/sys/dev/scd/scd_isa.c +++ b/sys/dev/scd/scd_isa.c @@ -128,8 +128,8 @@ scd_alloc_resources (device_t dev) error = 0; if (sc->port_type) { - sc->port = bus_alloc_resource(dev, sc->port_type, &sc->port_rid, - 0, ~0, 1, RF_ACTIVE); + sc->port = bus_alloc_resource_any(dev, sc->port_type, + &sc->port_rid, RF_ACTIVE); if (sc->port == NULL) { device_printf(dev, "Unable to allocate PORT resource.\n"); error = ENOMEM; diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index 980c577..92e7002 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -703,8 +703,7 @@ sf_attach(dev) pci_enable_busmaster(dev); rid = SF_RID; - sc->sf_res = bus_alloc_resource(dev, SF_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sf_res = bus_alloc_resource_any(dev, SF_RES, &rid, RF_ACTIVE); if (sc->sf_res == NULL) { printf ("sf%d: couldn't map ports\n", unit); @@ -717,7 +716,7 @@ sf_attach(dev) /* Allocate interrupt */ rid = 0; - sc->sf_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->sf_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sf_irq == NULL) { diff --git a/sys/dev/si/si_eisa.c b/sys/dev/si/si_eisa.c index fe42c23..f86f534 100644 --- a/sys/dev/si/si_eisa.c +++ b/sys/dev/si/si_eisa.c @@ -73,9 +73,8 @@ si_eisa_attach(device_t dev) sc->sc_type = SIEISA; sc->sc_port_rid = 0; - sc->sc_port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_port_rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_port_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_port_rid, RF_ACTIVE); if (!sc->sc_port_res) { device_printf(dev, "couldn't allocate ioports\n"); goto fail; @@ -83,9 +82,8 @@ si_eisa_attach(device_t dev) sc->sc_iobase = rman_get_start(sc->sc_port_res); sc->sc_mem_rid = 0; - sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, RF_ACTIVE); if (!sc->sc_mem_res) { device_printf(dev, "couldn't allocate iomemory"); goto fail; @@ -94,8 +92,9 @@ si_eisa_attach(device_t dev) sc->sc_maddr = rman_get_virtual(sc->sc_mem_res); sc->sc_irq_rid = 0; - sc->sc_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->sc_irq_res) { device_printf(dev, "couldn't allocate interrupt"); goto fail; diff --git a/sys/dev/si/si_isa.c b/sys/dev/si/si_isa.c index 2defec7..e9974a8 100644 --- a/sys/dev/si/si_isa.c +++ b/sys/dev/si/si_isa.c @@ -271,9 +271,9 @@ si_isa_attach(device_t dev) sc = device_get_softc(dev); sc->sc_mem_rid = 0; - sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, + RF_ACTIVE); if (!sc->sc_mem_res) { device_printf(dev, "couldn't map memory\n"); goto fail; @@ -282,8 +282,9 @@ si_isa_attach(device_t dev) sc->sc_maddr = rman_get_virtual(sc->sc_mem_res); sc->sc_irq_rid = 0; - sc->sc_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->sc_irq_res) { device_printf(dev, "couldn't allocate interrupt\n"); goto fail; diff --git a/sys/dev/si/si_pci.c b/sys/dev/si/si_pci.c index 397b2f0..c72b94d 100644 --- a/sys/dev/si/si_pci.c +++ b/sys/dev/si/si_pci.c @@ -77,9 +77,9 @@ si_pci_attach(device_t dev) break; } - sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, + RF_ACTIVE); if (!sc->sc_mem_res) { device_printf(dev, "couldn't map memory\n"); goto fail; @@ -88,8 +88,9 @@ si_pci_attach(device_t dev) sc->sc_maddr = rman_get_virtual(sc->sc_mem_res); sc->sc_irq_rid = 0; - sc->sc_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irq_rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, + RF_ACTIVE | RF_SHAREABLE); if (!sc->sc_irq_res) { device_printf(dev, "couldn't map interrupt\n"); goto fail; diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 93ed290..8f156bc 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -270,6 +270,7 @@ struct com_s { u_long error_counts[CE_NTYPES]; u_long rclk; + int gdb; struct resource *irqres; struct resource *ioportres; @@ -1158,8 +1159,7 @@ determined_type: ; pps_init(&com->pps); rid = 0; - com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, - RF_ACTIVE); + com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (com->irqres) { ret = BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, INTR_TYPE_TTY | INTR_FAST, @@ -1174,12 +1174,12 @@ determined_type: ; if (ret) device_printf(dev, "could not activate interrupt\n"); #if defined(DDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) + defined(ALT_BREAK_TO_DEBUGGER) || defined(GDB_AUTO_ENTER)) /* * Enable interrupts for early break-to-debugger support - * on the console. + * on the console and/or gdb port. */ - if (ret == 0 && unit == comconsole) + if (ret == 0 && (unit == comconsole || unit == siogdbunit)) outb(siocniobase + com_ier, IER_ERXRDY | IER_ERLS | IER_EMSC); #endif @@ -1426,13 +1426,13 @@ comhardclose(com) tp = com->tp; #if defined(DDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) + defined(ALT_BREAK_TO_DEBUGGER) || defined(GDB_AUTO_ENTER)) /* * Leave interrupts enabled and don't clear DTR if this is the * console. This allows us to detect break-to-debugger events * while the console device is closed. */ - if (com->unit != comconsole) + if (com->unit != comconsole || com->unit != siogdbunit) #endif { sio_setreg(com, com_ier, 0); @@ -1807,6 +1807,17 @@ siointr1(com) db_alt_break(recv_data, &com->alt_brk_state) != 0) breakpoint(); #endif /* ALT_BREAK_TO_DEBUGGER */ +#ifdef GDB_AUTO_ENTER + if (gdb_auto_enter != 0 && com->unit == siogdbunit) { + printf("gdb: %c\n", recv_data); + if (db_gdb_packet(recv_data, &com->gdb) != 0) { + printf("going to gdb mode\n"); + boothowto |= RB_GDB; + breakpoint(); + /* goto cont; */ + } + } +#endif /* GDB_AUTO_ENTER */ #endif /* DDB */ if (line_status & (LSR_BI | LSR_FE | LSR_PE)) { /* diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index deb02c1..b4ce2d8 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1550,8 +1550,7 @@ skc_attach(dev) pci_enable_busmaster(dev); rid = SK_RID; - sc->sk_res = bus_alloc_resource(dev, SK_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sk_res = bus_alloc_resource_any(dev, SK_RES, &rid, RF_ACTIVE); if (sc->sk_res == NULL) { printf("sk%d: couldn't map ports/memory\n", unit); @@ -1564,7 +1563,7 @@ skc_attach(dev) /* Allocate interrupt */ rid = 0; - sc->sk_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->sk_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sk_irq == NULL) { diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 678a2e8..f65aada 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1243,8 +1243,8 @@ sn_activate(device_t dev) } sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (!sc->irq_res) { if (bootverbose) device_printf(dev, "Cannot allocate irq\n"); diff --git a/sys/dev/snc/if_snc.c b/sys/dev/snc/if_snc.c index ad504cd..69a6ca6 100644 --- a/sys/dev/snc/if_snc.c +++ b/sys/dev/snc/if_snc.c @@ -124,8 +124,7 @@ snc_alloc_irq(dev, rid, flags) struct snc_softc *sc = device_get_softc(dev); struct resource *res; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0ul, ~0ul, 1, (RF_ACTIVE | flags)); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | flags); if (res) { sc->irq = res; sc->irq_rid = rid; 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; diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c index 92889c2..f187703 100644 --- a/sys/dev/sr/if_sr.c +++ b/sys/dev/sr/if_sr.c @@ -518,8 +518,8 @@ sr_allocate_irq(device_t device, int rid, u_long size) struct sr_hardc *hc = device_get_softc(device); hc->rid_irq = rid; - hc->res_irq = bus_alloc_resource(device, SYS_RES_IRQ, - &hc->rid_irq, 0ul, ~0ul, 1, RF_SHAREABLE|RF_ACTIVE); + hc->res_irq = bus_alloc_resource_any(device, SYS_RES_IRQ, + &hc->rid_irq, RF_SHAREABLE|RF_ACTIVE); if (hc->res_irq == NULL) { goto errexit; } diff --git a/sys/dev/stg/tmc18c30_subr.c b/sys/dev/stg/tmc18c30_subr.c index 95035cf..7ffd4d3 100644 --- a/sys/dev/stg/tmc18c30_subr.c +++ b/sys/dev/stg/tmc18c30_subr.c @@ -71,15 +71,15 @@ stg_alloc_resource(device_t dev) u_long maddr, msize; int error; - sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, - 0, ~0, 1, RF_ACTIVE); + sc->port_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->port_rid, RF_ACTIVE); if (sc->port_res == NULL) { stg_release_resource(dev); return(ENOMEM); } - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (sc->irq_res == NULL) { stg_release_resource(dev); return(ENOMEM); @@ -94,8 +94,8 @@ stg_alloc_resource(device_t dev) return(0); } - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + RF_ACTIVE); if (sc->mem_res == NULL) { stg_release_resource(dev); return(ENOMEM); diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index 642ccc3..e66e5d5 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -8747,8 +8747,8 @@ sym_pci_attach(device_t dev) */ if ((command & PCIM_CMD_MEMEN) != 0) { int regs_id = SYM_PCI_MMIO; - np->mmio_res = bus_alloc_resource(dev, SYS_RES_MEMORY, ®s_id, - 0, ~0, 1, RF_ACTIVE); + np->mmio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + ®s_id, RF_ACTIVE); } if (!np->mmio_res) { device_printf(dev, "failed to allocate MMIO resources\n"); @@ -8764,8 +8764,8 @@ sym_pci_attach(device_t dev) * Allocate the IRQ. */ i = 0; - np->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &i, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + np->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, + RF_ACTIVE | RF_SHAREABLE); if (!np->irq_res) { device_printf(dev, "failed to allocate IRQ resource\n"); goto attach_failed; @@ -8778,8 +8778,8 @@ sym_pci_attach(device_t dev) */ if ((command & PCI_COMMAND_IO_ENABLE) != 0) { int regs_id = SYM_PCI_IO; - np->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, ®s_id, - 0, ~0, 1, RF_ACTIVE); + np->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + ®s_id, RF_ACTIVE); } if (!np->io_res) { device_printf(dev, "failed to allocate IO resources\n"); @@ -8800,8 +8800,8 @@ sym_pci_attach(device_t dev) int regs_id = SYM_PCI_RAM; if (np->features & FE_64BIT) regs_id = SYM_PCI_RAM64; - np->ram_res = bus_alloc_resource(dev, SYS_RES_MEMORY, ®s_id, - 0, ~0, 1, RF_ACTIVE); + np->ram_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + ®s_id, RF_ACTIVE); if (!np->ram_res) { device_printf(dev,"failed to allocate RAM resources\n"); goto attach_failed; diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index ac07d80..eff6382 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -189,8 +189,8 @@ tdfx_attach(device_t dev) { device_printf(dev, "Base0 @ 0x%x\n", tdfx_info->addr0); #endif /* Notify the VM that we will be mapping some memory later */ - tdfx_info->memrange = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, - RF_ACTIVE | RF_SHAREABLE); + tdfx_info->memrange = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE | RF_SHAREABLE); if(tdfx_info->memrange == NULL) { #ifdef DEBUG device_printf(dev, "Error mapping mem, won't be able to use mmap()\n"); @@ -213,8 +213,8 @@ tdfx_attach(device_t dev) { #ifdef DEBUG device_printf(dev, "Base1 @ 0x%x\n", tdfx_info->addr1); #endif - tdfx_info->memrange2 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + tdfx_info->memrange2 = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_SHAREABLE); if(tdfx_info->memrange2 == NULL) { #ifdef DEBUG device_printf(dev, "Mem1 couldn't be allocated, glide may not work."); @@ -228,8 +228,8 @@ tdfx_attach(device_t dev) { rid = PCIR_IOBASE0_2; tdfx_info->pio0 = pci_read_config(dev, 0x2c, 2); tdfx_info->pio0max = pci_read_config(dev, 0x30, 2) + tdfx_info->pio0; - tdfx_info->piorange = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + tdfx_info->piorange = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, &rid, RF_ACTIVE | RF_SHAREABLE); if(tdfx_info->piorange == NULL) { #ifdef DEBUG device_printf(dev, "Couldn't map PIO range."); diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 46f64ae..af14959 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -2065,8 +2065,8 @@ ti_attach(dev) pci_enable_busmaster(dev); rid = TI_PCI_LOMEM; - sc->ti_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE|PCI_RF_DENSE); + sc->ti_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE|PCI_RF_DENSE); if (sc->ti_res == NULL) { printf ("ti%d: couldn't map memory\n", unit); @@ -2081,7 +2081,7 @@ ti_attach(dev) /* Allocate interrupt */ rid = 0; - sc->ti_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ti_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ti_irq == NULL) { diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 99814ef..d130125 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -3397,8 +3397,8 @@ trm_init(u_int16_t unit, device_t dev) printf("trm%d: cannot allocate ACB !\n", unit); return (NULL); } - pACB->iores = bus_alloc_resource(dev, SYS_RES_IOPORT, - &rid, 0, ~0, 1, RF_ACTIVE); + pACB->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &rid, RF_ACTIVE); if (pACB->iores == NULL) { printf("trm_init: bus_alloc_resource failed!\n"); return (NULL); @@ -3577,8 +3577,8 @@ trm_attach(device_t dev) * Create device queue of SIM(s) * (MAX_START_JOB - 1) : max_sim_transactions */ - pACB->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, - ~0, 1, RF_SHAREABLE | RF_ACTIVE); + pACB->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (pACB->irq == NULL || bus_setup_intr(dev, pACB->irq, INTR_TYPE_CAM, trm_Interrupt, pACB, &pACB->ih)) { diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c index 1f13391..6b5cf4b 100644 --- a/sys/dev/twe/twe_freebsd.c +++ b/sys/dev/twe/twe_freebsd.c @@ -216,7 +216,8 @@ twe_attach(device_t dev) * Allocate the PCI register window. */ rid = TWE_IO_CONFIG_REG; - if ((sc->twe_io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE)) == NULL) { + if ((sc->twe_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE)) == NULL) { twe_printf(sc, "can't allocate register window\n"); twe_free(sc); return(ENXIO); @@ -247,7 +248,8 @@ twe_attach(device_t dev) * Allocate and connect our interrupt. */ rid = 0; - if ((sc->twe_irq = bus_alloc_resource(sc->twe_dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + if ((sc->twe_irq = bus_alloc_resource_any(sc->twe_dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { twe_printf(sc, "can't allocate interrupt\n"); twe_free(sc); return(ENXIO); diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index b9933b2..944dcd3 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -253,8 +253,7 @@ epic_attach(dev) pci_enable_busmaster(dev); rid = EPIC_RID; - sc->res = bus_alloc_resource(dev, EPIC_RES, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->res = bus_alloc_resource_any(dev, EPIC_RES, &rid, RF_ACTIVE); if (sc->res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; @@ -266,7 +265,7 @@ epic_attach(dev) /* Allocate interrupt. */ rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index 23b91c0..90939a8 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -255,8 +255,8 @@ txp_attach(dev) pci_enable_busmaster(dev); rid = TXP_RID; - sc->sc_res = bus_alloc_resource(dev, TXP_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_res = bus_alloc_resource_any(dev, TXP_RES, &rid, + RF_ACTIVE); if (sc->sc_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); @@ -269,7 +269,7 @@ txp_attach(dev) /* Allocate interrupt */ rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sc_irq == NULL) { diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c index 18141c2..6b33b6f 100644 --- a/sys/dev/uart/uart_core.c +++ b/sys/dev/uart/uart_core.c @@ -329,8 +329,8 @@ uart_bus_attach(device_t dev) sc->sc_bas.bst = rman_get_bustag(sc->sc_rres); sc->sc_irid = 0; - sc->sc_ires = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, + RF_ACTIVE); if (sc->sc_ires != NULL) { error = BUS_SETUP_INTR(device_get_parent(dev), dev, sc->sc_ires, INTR_TYPE_TTY | INTR_FAST, uart_intr, diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c index 3a8f40d..afc9581 100644 --- a/sys/dev/ubsec/ubsec.c +++ b/sys/dev/ubsec/ubsec.c @@ -321,8 +321,8 @@ ubsec_attach(device_t dev) * Setup memory-mapping of PCI registers. */ rid = BS_BAR; - sc->sc_sr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_sr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->sc_sr == NULL) { device_printf(dev, "cannot map register space\n"); goto bad; @@ -334,8 +334,8 @@ ubsec_attach(device_t dev) * Arrange interrupt line. */ rid = 0; - sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE|RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE|RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "could not map interrupt\n"); goto bad1; diff --git a/sys/dev/usb/ehci_pci.c b/sys/dev/usb/ehci_pci.c index 37142c9..1bfa013 100644 --- a/sys/dev/usb/ehci_pci.c +++ b/sys/dev/usb/ehci_pci.c @@ -163,8 +163,8 @@ ehci_pci_attach(device_t self) pci_enable_busmaster(self); rid = PCI_CBMEM; - sc->io_res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->io_res) { device_printf(self, "Could not map memory\n"); return ENXIO; @@ -173,7 +173,7 @@ ehci_pci_attach(device_t self) sc->ioh = rman_get_bushandle(sc->io_res); rid = 0; - sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { device_printf(self, "Could not allocate irq\n"); diff --git a/sys/dev/usb/ohci_pci.c b/sys/dev/usb/ohci_pci.c index 558c440..0aa9f5d 100644 --- a/sys/dev/usb/ohci_pci.c +++ b/sys/dev/usb/ohci_pci.c @@ -221,8 +221,8 @@ ohci_pci_attach(device_t self) pci_enable_busmaster(self); rid = PCI_CBMEM; - sc->io_res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->io_res) { device_printf(self, "Could not map memory\n"); return ENXIO; @@ -231,7 +231,7 @@ ohci_pci_attach(device_t self) sc->ioh = rman_get_bushandle(sc->io_res); rid = 0; - sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { device_printf(self, "Could not allocate irq\n"); diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index b263201..f2946ab 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/uhci_pci.c @@ -251,8 +251,8 @@ uhci_pci_attach(device_t self) pci_enable_busmaster(self); rid = PCI_UHCI_BASE_REG; - sc->io_res = bus_alloc_resource(self, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->io_res = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (!sc->io_res) { device_printf(self, "Could not map ports\n"); return ENXIO; @@ -264,8 +264,7 @@ uhci_pci_attach(device_t self) bus_space_write_2(sc->iot, sc->ioh, UHCI_INTR, 0); rid = 0; - sc->irq_res = bus_alloc_resource(self, SYS_RES_IRQ, &rid, - 0, ~0, 1, + sc->irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->irq_res == NULL) { device_printf(self, "Could not allocate irq\n"); diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 72d1b1b..a91a5a7 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -773,8 +773,7 @@ vr_attach(dev) sc->vr_revid = pci_read_config(dev, VR_PCI_REVID, 4) & 0x000000FF; rid = VR_RID; - sc->vr_res = bus_alloc_resource(dev, VR_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vr_res = bus_alloc_resource_any(dev, VR_RES, &rid, RF_ACTIVE); if (sc->vr_res == NULL) { printf("vr%d: couldn't map ports/memory\n", unit); @@ -787,7 +786,7 @@ vr_attach(dev) /* Allocate interrupt */ rid = 0; - sc->vr_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->vr_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->vr_irq == NULL) { diff --git a/sys/dev/vx/if_vx_eisa.c b/sys/dev/vx/if_vx_eisa.c index 4c8931d..faf3f9d 100644 --- a/sys/dev/vx/if_vx_eisa.c +++ b/sys/dev/vx/if_vx_eisa.c @@ -122,16 +122,14 @@ vx_eisa_attach(device_t dev) * driver comes first. */ 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); if (!io) { device_printf(dev, "No I/O space?!\n"); goto bad; } rid = 1; - eisa_io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + eisa_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (!eisa_io) { device_printf(dev, "No I/O space?!\n"); goto bad; @@ -144,8 +142,7 @@ vx_eisa_attach(device_t dev) sc->bsh = rman_get_bushandle(io); rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (!irq) { device_printf(dev, "No irq?!\n"); goto bad; diff --git a/sys/dev/vx/if_vx_pci.c b/sys/dev/vx/if_vx_pci.c index ff4f1fb..42b9572 100644 --- a/sys/dev/vx/if_vx_pci.c +++ b/sys/dev/vx/if_vx_pci.c @@ -131,8 +131,7 @@ vx_pci_attach( sc = device_get_softc(dev); rid = PCIR_BAR(0); - sc->vx_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vx_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sc->vx_res == NULL) goto bad; @@ -141,7 +140,7 @@ vx_pci_attach( sc->bsh = rman_get_bushandle(sc->vx_res); rid = 0; - sc->vx_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->vx_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->vx_irq == NULL) diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 6792136..d8a83a2 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -2841,8 +2841,8 @@ wi_alloc(device_t dev, int rid) sc->wi_bhandle = rman_get_bushandle(sc->iobase); } else { sc->mem_rid = rid; - sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mem_rid, 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mem_rid, RF_ACTIVE); if (!sc->mem) { device_printf(dev, "No Mem space on prism2.5?\n"); @@ -2855,8 +2855,8 @@ wi_alloc(device_t dev, int rid) sc->irq_rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE | + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE | ((sc->wi_bus_type == WI_BUS_PCCARD) ? 0 : RF_SHAREABLE)); if (!sc->irq) { diff --git a/sys/dev/wi/if_wi_pci.c b/sys/dev/wi/if_wi_pci.c index 6639fc1..89c9d97 100644 --- a/sys/dev/wi/if_wi_pci.c +++ b/sys/dev/wi/if_wi_pci.c @@ -166,8 +166,8 @@ wi_pci_attach(device_t dev) /* We have to do a magic PLX poke to enable interrupts */ sc->local_rid = WI_PCI_LOCALRES; - sc->local = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->local_rid, 0, ~0, 1, RF_ACTIVE); + sc->local = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->local_rid, RF_ACTIVE); sc->wi_localtag = rman_get_bustag(sc->local); sc->wi_localhandle = rman_get_bushandle(sc->local); command = bus_space_read_4(sc->wi_localtag, sc->wi_localhandle, @@ -180,8 +180,8 @@ wi_pci_attach(device_t dev) sc->local = NULL; sc->mem_rid = WI_PCI_MEMRES; - sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, - 0, ~0, 1, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mem_rid, RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "couldn't allocate memory\n"); wi_free(dev); diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index c9ec34a..47ee647 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -622,8 +622,8 @@ wl_allocate_resources(device_t device) if (sc->res_ioport == NULL) goto errexit; - sc->res_irq = bus_alloc_resource(device, SYS_RES_IRQ, - &sc->rid_irq, 0ul, ~0ul, 1, RF_SHAREABLE|RF_ACTIVE); + sc->res_irq = bus_alloc_resource_any(device, SYS_RES_IRQ, + &sc->rid_irq, RF_SHAREABLE|RF_ACTIVE); if (sc->res_irq == NULL) goto errexit; return (0); diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index fe8e579..dfb35ee 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -1957,8 +1957,8 @@ xe_activate(device_t dev) } sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (!sc->irq_res) { DEVPRINTF(1, (dev, "Cannot allocate irq\n")); xe_deactivate(dev); diff --git a/sys/dev/zs/zs_macio.c b/sys/dev/zs/zs_macio.c index 264563f..7d4e179 100644 --- a/sys/dev/zs/zs_macio.c +++ b/sys/dev/zs/zs_macio.c @@ -146,15 +146,15 @@ zs_macio_attach(device_t dev) sc = device_get_softc(dev); reg = macio_get_regs(dev); - sc->sc_memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_memrid, - 0, ~1, 1, RF_ACTIVE); + sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_memrid, RF_ACTIVE); if (sc->sc_memres == NULL) { device_printf(dev, "could not allocate memory\n"); goto error; } sc->sc_irqrid1 = 0; - sc->sc_irqres1 = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irqrid1, - 0, ~0, 1, RF_ACTIVE); + sc->sc_irqres1 = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irqrid1, RF_ACTIVE); if (sc->sc_irqres1 == NULL) { device_printf(dev, "could not allocate interrupt 1\n"); goto error; @@ -165,8 +165,8 @@ zs_macio_attach(device_t dev) goto error; } sc->sc_irqrid2 = 1; - sc->sc_irqres2 = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irqrid2, - 0, ~0, 1, RF_ACTIVE); + sc->sc_irqres2 = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irqrid2, RF_ACTIVE); if (sc->sc_irqres2 == NULL) { device_printf(dev, "could not allocate interrupt 2\n"); goto error; diff --git a/sys/dev/zs/zs_sbus.c b/sys/dev/zs/zs_sbus.c index b98a1f6..f55ccc0 100644 --- a/sys/dev/zs/zs_sbus.c +++ b/sys/dev/zs/zs_sbus.c @@ -193,13 +193,13 @@ zs_fhc_attach(device_t dev) struct zs_sbus_softc *sc; sc = device_get_softc(dev); - sc->sc_memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_memrid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_memrid, RF_ACTIVE); if (sc->sc_memres == NULL) goto error; sc->sc_irqrid = FHC_UART; - sc->sc_irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irqrid, 0, - ~0, 1, RF_ACTIVE); + sc->sc_irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irqrid, RF_ACTIVE); if (sc->sc_irqres == NULL) goto error; if (bus_setup_intr(dev, sc->sc_irqres, INTR_TYPE_TTY | INTR_FAST, @@ -220,12 +220,12 @@ zs_sbus_attach(device_t dev) struct zs_sbus_softc *sc; sc = device_get_softc(dev); - sc->sc_memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_memrid, - 0, ~0, 1, RF_ACTIVE); + sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_memrid, RF_ACTIVE); if (sc->sc_memres == NULL) goto error; - sc->sc_irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irqrid, 0, - ~0, 1, RF_ACTIVE); + sc->sc_irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irqrid, RF_ACTIVE); if (sc->sc_irqres == NULL) goto error; if (bus_setup_intr(dev, sc->sc_irqres, INTR_TYPE_TTY | INTR_FAST, diff --git a/sys/i386/bios/smapi.c b/sys/i386/bios/smapi.c index 3e9aab8..c4897d1 100644 --- a/sys/i386/bios/smapi.c +++ b/sys/i386/bios/smapi.c @@ -183,8 +183,7 @@ smapi_probe (device_t dev) error = 0; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENOMEM; @@ -214,8 +213,8 @@ smapi_attach (device_t dev) sc->dev = dev; sc->rid = 0; - sc->res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); if (sc->res == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENOMEM; diff --git a/sys/i386/bios/smbios.c b/sys/i386/bios/smbios.c index 9bf433e..cef10f3 100644 --- a/sys/i386/bios/smbios.c +++ b/sys/i386/bios/smbios.c @@ -130,8 +130,7 @@ smbios_probe (device_t dev) error = 0; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENOMEM; @@ -161,8 +160,8 @@ smbios_attach (device_t dev) sc->dev = dev; sc->rid = 0; - sc->res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); if (sc->res == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENOMEM; diff --git a/sys/i386/bios/vpd.c b/sys/i386/bios/vpd.c index 74395c2..b78a303 100644 --- a/sys/i386/bios/vpd.c +++ b/sys/i386/bios/vpd.c @@ -145,8 +145,7 @@ vpd_probe (device_t dev) error = 0; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0ul, ~0ul, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENOMEM; @@ -177,8 +176,8 @@ vpd_attach (device_t dev) sc->dev = dev; sc->rid = 0; - sc->res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->rid, - 0ul, ~0ul, 1, RF_ACTIVE); + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); if (sc->res == NULL) { device_printf(dev, "Unable to allocate memory resource.\n"); error = ENOMEM; diff --git a/sys/i386/isa/atpic.c b/sys/i386/isa/atpic.c index 6341286..87b91d8 100644 --- a/sys/i386/isa/atpic.c +++ b/sys/i386/isa/atpic.c @@ -414,7 +414,7 @@ atpic_attach(device_t dev) /* Try to allocate our IRQ and then free it. */ rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, 0); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); if (res != NULL) bus_release_resource(dev, SYS_RES_IRQ, rid, res); return (0); diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c index 7486374..65ab1c6 100644 --- a/sys/i386/isa/if_el.c +++ b/sys/i386/isa/if_el.c @@ -241,7 +241,7 @@ el_attach(device_t dev) return(ENXIO); rid = 0; - sc->el_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->el_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->el_irq == NULL) { diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c index 8cd40f1..3f4acc5 100644 --- a/sys/i386/isa/mse.c +++ b/sys/i386/isa/mse.c @@ -331,8 +331,7 @@ mse_attach(dev) MSE_IOSIZE, RF_ACTIVE); if (sc->sc_port == NULL) return ENXIO; - sc->sc_intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_intr == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); return ENXIO; diff --git a/sys/i386/isa/spic.c b/sys/i386/isa/spic.c index a649f13..98fc8ab 100644 --- a/sys/i386/isa/spic.c +++ b/sys/i386/isa/spic.c @@ -240,8 +240,8 @@ spic_probe(device_t dev) sc->sc_port_addr = (u_short)rman_get_start(sc->sc_port_res); #ifdef notyet - if (!(sc->sc_intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_intr_rid, 0, ~0, 1, RF_ACTIVE))) { + if (!(sc->sc_intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_intr_rid, RF_ACTIVE))) { device_printf(dev,"Couldn't map IRQ\n"); bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_port_rid, sc->sc_port_res); diff --git a/sys/i4b/capi/iavc/iavc_isa.c b/sys/i4b/capi/iavc/iavc_isa.c index 050426d..3dbb8aa 100644 --- a/sys/i4b/capi/iavc/iavc_isa.c +++ b/sys/i4b/capi/iavc/iavc_isa.c @@ -193,9 +193,8 @@ iavc_isa_attach(device_t dev) sc->sc_resources.irq_rid = 0; if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, RF_ACTIVE))) { printf("iavc%d: can't allocate irq\n",unit); bus_release_resource(dev, SYS_RES_IOPORT, diff --git a/sys/i4b/capi/iavc/iavc_pci.c b/sys/i4b/capi/iavc/iavc_pci.c index f3c75c8..0183ea1 100644 --- a/sys/i4b/capi/iavc/iavc_pci.c +++ b/sys/i4b/capi/iavc/iavc_pci.c @@ -143,9 +143,8 @@ iavc_pci_attach(device_t dev) sc->sc_resources.io_rid[0] = 0x14; if (!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0UL, ~0UL, 1, RF_ACTIVE))) { + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], RF_ACTIVE))) { printf("iavc%d: can't allocate io region\n", unit); return(ENXIO); } @@ -159,9 +158,8 @@ iavc_pci_attach(device_t dev) sc->sc_resources.mem_rid = 0x10; if (!(sc->sc_resources.mem = - bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->sc_resources.mem_rid, - 0UL, ~0UL, 1, RF_ACTIVE))) { + bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_resources.mem_rid, RF_ACTIVE))) { printf("iavc%d: can't allocate memory region\n", unit); return(ENXIO); } @@ -218,9 +216,8 @@ iavc_pci_attach(device_t dev) sc->sc_resources.irq_rid = 0x00; if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0UL, ~0UL, 1, RF_SHAREABLE|RF_ACTIVE))) { + bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_resources.irq_rid, + RF_SHAREABLE|RF_ACTIVE))) { printf("iavc%d: can't allocate irq\n",unit); return(ENXIO); } diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c index 6e4c354..202707d 100644 --- a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c +++ b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c @@ -515,9 +515,8 @@ avma1pp_attach_avma1pp(device_t dev) ifpi_scp[unit] = sc; sc->sc_resources.io_rid[0] = PCIR_BAR(1); - sc->sc_resources.io_base[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0, ~0, 1, RF_ACTIVE); + sc->sc_resources.io_base[0] = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], RF_ACTIVE); if (sc->sc_resources.io_base[0] == NULL) { printf("avma1pp%d: couldn't map IO port\n", unit); @@ -530,8 +529,8 @@ avma1pp_attach_avma1pp(device_t dev) /* Allocate interrupt */ sc->sc_resources.irq_rid = 0; - sc->sc_resources.irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->sc_resources.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sc_resources.irq == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]); diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c b/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c index 7284af0..3f83859 100644 --- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c +++ b/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c @@ -469,9 +469,8 @@ avma1pp2_attach_avma1pp(device_t dev) ifpi2_scp[unit] = sc; sc->sc_resources.io_rid[0] = PCIR_BAR(1); - sc->sc_resources.io_base[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0, ~0, 1, RF_ACTIVE); + sc->sc_resources.io_base[0] = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], RF_ACTIVE); if (sc->sc_resources.io_base[0] == NULL) { printf("ifpi2-%d: couldn't map IO port\n", unit); @@ -484,8 +483,8 @@ avma1pp2_attach_avma1pp(device_t dev) /* Allocate interrupt */ sc->sc_resources.irq_rid = 0; - sc->sc_resources.irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->sc_resources.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sc_resources.irq == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]); diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c b/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c index c1e7ce7..e267957 100644 --- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c +++ b/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c @@ -481,9 +481,9 @@ avm_pnp_attach(device_t dev) /* get io_base */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0UL, ~0UL, 1, RF_ACTIVE ) )) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE ) )) { printf("avm_pnp_attach: Couldn't get my io_base.\n"); return ENXIO; @@ -503,9 +503,9 @@ avm_pnp_attach(device_t dev) /* get irq, release io_base if we don't get it */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("avm_pnp%d: Could not get irq.\n",unit); error = ENXIO; diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c b/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c index 1493e85..db6a6d8 100644 --- a/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c +++ b/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c @@ -174,9 +174,9 @@ ihfc_pnp_probe(device_t dev) 0UL, ~0UL, 2, RF_ACTIVE ); - S_IRQ = bus_alloc_resource( + S_IRQ = bus_alloc_resource_any( dev, SYS_RES_IRQ, &S_IRQRID, - 0UL, ~0UL, 1, RF_ACTIVE + RF_ACTIVE ); S_DLP = IHFC_DLP; /* set D-priority */ diff --git a/sys/i4b/layer1/isic/i4b_avm_a1.c b/sys/i4b/layer1/isic/i4b_avm_a1.c index 0c8c831..d786c1c 100644 --- a/sys/i4b/layer1/isic/i4b_avm_a1.c +++ b/sys/i4b/layer1/isic/i4b_avm_a1.c @@ -142,9 +142,9 @@ isic_alloc_port(device_t dev, int rid, u_int base, u_int len) bus_set_resource(dev, SYS_RES_IOPORT, rid, base, len); if(!(sc->sc_resources.io_base[rid] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[rid], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[rid], + RF_ACTIVE))) { printf("isic%d: Error, failed to reserve io #%d!\n", unit, rid); isic_detach_common(dev); @@ -182,9 +182,9 @@ isic_probe_avma1(device_t dev) /* see if an io base was supplied */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("isic%d: Could not get iobase for AVM A1/Fritz!\n", unit); @@ -239,9 +239,8 @@ isic_probe_avma1(device_t dev) /* get our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, RF_ACTIVE))) { printf("isic%d: Could not get an irq for AVM A1/Fritz!\n",unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_ctx_s0P.c b/sys/i4b/layer1/isic/i4b_ctx_s0P.c index 7fd0f87..b256d78 100644 --- a/sys/i4b/layer1/isic/i4b_ctx_s0P.c +++ b/sys/i4b/layer1/isic/i4b_ctx_s0P.c @@ -122,9 +122,9 @@ isic_attach_Cs0P(device_t dev) sc->sc_resources.io_rid[1] = 1; if(!(sc->sc_resources.io_base[1] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[1], - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[1], + RF_ACTIVE))) { printf("isic%d: Could not get io area 1 for Creatix / Teles PnP!\n", unit); isic_detach_common(dev); @@ -141,9 +141,9 @@ isic_attach_Cs0P(device_t dev) sc->sc_resources.io_rid[2] = 2; if(!(sc->sc_resources.io_base[2] = - bus_alloc_resource(dev, SYS_RES_IOPORT, + bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->sc_resources.io_rid[2], - 0UL, ~0UL, 1, RF_ACTIVE))) + RF_ACTIVE))) { printf("isic%d: Could not get cfg io area for Compaq Microcom 610\n", unit); isic_detach_common(dev); @@ -187,9 +187,9 @@ isic_attach_Cs0P(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, 2, iobase1-0x20, 0x40); if(!(sc->sc_resources.io_base[2] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[2], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[2], + RF_ACTIVE))) { printf("isic%d: Could not get io area 2 for Creatix / Teles PnP!\n", unit); isic_detach_common(dev); @@ -215,9 +215,9 @@ isic_attach_Cs0P(device_t dev) #endif if(!(sc->sc_resources.io_base[3] = - bus_alloc_resource(dev,SYS_RES_IOPORT, - &sc->sc_resources.io_rid[3], - 0ul,~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev,SYS_RES_IOPORT, + &sc->sc_resources.io_rid[3], + RF_ACTIVE))) { printf("isic%d: Could not get io area 3 for Creatix / Teles PnP!\n", unit); isic_detach_common(dev); @@ -231,9 +231,9 @@ isic_attach_Cs0P(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, 4, iobase2, 0x40); if(!(sc->sc_resources.io_base[4] = - bus_alloc_resource(dev,SYS_RES_IOPORT, - &sc->sc_resources.io_rid[4], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev,SYS_RES_IOPORT, + &sc->sc_resources.io_rid[4], + RF_ACTIVE))) { printf("isic%d: Could not get io area 4 for Creatix / Teles PnP!\n", unit); isic_detach_common(dev); @@ -252,9 +252,9 @@ isic_attach_Cs0P(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, 5, iocfg, 0x01); if(!(sc->sc_resources.io_base[5] = - bus_alloc_resource(dev,SYS_RES_IOPORT, - &sc->sc_resources.io_rid[5], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev,SYS_RES_IOPORT, + &sc->sc_resources.io_rid[5], + RF_ACTIVE))) { printf("isic%d: Could not get cfg io area for Compaq Microcom 610!\n", unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_drn_ngo.c b/sys/i4b/layer1/isic/i4b_drn_ngo.c index 74f7d3e..51a0170 100644 --- a/sys/i4b/layer1/isic/i4b_drn_ngo.c +++ b/sys/i4b/layer1/isic/i4b_drn_ngo.c @@ -224,9 +224,9 @@ isic_attach_drnngo(device_t dev) */ if(!(sc->sc_resources.io_base[1] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[1], - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[1], + RF_ACTIVE))) { printf("isic%d: Failed to get second io base.\n", unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_elsa_pcc16.c b/sys/i4b/layer1/isic/i4b_elsa_pcc16.c index d288414..81b09bf 100644 --- a/sys/i4b/layer1/isic/i4b_elsa_pcc16.c +++ b/sys/i4b/layer1/isic/i4b_elsa_pcc16.c @@ -237,9 +237,9 @@ isic_probe_Epcc16(device_t dev) /* see if an io base was supplied */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("isic%d: Could not get iobase for ELSA PCC-16.\n", unit); @@ -321,9 +321,9 @@ isic_probe_Epcc16(device_t dev) /* get our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("isic%d: Could not get an irq.\n",unit); isic_detach_Epcc16(dev); diff --git a/sys/i4b/layer1/isic/i4b_elsa_qs1p.c b/sys/i4b/layer1/isic/i4b_elsa_qs1p.c index d55ac83..68f3aa5 100644 --- a/sys/i4b/layer1/isic/i4b_elsa_qs1p.c +++ b/sys/i4b/layer1/isic/i4b_elsa_qs1p.c @@ -260,9 +260,9 @@ eqs1p_pci_attach(device_t dev) sc->sc_resources.io_rid[0] = ELSA_PORT0_MAPOFF; if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("isic%d: Couldn't get first iobase for ELSA MicroLink ISDN/PCI!\n", unit); return(ENXIO); @@ -271,9 +271,9 @@ eqs1p_pci_attach(device_t dev) sc->sc_resources.io_rid[1] = ELSA_PORT1_MAPOFF; if(!(sc->sc_resources.io_base[1] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[1], - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[1], + RF_ACTIVE))) { printf("isic%d: Couldn't get second iobase for ELSA MicroLink ISDN/PCI!\n", unit); isic_detach_common(dev); @@ -283,9 +283,9 @@ eqs1p_pci_attach(device_t dev) sc->sc_port = rman_get_start(sc->sc_resources.io_base[1]); if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0UL, ~0UL, 1, RF_ACTIVE | RF_SHAREABLE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE | RF_SHAREABLE))) { printf("isic%d: Could not get irq for ELSA MicroLink ISDN/PCI!\n",unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_isic_pnp.c b/sys/i4b/layer1/isic/i4b_isic_pnp.c index af0801d..336eac5a 100644 --- a/sys/i4b/layer1/isic/i4b_isic_pnp.c +++ b/sys/i4b/layer1/isic/i4b_isic_pnp.c @@ -188,9 +188,9 @@ isic_pnp_attach(device_t dev) /* get io_base */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0UL, ~0UL, 1, RF_ACTIVE ) )) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE ) )) { printf("isic_pnp_attach: Couldn't get my io_base.\n"); return ENXIO; @@ -203,9 +203,9 @@ isic_pnp_attach(device_t dev) /* get irq, release io_base if we don't get it */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("isic%d: Could not get irq.\n",unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_itk_ix1.c b/sys/i4b/layer1/isic/i4b_itk_ix1.c index f0e49cb..c1abe70 100644 --- a/sys/i4b/layer1/isic/i4b_itk_ix1.c +++ b/sys/i4b/layer1/isic/i4b_itk_ix1.c @@ -208,9 +208,9 @@ isic_probe_itkix1(device_t dev) #endif if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, + bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + RF_ACTIVE))) { printf("isic%d: Could not allocate i/o port for ITK IX1.\n", unit); return ENXIO; @@ -230,9 +230,9 @@ isic_probe_itkix1(device_t dev) /* get our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, + bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + RF_ACTIVE))) { printf("isic%d: Could not allocate irq for ITK IX1.\n", unit); bus_release_resource(dev,SYS_RES_IOPORT, diff --git a/sys/i4b/layer1/isic/i4b_tel_s016.c b/sys/i4b/layer1/isic/i4b_tel_s016.c index 5bfb05a..cbce4c1 100644 --- a/sys/i4b/layer1/isic/i4b_tel_s016.c +++ b/sys/i4b/layer1/isic/i4b_tel_s016.c @@ -147,9 +147,9 @@ isic_probe_s016(device_t dev) /* see if an io base was supplied */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("isic%d: Could not allocate i/o port for Teles S0/16.\n", unit); return(ENXIO); @@ -290,9 +290,9 @@ isic_probe_s016(device_t dev) /* get our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("isic%d: Could not allocate irq for Teles S0/16.\n", unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_tel_s0163.c b/sys/i4b/layer1/isic/i4b_tel_s0163.c index 3ff6dba..7eca095 100644 --- a/sys/i4b/layer1/isic/i4b_tel_s0163.c +++ b/sys/i4b/layer1/isic/i4b_tel_s0163.c @@ -135,9 +135,9 @@ isic_probe_s0163(device_t dev) /* see if an io base was supplied */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("isic%d: Could not get iobase for Teles S0/16.3.\n", unit); @@ -182,9 +182,9 @@ isic_probe_s0163(device_t dev) sc->sc_resources.io_rid[0] = 0; bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port, 0x20); sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE); if(!sc->sc_resources.io_base[0]) { printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n", @@ -196,9 +196,9 @@ isic_probe_s0163(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, 1, sc->sc_port-ISAC_OFFS, 0x20); sc->sc_resources.io_base[1] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[1], - 0ul, ~0ul, 1, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[1], + RF_ACTIVE); if(!sc->sc_resources.io_base[1]) { printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n", @@ -211,9 +211,9 @@ isic_probe_s0163(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, 2, sc->sc_port-HSCXA_OFFS, 0x20); sc->sc_resources.io_base[2] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[2], - 0ul, ~0ul, 1, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[2], + RF_ACTIVE); if(!sc->sc_resources.io_base[2]) { printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n", @@ -226,9 +226,9 @@ isic_probe_s0163(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, 3, sc->sc_port-HSCXB_OFFS, 0x20); sc->sc_resources.io_base[3] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[3], - 0ul, ~0ul, 1, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[3], + RF_ACTIVE); if(!sc->sc_resources.io_base[3]) { printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n", @@ -307,9 +307,9 @@ isic_probe_s0163(device_t dev) /* get our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("isic%d: Could not get IRQ for Teles S0/16.3.\n",unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/isic/i4b_tel_s08.c b/sys/i4b/layer1/isic/i4b_tel_s08.c index 0de354d..13fa732 100644 --- a/sys/i4b/layer1/isic/i4b_tel_s08.c +++ b/sys/i4b/layer1/isic/i4b_tel_s08.c @@ -143,9 +143,9 @@ isic_probe_s08(device_t dev) /* see if an io base was supplied */ if((sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { /* the S0/8 is completely memory mapped ! */ @@ -217,9 +217,9 @@ isic_probe_s08(device_t dev) /* allocate our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("isic%d: Could not allocate irq for Teles S0/8!\n",unit); diff --git a/sys/i4b/layer1/isic/i4b_usr_sti.c b/sys/i4b/layer1/isic/i4b_usr_sti.c index f99f2b2..c860970 100644 --- a/sys/i4b/layer1/isic/i4b_usr_sti.c +++ b/sys/i4b/layer1/isic/i4b_usr_sti.c @@ -224,9 +224,9 @@ usrtai_alloc_port(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, num, base, 1); if(!(sc->sc_resources.io_base[num] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[num], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[num], + RF_ACTIVE))) { printf("isic%d: Error, failed to reserve io #%dport %#x!\n", unit, num, base); isic_detach_common(dev); @@ -244,9 +244,9 @@ usrtai_alloc_port(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8); if(!(sc->sc_resources.io_base[num] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[num], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[num], + RF_ACTIVE))) { printf("isic%d: Error, failed to reserve io #%d port %#x!\n", unit, num, base+i*1024); isic_detach_common(dev); @@ -265,9 +265,9 @@ usrtai_alloc_port(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8); if(!(sc->sc_resources.io_base[num] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[num], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[num], + RF_ACTIVE))) { printf("isic%d: Error, failed to reserve io #%d port %#x!\n", unit, num, base+i*1024); isic_detach_common(dev); @@ -286,9 +286,9 @@ usrtai_alloc_port(device_t dev) bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8); if(!(sc->sc_resources.io_base[num] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[num], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[num], + RF_ACTIVE))) { printf("isic%d: Error, failed to reserve io #%d port %#x!\n", unit, num, base+i*1024); isic_detach_common(dev); @@ -325,9 +325,9 @@ isic_probe_usrtai(device_t dev) /* see if an io base was supplied */ if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("isic%d: Could not get iobase for USR Sportster TA!\n", unit); @@ -385,9 +385,9 @@ isic_probe_usrtai(device_t dev) /* get our irq */ if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0ul, ~0ul, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_ACTIVE))) { printf("isic%d: Could not get an irq for USR Sportster TA!\n",unit); isic_detach_common(dev); diff --git a/sys/i4b/layer1/itjc/i4b_itjc_pci.c b/sys/i4b/layer1/itjc/i4b_itjc_pci.c index f319ea0..7233dac 100644 --- a/sys/i4b/layer1/itjc/i4b_itjc_pci.c +++ b/sys/i4b/layer1/itjc/i4b_itjc_pci.c @@ -1539,8 +1539,8 @@ itjc_attach(device_t dev) itjc_scp[unit] = sc; sc->sc_resources.io_rid[0] = PCIR_BAR(0); - sc->sc_resources.io_base[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], 0, ~0, 1, RF_ACTIVE); + sc->sc_resources.io_base[0] = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], RF_ACTIVE); if (sc->sc_resources.io_base[0] == NULL) { @@ -1556,8 +1556,8 @@ itjc_attach(device_t dev) /* Allocate interrupt. */ sc->sc_resources.irq_rid = 0; - sc->sc_resources.irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->sc_resources.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sc_resources.irq == NULL) { diff --git a/sys/i4b/layer1/iwic/i4b_iwic_pci.c b/sys/i4b/layer1/iwic/i4b_iwic_pci.c index c8bbbe0..d9d2bcd 100644 --- a/sys/i4b/layer1/iwic/i4b_iwic_pci.c +++ b/sys/i4b/layer1/iwic/i4b_iwic_pci.c @@ -200,9 +200,9 @@ iwic_pci_attach(device_t dev) sc->sc_resources.io_rid[0] = BADDR1; if(!(sc->sc_resources.io_base[0] = - bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->sc_resources.io_rid[0], - 0UL, ~0UL, 1, RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_resources.io_rid[0], + RF_ACTIVE))) { printf("iwic%d: Couldn't alloc io port!\n", unit); return(ENXIO); @@ -211,9 +211,9 @@ iwic_pci_attach(device_t dev) iobase = rman_get_start(sc->sc_resources.io_base[0]); if(!(sc->sc_resources.irq = - bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->sc_resources.irq_rid, - 0UL, ~0UL, 1, RF_SHAREABLE|RF_ACTIVE))) + bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_resources.irq_rid, + RF_SHAREABLE|RF_ACTIVE))) { printf("iwic%d: Couldn't alloc irq!\n",unit); return(ENXIO); diff --git a/sys/isa/atkbd_isa.c b/sys/isa/atkbd_isa.c index 6b99e91..715ab05 100644 --- a/sys/isa/atkbd_isa.c +++ b/sys/isa/atkbd_isa.c @@ -96,8 +96,8 @@ atkbdprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_KBD; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (res == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -134,8 +134,8 @@ atkbdattach(device_t dev) return error; /* declare our interrupt handler */ - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return ENXIO; error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, atkbd_isa_intr, diff --git a/sys/isa/atkbdc_isa.c b/sys/isa/atkbdc_isa.c index 2618adf..1750336 100644 --- a/sys/isa/atkbdc_isa.c +++ b/sys/isa/atkbdc_isa.c @@ -143,16 +143,14 @@ atkbdc_probe(device_t dev) return ENXIO; if (count > 1) /* adjust the count */ bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1); - port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port0 == NULL) return ENXIO; rid = 1; if (bus_get_resource(dev, SYS_RES_IOPORT, rid, NULL, NULL) != 0) bus_set_resource(dev, SYS_RES_IOPORT, 1, start + KBD_STATUS_PORT, 1); - port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port1 == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, port0); return ENXIO; @@ -193,13 +191,13 @@ atkbdc_attach(device_t dev) } rid = 0; - sc->port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (sc->port0 == NULL) return ENXIO; rid = 1; - sc->port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (sc->port1 == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0); return ENXIO; diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 265ae1b..2dc88b9 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -762,9 +762,8 @@ fdc_alloc_resources(struct fdc_data *fdc) /* * Now (finally!) allocate the control port. */ - fdc->res_ctl = bus_alloc_resource(dev, SYS_RES_IOPORT, - &fdc->rid_ctl, - 0ul, ~0ul, 1, RF_ACTIVE); + fdc->res_ctl = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &fdc->rid_ctl, RF_ACTIVE); if (fdc->res_ctl == 0) { device_printf(dev, "cannot reserve control I/O port range (control port)\n"); @@ -774,18 +773,17 @@ fdc_alloc_resources(struct fdc_data *fdc) fdc->ctlh = rman_get_bushandle(fdc->res_ctl); } - fdc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &fdc->rid_irq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &fdc->rid_irq, RF_ACTIVE); if (fdc->res_irq == 0) { device_printf(dev, "cannot reserve interrupt line\n"); return ENXIO; } if ((fdc->flags & FDC_NODMA) == 0) { - fdc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, - &fdc->rid_drq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &fdc->rid_drq, + RF_ACTIVE); if (fdc->res_drq == 0) { device_printf(dev, "cannot reserve DMA request line\n"); return ENXIO; diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c index 4f84093..1ce40b2 100644 --- a/sys/isa/isa_common.c +++ b/sys/isa/isa_common.c @@ -153,9 +153,9 @@ isa_find_memory(device_t child, start += align) { bus_set_resource(child, SYS_RES_MEMORY, i, start, size); - res[i] = bus_alloc_resource(child, - SYS_RES_MEMORY, &i, - 0, ~0, 1, 0 /* !RF_ACTIVE */); + res[i] = bus_alloc_resource_any(child, + SYS_RES_MEMORY, &i, + 0 /* !RF_ACTIVE */); if (res[i]) { result->ic_mem[i].ir_start = start; result->ic_mem[i].ir_end = start + size - 1; @@ -228,9 +228,9 @@ isa_find_port(device_t child, start += align) { bus_set_resource(child, SYS_RES_IOPORT, i, start, size); - res[i] = bus_alloc_resource(child, - SYS_RES_IOPORT, &i, - 0, ~0, 1, 0 /* !RF_ACTIVE */); + res[i] = bus_alloc_resource_any(child, + SYS_RES_IOPORT, &i, + 0 /* !RF_ACTIVE */); if (res[i]) { result->ic_port[i].ir_start = start; result->ic_port[i].ir_end = start + size - 1; @@ -320,9 +320,9 @@ isa_find_irq(device_t child, irq = find_next_bit(mask, irq)) { bus_set_resource(child, SYS_RES_IRQ, i, irq, 1); - res[i] = bus_alloc_resource(child, - SYS_RES_IRQ, &i, - 0, ~0, 1, 0 /* !RF_ACTIVE */ ); + res[i] = bus_alloc_resource_any(child, + SYS_RES_IRQ, &i, + 0 /* !RF_ACTIVE */ ); if (res[i]) { result->ic_irqmask[i] = (1 << irq); break; @@ -386,9 +386,9 @@ isa_find_drq(device_t child, drq = find_next_bit(mask, drq)) { bus_set_resource(child, SYS_RES_DRQ, i, drq, 1); - res[i] = bus_alloc_resource(child, - SYS_RES_DRQ, &i, - 0, ~0, 1, 0 /* !RF_ACTIVE */); + res[i] = bus_alloc_resource_any(child, + SYS_RES_DRQ, &i, + 0 /* !RF_ACTIVE */); if (res[i]) { result->ic_drqmask[i] = (1 << drq); break; diff --git a/sys/isa/orm.c b/sys/isa/orm.c index 18979a1..5865159 100644 --- a/sys/isa/orm.c +++ b/sys/isa/orm.c @@ -101,8 +101,8 @@ orm_identify(driver_t* driver, device_t parent) bus_set_resource(child, SYS_RES_MEMORY, sc->rnum, chunk, IOMEM_STEP); rid = sc->rnum; - res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul, - ~0ul, 1, RF_ACTIVE); + res = bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (res == NULL) { bus_delete_resource(child, SYS_RES_MEMORY, sc->rnum); chunk += IOMEM_STEP; @@ -133,8 +133,7 @@ orm_identify(driver_t* driver, device_t parent) bus_set_resource(child, SYS_RES_MEMORY, sc->rnum, chunk, rom_size); rid = sc->rnum; - res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul, - ~0ul, 1, 0); + res = bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid, 0); if (res == NULL) { bus_delete_resource(child, SYS_RES_MEMORY, sc->rnum); chunk += IOMEM_STEP; diff --git a/sys/isa/psm.c b/sys/isa/psm.c index dd2fd7e..a414ba6 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -943,8 +943,8 @@ psmprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -1254,8 +1254,8 @@ psmattach(device_t dev) /* Setup our interrupt handler */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->intr == NULL) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, psmintr, sc, &sc->ih); @@ -3058,8 +3058,8 @@ psmcpnp_probe(device_t dev) "assuming irq %ld\n", irq); bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1); } - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE); bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* keep quiet */ @@ -3087,8 +3087,7 @@ psmcpnp_attach(device_t dev) * (See psmidentify() above.) */ rid = 0; - bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE); + bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); } return 0; diff --git a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c index fe0a241..674b4a7 100644 --- a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c +++ b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c @@ -641,8 +641,8 @@ bt3c_pccard_attach(device_t dev) /* Allocate IRQ */ sc->irq_rid = 0; - sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, - 0, ~0, 1, RF_ACTIVE); + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); if (sc->irq == NULL) { device_printf(dev, "Could not allocate IRQ\n"); goto bad; diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index c3a4dde..72680f3 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -925,8 +925,8 @@ fdc_alloc_resources(struct fdc_data *fdc) #ifdef PC98 rid = 3; bus_set_resource(dev, SYS_RES_IOPORT, rid, IO_FDPORT, 1); - fdc->res_fdsio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - 1, RF_ACTIVE); + fdc->res_fdsio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (fdc->res_fdsio == 0) return ENXIO; fdc->sc_fdsiot = rman_get_bustag(fdc->res_fdsio); @@ -934,8 +934,8 @@ fdc_alloc_resources(struct fdc_data *fdc) rid = 4; bus_set_resource(dev, SYS_RES_IOPORT, rid, 0x4be, 1); - fdc->res_fdemsio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - 1, RF_ACTIVE); + fdc->res_fdemsio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (fdc->res_fdemsio == 0) return ENXIO; fdc->sc_fdemsiot = rman_get_bustag(fdc->res_fdemsio); @@ -980,9 +980,8 @@ fdc_alloc_resources(struct fdc_data *fdc) * Now (finally!) allocate the control port. */ fdc->rid_ctl = 1; - fdc->res_ctl = bus_alloc_resource(dev, SYS_RES_IOPORT, - &fdc->rid_ctl, - 0ul, ~0ul, 1, RF_ACTIVE); + fdc->res_ctl = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &fdc->rid_ctl, RF_ACTIVE); if (fdc->res_ctl == 0) { device_printf(dev, "cannot reserve control I/O port range (control port)\n"); @@ -993,18 +992,16 @@ fdc_alloc_resources(struct fdc_data *fdc) } #endif - fdc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &fdc->rid_irq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &fdc->rid_irq, RF_ACTIVE); if (fdc->res_irq == 0) { device_printf(dev, "cannot reserve interrupt line\n"); return ENXIO; } if ((fdc->flags & FDC_NODMA) == 0) { - fdc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, - &fdc->rid_drq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &fdc->rid_drq, RF_ACTIVE); if (fdc->res_drq == 0) { device_printf(dev, "cannot reserve DMA request line\n"); return ENXIO; diff --git a/sys/pc98/cbus/olpt.c b/sys/pc98/cbus/olpt.c index 0ebd84c..6fbdcdf 100644 --- a/sys/pc98/cbus/olpt.c +++ b/sys/pc98/cbus/olpt.c @@ -431,8 +431,8 @@ lpt_attach(device_t dev) sc->sc_irq = 0; if (isa_get_irq(dev) != -1) { rid = 0; - sc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (sc->res_irq == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->res_port); diff --git a/sys/pc98/cbus/pckbd.c b/sys/pc98/cbus/pckbd.c index c7c793a..2d1fc01 100644 --- a/sys/pc98/cbus/pckbd.c +++ b/sys/pc98/cbus/pckbd.c @@ -134,7 +134,7 @@ pckbdattach(device_t dev) device_get_flags(dev)); rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res == NULL) return ENXIO; BUS_SETUP_INTR(device_get_parent(dev), dev, res, INTR_TYPE_TTY, diff --git a/sys/pc98/cbus/ppc.c b/sys/pc98/cbus/ppc.c index af78af8..a2adc3f 100644 --- a/sys/pc98/cbus/ppc.c +++ b/sys/pc98/cbus/ppc.c @@ -1937,10 +1937,12 @@ ppc_probe(device_t dev) ppc->ppc_flags = device_get_flags(dev); if (!(ppc->ppc_flags & 0x20)) { - ppc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &ppc->rid_irq, - 0ul, ~0ul, 1, RF_SHAREABLE); - ppc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, &ppc->rid_drq, - 0ul, ~0ul, 1, RF_ACTIVE); + ppc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &ppc->rid_irq, + RF_SHAREABLE); + ppc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &ppc->rid_drq, + RF_ACTIVE); } if (ppc->res_irq) diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index 39269ea..a15e5d9 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -851,8 +851,8 @@ sioprobe(dev, xrid, rclk, noprobe) rid = xrid; #ifdef PC98 if (IS_8251(iod.if_type)) { - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); } else if (iod.if_type == COM_IF_MODEM_CARD || iod.if_type == COM_IF_RSA98III || isa_get_vendorid(dev)) { @@ -1442,8 +1442,8 @@ sioattach(dev, xrid, rclk) rid = xrid; #ifdef PC98 if (IS_8251(if_type)) { - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); } else if (if_type == COM_IF_MODEM_CARD || if_type == COM_IF_RSA98III || isa_get_vendorid(dev)) { @@ -1831,8 +1831,8 @@ determined_type: ; pps_init(&com->pps); rid = 0; - com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, - RF_ACTIVE); + com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (com->irqres) { ret = BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, INTR_TYPE_TTY | INTR_FAST, diff --git a/sys/pc98/pc98/canbus.c b/sys/pc98/pc98/canbus.c index 1a58a23..893ac29 100644 --- a/sys/pc98/pc98/canbus.c +++ b/sys/pc98/pc98/canbus.c @@ -393,10 +393,10 @@ alloc_ioresource(device_t dev) { struct canbus_softc *sc = device_get_softc(dev); - sc->index_res = bus_alloc_resource( - dev, SYS_RES_IOPORT, &sc->index_id, 0ul, ~0ul, 1, RF_ACTIVE); - sc->data_res = bus_alloc_resource( - dev, SYS_RES_IOPORT, &sc->data_id, 0ul, ~0ul, 1, RF_ACTIVE); + sc->index_res = bus_alloc_resource_any( + dev, SYS_RES_IOPORT, &sc->index_id, RF_ACTIVE); + sc->data_res = bus_alloc_resource_any( + dev, SYS_RES_IOPORT, &sc->data_id, RF_ACTIVE); if (sc->index_res == NULL || sc->data_res == NULL) { device_printf(dev, "could not map I/O\n"); return (ENXIO); diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index c3a4dde..72680f3 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -925,8 +925,8 @@ fdc_alloc_resources(struct fdc_data *fdc) #ifdef PC98 rid = 3; bus_set_resource(dev, SYS_RES_IOPORT, rid, IO_FDPORT, 1); - fdc->res_fdsio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - 1, RF_ACTIVE); + fdc->res_fdsio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (fdc->res_fdsio == 0) return ENXIO; fdc->sc_fdsiot = rman_get_bustag(fdc->res_fdsio); @@ -934,8 +934,8 @@ fdc_alloc_resources(struct fdc_data *fdc) rid = 4; bus_set_resource(dev, SYS_RES_IOPORT, rid, 0x4be, 1); - fdc->res_fdemsio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - 1, RF_ACTIVE); + fdc->res_fdemsio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (fdc->res_fdemsio == 0) return ENXIO; fdc->sc_fdemsiot = rman_get_bustag(fdc->res_fdemsio); @@ -980,9 +980,8 @@ fdc_alloc_resources(struct fdc_data *fdc) * Now (finally!) allocate the control port. */ fdc->rid_ctl = 1; - fdc->res_ctl = bus_alloc_resource(dev, SYS_RES_IOPORT, - &fdc->rid_ctl, - 0ul, ~0ul, 1, RF_ACTIVE); + fdc->res_ctl = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &fdc->rid_ctl, RF_ACTIVE); if (fdc->res_ctl == 0) { device_printf(dev, "cannot reserve control I/O port range (control port)\n"); @@ -993,18 +992,16 @@ fdc_alloc_resources(struct fdc_data *fdc) } #endif - fdc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &fdc->rid_irq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &fdc->rid_irq, RF_ACTIVE); if (fdc->res_irq == 0) { device_printf(dev, "cannot reserve interrupt line\n"); return ENXIO; } if ((fdc->flags & FDC_NODMA) == 0) { - fdc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, - &fdc->rid_drq, 0ul, ~0ul, 1, - RF_ACTIVE); + fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &fdc->rid_drq, RF_ACTIVE); if (fdc->res_drq == 0) { device_printf(dev, "cannot reserve DMA request line\n"); return ENXIO; diff --git a/sys/pc98/pc98/mse.c b/sys/pc98/pc98/mse.c index 4ddeb63..541d056 100644 --- a/sys/pc98/pc98/mse.c +++ b/sys/pc98/pc98/mse.c @@ -390,8 +390,8 @@ mse_attach(dev) return ENXIO; } #endif - sc->sc_intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE); + sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (sc->sc_intr == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); return ENXIO; diff --git a/sys/pc98/pc98/olpt.c b/sys/pc98/pc98/olpt.c index 0ebd84c..6fbdcdf 100644 --- a/sys/pc98/pc98/olpt.c +++ b/sys/pc98/pc98/olpt.c @@ -431,8 +431,8 @@ lpt_attach(device_t dev) sc->sc_irq = 0; if (isa_get_irq(dev) != -1) { rid = 0; - sc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (sc->res_irq == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->res_port); diff --git a/sys/pc98/pc98/pc98kbd.c b/sys/pc98/pc98/pc98kbd.c index c7c793a..2d1fc01 100644 --- a/sys/pc98/pc98/pc98kbd.c +++ b/sys/pc98/pc98/pc98kbd.c @@ -134,7 +134,7 @@ pckbdattach(device_t dev) device_get_flags(dev)); rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res == NULL) return ENXIO; BUS_SETUP_INTR(device_get_parent(dev), dev, res, INTR_TYPE_TTY, diff --git a/sys/pc98/pc98/ppc.c b/sys/pc98/pc98/ppc.c index af78af8..a2adc3f 100644 --- a/sys/pc98/pc98/ppc.c +++ b/sys/pc98/pc98/ppc.c @@ -1937,10 +1937,12 @@ ppc_probe(device_t dev) ppc->ppc_flags = device_get_flags(dev); if (!(ppc->ppc_flags & 0x20)) { - ppc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &ppc->rid_irq, - 0ul, ~0ul, 1, RF_SHAREABLE); - ppc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ, &ppc->rid_drq, - 0ul, ~0ul, 1, RF_ACTIVE); + ppc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &ppc->rid_irq, + RF_SHAREABLE); + ppc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, + &ppc->rid_drq, + RF_ACTIVE); } if (ppc->res_irq) diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index 39269ea..a15e5d9 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -851,8 +851,8 @@ sioprobe(dev, xrid, rclk, noprobe) rid = xrid; #ifdef PC98 if (IS_8251(iod.if_type)) { - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); } else if (iod.if_type == COM_IF_MODEM_CARD || iod.if_type == COM_IF_RSA98III || isa_get_vendorid(dev)) { @@ -1442,8 +1442,8 @@ sioattach(dev, xrid, rclk) rid = xrid; #ifdef PC98 if (IS_8251(if_type)) { - port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); } else if (if_type == COM_IF_MODEM_CARD || if_type == COM_IF_RSA98III || isa_get_vendorid(dev)) { @@ -1831,8 +1831,8 @@ determined_type: ; pps_init(&com->pps); rid = 0; - com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, - RF_ACTIVE); + com->irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); if (com->irqres) { ret = BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, INTR_TYPE_TTY | INTR_FAST, diff --git a/sys/pccard/mecia.c b/sys/pccard/mecia.c index f3c5b11..07e58ca 100644 --- a/sys/pccard/mecia.c +++ b/sys/pccard/mecia.c @@ -153,7 +153,7 @@ mecia_attach(device_t dev) validunits++; rid = 0; - r = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); + r = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (!r) return (ENXIO); diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c index c145f92..d6a52e2 100644 --- a/sys/pccard/pcic_pci.c +++ b/sys/pccard/pcic_pci.c @@ -1141,7 +1141,7 @@ pcic_pci_probe(device_t dev) pci_write_config(dev, PCIR_INTLINE, 255, 1); } #endif - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res) bus_release_resource(dev, SYS_RES_IRQ, rid, res); @@ -1249,8 +1249,8 @@ pcic_pci_attach(device_t dev) sockbase = pci_read_config(dev, 0x10, 4); if (sockbase & 0x1) { sc->iorid = CB_PCI_SOCKET_BASE; - sc->iores = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->iorid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); + sc->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->iorid, RF_ACTIVE | RF_SHAREABLE); if (sc->iores == NULL) return (ENOMEM); @@ -1281,8 +1281,8 @@ pcic_pci_attach(device_t dev) intr = pcic_isa_intr; } else { sc->memrid = CB_PCI_SOCKET_BASE; - sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->memrid, 0, ~0, 1, RF_ACTIVE); + sc->memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->memrid, RF_ACTIVE); if (sc->memres == NULL && pcic_pci_get_memory(dev) != 0) return (ENOMEM); sp->getb = pcic_pci_getb2; @@ -1317,7 +1317,7 @@ pcic_pci_attach(device_t dev) if (sc->csc_route == pcic_iw_pci) { rid = 0; - r = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + r = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (r == NULL) { sc->csc_route = pcic_iw_isa; diff --git a/sys/pci/agp.c b/sys/pci/agp.c index 6a01e20..fc4fd1f 100644 --- a/sys/pci/agp.c +++ b/sys/pci/agp.c @@ -230,8 +230,8 @@ agp_generic_attach(device_t dev) * Find and map the aperture. */ rid = AGP_APBASE; - sc->as_aperture = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->as_aperture) return ENOMEM; diff --git a/sys/pci/agp_amd.c b/sys/pci/agp_amd.c index 2b1bd12..37bd11d 100644 --- a/sys/pci/agp_amd.c +++ b/sys/pci/agp_amd.c @@ -229,8 +229,8 @@ agp_amd_attach(device_t dev) return error; rid = AGP_AMD751_REGISTERS; - sc->regs = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->regs) { agp_generic_detach(dev); return ENOMEM; diff --git a/sys/pci/agp_i810.c b/sys/pci/agp_i810.c index 9f39955..b79ce13 100644 --- a/sys/pci/agp_i810.c +++ b/sys/pci/agp_i810.c @@ -274,8 +274,8 @@ agp_i810_attach(device_t dev) /* Same for i810 and i830 */ rid = AGP_I810_MMADR; - sc->regs = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (!sc->regs) { agp_generic_detach(dev); return ENOMEM; diff --git a/sys/pci/alpm.c b/sys/pci/alpm.c index c3e04f6..7a062e3 100644 --- a/sys/pci/alpm.c +++ b/sys/pci/alpm.c @@ -227,8 +227,8 @@ alpm_attach(device_t dev) } rid = SMBBA; - alpm->res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + alpm->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); if (alpm->res == NULL) { device_printf(dev,"Could not allocate Bus space\n"); diff --git a/sys/pci/amdpm.c b/sys/pci/amdpm.c index c72ad70..afed542 100644 --- a/sys/pci/amdpm.c +++ b/sys/pci/amdpm.c @@ -198,7 +198,8 @@ amdpm_attach(device_t dev) amdpm_sc->rid = AMDPCI_PMBASE; else amdpm_sc->rid = NFPCI_PMBASE; - amdpm_sc->res = bus_alloc_resource(dev, SYS_RES_IOPORT, &amdpm_sc->rid, 0, ~0, 1, RF_ACTIVE); + amdpm_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &amdpm_sc->rid, RF_ACTIVE); if (amdpm_sc->res == NULL) { device_printf(dev, "could not map i/o space\n"); diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 84c3019..b614db9 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -1907,8 +1907,7 @@ dc_attach(device_t dev) pci_enable_busmaster(dev); rid = DC_RID; - sc->dc_res = bus_alloc_resource(dev, DC_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->dc_res = bus_alloc_resource_any(dev, DC_RES, &rid, RF_ACTIVE); if (sc->dc_res == NULL) { printf("dc%d: couldn't map ports/memory\n", unit); @@ -1921,7 +1920,7 @@ dc_attach(device_t dev) /* Allocate interrupt. */ rid = 0; - sc->dc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->dc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->dc_irq == NULL) { diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index c8a4da6..fb784dc 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -5151,12 +5151,10 @@ tulip_pci_attach(device_t dev) sc->tulip_if.if_softc = sc; #if defined(TULIP_IOMAPPED) rid = PCI_CBIO; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); #else rid = PCI_CBMA; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); #endif if (!res) return ENXIO; @@ -5219,8 +5217,8 @@ tulip_pci_attach(device_t dev) void *ih; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + 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)) { printf("%s: couldn't map interrupt\n", diff --git a/sys/pci/if_mn.c b/sys/pci/if_mn.c index a87e4bb..25530be 100644 --- a/sys/pci/if_mn.c +++ b/sys/pci/if_mn.c @@ -1350,8 +1350,7 @@ mn_attach (device_t self) sprintf(sc->name, "mn%d", sc->unit); rid = PCIR_BAR(0); - res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(self, "Could not map memory\n"); free(sc, M_MN); @@ -1361,8 +1360,7 @@ mn_attach (device_t self) sc->m0p = rman_get_start(res); rid = PCIR_BAR(1); - res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(self, "Could not map memory\n"); free(sc, M_MN); @@ -1373,8 +1371,8 @@ mn_attach (device_t self) /* Allocate interrupt */ rid = 0; - sc->irq = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0, - 1, RF_SHAREABLE | RF_ACTIVE); + sc->irq = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->irq == NULL) { printf("couldn't map interrupt\n"); diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index 95b6d93..34d4778 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -417,8 +417,8 @@ pcn_probe(dev) * so we can read the chip ID register. */ rid = PCN_RID; - sc->pcn_res = bus_alloc_resource(dev, PCN_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->pcn_res = bus_alloc_resource_any(dev, PCN_RES, &rid, + RF_ACTIVE); if (sc->pcn_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); @@ -547,8 +547,7 @@ pcn_attach(dev) pci_enable_busmaster(dev); rid = PCN_RID; - sc->pcn_res = bus_alloc_resource(dev, PCN_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->pcn_res = bus_alloc_resource_any(dev, PCN_RES, &rid, RF_ACTIVE); if (sc->pcn_res == NULL) { printf("pcn%d: couldn't map ports/memory\n", unit); @@ -561,7 +560,7 @@ pcn_attach(dev) /* Allocate interrupt */ rid = 0; - sc->pcn_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->pcn_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->pcn_irq == NULL) { diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index b5299f4..b70166a 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -857,8 +857,8 @@ rl_probe(dev) * so we can read the chip ID register. */ rid = RL_RID; - sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, + RF_ACTIVE); if (sc->rl_res == NULL) { device_printf(dev, "couldn't map ports/memory\n"); @@ -947,8 +947,7 @@ rl_attach(dev) pci_enable_busmaster(dev); rid = RL_RID; - sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid, RF_ACTIVE); if (sc->rl_res == NULL) { printf ("rl%d: couldn't map ports/memory\n", unit); @@ -974,7 +973,7 @@ rl_attach(dev) /* Allocate interrupt */ rid = 0; - sc->rl_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->rl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->rl_irq == NULL) { diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c index 980c577..92e7002 100644 --- a/sys/pci/if_sf.c +++ b/sys/pci/if_sf.c @@ -703,8 +703,7 @@ sf_attach(dev) pci_enable_busmaster(dev); rid = SF_RID; - sc->sf_res = bus_alloc_resource(dev, SF_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sf_res = bus_alloc_resource_any(dev, SF_RES, &rid, RF_ACTIVE); if (sc->sf_res == NULL) { printf ("sf%d: couldn't map ports\n", unit); @@ -717,7 +716,7 @@ sf_attach(dev) /* Allocate interrupt */ rid = 0; - sc->sf_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->sf_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sf_irq == NULL) { diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index bae9905..3ede4cc 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -1093,8 +1093,7 @@ sis_attach(dev) pci_enable_busmaster(dev); rid = SIS_RID; - sc->sis_res = bus_alloc_resource(dev, SIS_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sis_res = bus_alloc_resource_any(dev, SIS_RES, &rid, RF_ACTIVE); if (sc->sis_res == NULL) { printf("sis%d: couldn't map ports/memory\n", unit); @@ -1107,7 +1106,7 @@ sis_attach(dev) /* Allocate interrupt */ rid = 0; - sc->sis_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->sis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sis_irq == NULL) { diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c index deb02c1..b4ce2d8 100644 --- a/sys/pci/if_sk.c +++ b/sys/pci/if_sk.c @@ -1550,8 +1550,7 @@ skc_attach(dev) pci_enable_busmaster(dev); rid = SK_RID; - sc->sk_res = bus_alloc_resource(dev, SK_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->sk_res = bus_alloc_resource_any(dev, SK_RES, &rid, RF_ACTIVE); if (sc->sk_res == NULL) { printf("sk%d: couldn't map ports/memory\n", unit); @@ -1564,7 +1563,7 @@ skc_attach(dev) /* Allocate interrupt */ rid = 0; - sc->sk_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->sk_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sk_irq == NULL) { diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c index ebaa0bf..01134c8 100644 --- a/sys/pci/if_ste.c +++ b/sys/pci/if_ste.c @@ -963,8 +963,7 @@ ste_attach(dev) pci_enable_busmaster(dev); rid = STE_RID; - sc->ste_res = bus_alloc_resource(dev, STE_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->ste_res = bus_alloc_resource_any(dev, STE_RES, &rid, RF_ACTIVE); if (sc->ste_res == NULL) { printf ("ste%d: couldn't map ports/memory\n", unit); @@ -977,7 +976,7 @@ ste_attach(dev) /* Allocate interrupt */ rid = 0; - sc->ste_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ste_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ste_irq == NULL) { diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 46f64ae..af14959 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -2065,8 +2065,8 @@ ti_attach(dev) pci_enable_busmaster(dev); rid = TI_PCI_LOMEM; - sc->ti_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE|PCI_RF_DENSE); + sc->ti_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE|PCI_RF_DENSE); if (sc->ti_res == NULL) { printf ("ti%d: couldn't map memory\n", unit); @@ -2081,7 +2081,7 @@ ti_attach(dev) /* Allocate interrupt */ rid = 0; - sc->ti_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ti_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ti_irq == NULL) { diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c index 4188bef..5660bfd 100644 --- a/sys/pci/if_tl.c +++ b/sys/pci/if_tl.c @@ -1146,8 +1146,8 @@ tl_attach(dev) #ifdef TL_USEIOSPACE rid = TL_PCI_LOIO; - sc->tl_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->tl_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); /* * Some cards have the I/O and memory mapped address registers @@ -1155,17 +1155,17 @@ tl_attach(dev) */ if (sc->tl_res == NULL) { rid = TL_PCI_LOMEM; - sc->tl_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->tl_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); } #else rid = TL_PCI_LOMEM; - sc->tl_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->tl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->tl_res == NULL) { rid = TL_PCI_LOIO; - sc->tl_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->tl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); } #endif @@ -1192,7 +1192,7 @@ tl_attach(dev) /* Allocate interrupt */ rid = 0; - sc->tl_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->tl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->tl_irq == NULL) { diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c index 72d1b1b..a91a5a7 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -773,8 +773,7 @@ vr_attach(dev) sc->vr_revid = pci_read_config(dev, VR_PCI_REVID, 4) & 0x000000FF; rid = VR_RID; - sc->vr_res = bus_alloc_resource(dev, VR_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vr_res = bus_alloc_resource_any(dev, VR_RES, &rid, RF_ACTIVE); if (sc->vr_res == NULL) { printf("vr%d: couldn't map ports/memory\n", unit); @@ -787,7 +786,7 @@ vr_attach(dev) /* Allocate interrupt */ rid = 0; - sc->vr_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->vr_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->vr_irq == NULL) { diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index 372c205..1b738d7 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -858,8 +858,7 @@ wb_attach(dev) pci_enable_busmaster(dev); rid = WB_RID; - sc->wb_res = bus_alloc_resource(dev, WB_RES, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->wb_res = bus_alloc_resource_any(dev, WB_RES, &rid, RF_ACTIVE); if (sc->wb_res == NULL) { printf("wb%d: couldn't map ports/memory\n", unit); @@ -872,7 +871,7 @@ wb_attach(dev) /* Allocate interrupt */ rid = 0; - sc->wb_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->wb_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->wb_irq == NULL) { diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 939cd20..019f8e5 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -1418,8 +1418,7 @@ xl_attach(dev) rid = XL_PCI_LOMEM; res = SYS_RES_MEMORY; - sc->xl_res = bus_alloc_resource(dev, res, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->xl_res = bus_alloc_resource_any(dev, res, &rid, RF_ACTIVE); } if (sc->xl_res != NULL) { @@ -1429,8 +1428,7 @@ xl_attach(dev) } else { rid = XL_PCI_LOIO; res = SYS_RES_IOPORT; - sc->xl_res = bus_alloc_resource(dev, res, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->xl_res = bus_alloc_resource_any(dev, res, &rid, RF_ACTIVE); if (sc->xl_res == NULL) { printf ("xl%d: couldn't map ports/memory\n", unit); error = ENXIO; @@ -1445,8 +1443,8 @@ xl_attach(dev) if (sc->xl_flags & XL_FLAG_FUNCREG) { rid = XL_PCI_FUNCMEM; - sc->xl_fres = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->xl_fres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->xl_fres == NULL) { printf ("xl%d: couldn't map ports/memory\n", unit); @@ -1460,7 +1458,7 @@ xl_attach(dev) /* Allocate interrupt */ rid = 0; - sc->xl_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->xl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->xl_irq == NULL) { printf("xl%d: couldn't map interrupt\n", unit); diff --git a/sys/pci/intpm.c b/sys/pci/intpm.c index defc2c7..ef30a52 100644 --- a/sys/pci/intpm.c +++ b/sys/pci/intpm.c @@ -664,8 +664,7 @@ intpm_attach(device_t dev) } rid=PCI_BASE_ADDR_SMB; - res=bus_alloc_resource(dev,SYS_RES_IOPORT,&rid, - 0,~0,1,RF_ACTIVE); + res=bus_alloc_resource_any(dev,SYS_RES_IOPORT,&rid,RF_ACTIVE); if(res==NULL){ device_printf(dev,"Could not allocate Bus space\n"); return ENXIO; diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index 2a7cf3c..ab7892e 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -3383,8 +3383,8 @@ ncr_attach (device_t dev) */ np->reg_rid = 0x14; - np->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &np->reg_rid, - 0, ~0, 1, RF_ACTIVE); + np->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &np->reg_rid, RF_ACTIVE); if (!np->reg_res) { device_printf(dev, "could not map memory\n"); return ENXIO; @@ -3580,9 +3580,9 @@ ncr_attach (device_t dev) */ if ((np->features & FE_RAM) && sizeof(struct script) <= 4096) { np->sram_rid = 0x18; - np->sram_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &np->sram_rid, - 0, ~0, 1, RF_ACTIVE); + np->sram_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &np->sram_rid, + RF_ACTIVE); } /* @@ -3760,8 +3760,8 @@ ncr_attach (device_t dev) */ rid = 0; - np->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + np->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (np->irq_res == NULL) { device_printf(dev, "interruptless mode: reduced performance.\n"); diff --git a/sys/pci/viapm.c b/sys/pci/viapm.c index 0312997..8d37024 100644 --- a/sys/pci/viapm.c +++ b/sys/pci/viapm.c @@ -321,8 +321,8 @@ viapm_pro_attach(device_t dev) struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev); u_int32_t l; - if (!(viapm->iores = bus_alloc_resource(dev, SYS_RES_IOPORT, - &viapm->iorid, 0l, ~0l, 1, RF_ACTIVE))) { + if (!(viapm->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &viapm->iorid, RF_ACTIVE))) { device_printf(dev, "could not allocate bus space\n"); goto error; } @@ -389,8 +389,8 @@ viapm_586b_attach(device_t dev) { struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev); - if (!(viapm->iores = bus_alloc_resource(dev, SYS_RES_IOPORT, - &viapm->iorid, 0ul, ~0ul, 1, RF_ACTIVE | RF_SHAREABLE))) { + if (!(viapm->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &viapm->iorid, RF_ACTIVE | RF_SHAREABLE))) { device_printf(dev, "could not allocate bus resource\n"); return ENXIO; } diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c index 6c1d8fd..e17ee55 100644 --- a/sys/pci/xrpu.c +++ b/sys/pci/xrpu.c @@ -226,8 +226,7 @@ xrpu_attach(device_t self) sc = device_get_softc(self); sc->mode = NORMAL; rid = PCIR_BAR(0); - res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(self, "Could not map memory\n"); return ENXIO; diff --git a/sys/powerpc/powermac/hrowpic.c b/sys/powerpc/powermac/hrowpic.c index f98adfe..c08e042 100644 --- a/sys/powerpc/powermac/hrowpic.c +++ b/sys/powerpc/powermac/hrowpic.c @@ -460,7 +460,7 @@ hrowpic_macio_attach(device_t dev) sc->sc_maciodev = dev; rid = 0; - sc->sc_memr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, + sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_memr == NULL) { diff --git a/sys/powerpc/powermac/openpic_macio.c b/sys/powerpc/powermac/openpic_macio.c index 3115918..6ad4318 100644 --- a/sys/powerpc/powermac/openpic_macio.c +++ b/sys/powerpc/powermac/openpic_macio.c @@ -210,7 +210,7 @@ openpic_macio_attach(device_t dev) KASSERT(sc != NULL, ("pic not nexus-probed\n")); rid = 0; - sc->sc_memr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, + sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_memr == NULL) { diff --git a/sys/powerpc/psim/openpic_iobus.c b/sys/powerpc/psim/openpic_iobus.c index 5bbeb14..5fd524d 100644 --- a/sys/powerpc/psim/openpic_iobus.c +++ b/sys/powerpc/psim/openpic_iobus.c @@ -200,7 +200,7 @@ openpic_iobus_attach(device_t dev) KASSERT(sc != NULL, ("pic not nexus-probed\n")); rid = 0; - sc->sc_memr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, + sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_memr == NULL) { diff --git a/sys/sparc64/sparc64/eeprom_ebus.c b/sys/sparc64/sparc64/eeprom_ebus.c index 43e8db7..3f63baa 100644 --- a/sys/sparc64/sparc64/eeprom_ebus.c +++ b/sys/sparc64/sparc64/eeprom_ebus.c @@ -132,8 +132,7 @@ eeprom_ebus_attach(device_t dev) int rid, error; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0UL, ~0UL, 1, - RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); diff --git a/sys/sparc64/sparc64/eeprom_fhc.c b/sys/sparc64/sparc64/eeprom_fhc.c index d69f84d..b5b4b25 100644 --- a/sys/sparc64/sparc64/eeprom_fhc.c +++ b/sys/sparc64/sparc64/eeprom_fhc.c @@ -128,8 +128,7 @@ eeprom_fhc_attach(device_t dev) int rid, error; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0UL, ~0UL, 1, - RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); diff --git a/sys/sparc64/sparc64/eeprom_sbus.c b/sys/sparc64/sparc64/eeprom_sbus.c index ad2b8b2..499916f 100644 --- a/sys/sparc64/sparc64/eeprom_sbus.c +++ b/sys/sparc64/sparc64/eeprom_sbus.c @@ -128,8 +128,7 @@ eeprom_sbus_attach(device_t dev) int rid, error; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0UL, ~0UL, 1, - RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); |