summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-03-17 17:50:55 +0000
committernjl <njl@FreeBSD.org>2004-03-17 17:50:55 +0000
commit05a1f56fc999f634406946e831eea6deaaa75a99 (patch)
treea1c3f00139d832c8e80338cfc56c8b1aaffd88ab /sys/pci
parent2283471bb53a546e9d7dfb662c8db5ca06907c85 (diff)
downloadFreeBSD-src-05a1f56fc999f634406946e831eea6deaaa75a99.zip
FreeBSD-src-05a1f56fc999f634406946e831eea6deaaa75a99.tar.gz
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/agp.c4
-rw-r--r--sys/pci/agp_amd.c4
-rw-r--r--sys/pci/agp_i810.c4
-rw-r--r--sys/pci/alpm.c4
-rw-r--r--sys/pci/amdpm.c3
-rw-r--r--sys/pci/if_dc.c5
-rw-r--r--sys/pci/if_de.c10
-rw-r--r--sys/pci/if_mn.c10
-rw-r--r--sys/pci/if_pcn.c9
-rw-r--r--sys/pci/if_rl.c9
-rw-r--r--sys/pci/if_sf.c5
-rw-r--r--sys/pci/if_sis.c5
-rw-r--r--sys/pci/if_sk.c5
-rw-r--r--sys/pci/if_ste.c5
-rw-r--r--sys/pci/if_ti.c6
-rw-r--r--sys/pci/if_tl.c18
-rw-r--r--sys/pci/if_vr.c5
-rw-r--r--sys/pci/if_wb.c5
-rw-r--r--sys/pci/if_xl.c12
-rw-r--r--sys/pci/intpm.c3
-rw-r--r--sys/pci/ncr.c14
-rw-r--r--sys/pci/viapm.c8
-rw-r--r--sys/pci/xrpu.c3
23 files changed, 70 insertions, 86 deletions
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;
OpenPOWER on IntegriCloud