Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
This commit is contained in:
parent
902aa2e784
commit
5f96beb9e0
@ -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);
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user