Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162299373
D5306.id13380.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
16 KB
Referenced Files
None
Subscribers
None
D5306.id13380.diff
View Options
Index: sys/dev/arcmsr/arcmsr.c
===================================================================
--- sys/dev/arcmsr/arcmsr.c
+++ sys/dev/arcmsr/arcmsr.c
@@ -4323,7 +4323,7 @@
}
/* After setting up the adapter, map our interrupt */
rid = 0;
- irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE);
+ irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE);
if(irqres == NULL ||
#if __FreeBSD_version >= 700025
bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, NULL, arcmsr_intr_handler, acb, &acb->ih)) {
Index: sys/dev/ed/if_ed_pccard.c
===================================================================
--- sys/dev/ed/if_ed_pccard.c
+++ sys/dev/ed/if_ed_pccard.c
@@ -509,8 +509,8 @@
}
if (rman_get_size(sc->port_res) == ED_NOVELL_IO_PORTS / 2) {
port_rid++;
- sc->port_res2 = bus_alloc_resource(dev, SYS_RES_IOPORT,
- &port_rid, 0ul, ~0ul, 1, RF_ACTIVE);
+ sc->port_res2 = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+ &port_rid, RF_ACTIVE);
if (sc->port_res2 == NULL ||
rman_get_size(sc->port_res2) != ED_NOVELL_IO_PORTS / 2) {
error = ENXIO;
Index: sys/dev/fdc/fdc_pccard.c
===================================================================
--- sys/dev/fdc/fdc_pccard.c
+++ sys/dev/fdc/fdc_pccard.c
@@ -56,8 +56,7 @@
int rid, i;
rid = 0;
- res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, 1,
- RF_ACTIVE);
+ res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
if (res == NULL) {
device_printf(dev, "cannot alloc I/O port range\n");
return (ENXIO);
Index: sys/dev/hpt27xx/hpt27xx_osm_bsd.c
===================================================================
--- sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+++ sys/dev/hpt27xx/hpt27xx_osm_bsd.c
@@ -1260,8 +1260,8 @@
for (hba = vbus_ext->hba_list; hba; hba = hba->next) {
int rid = 0;
- if ((hba->irq_res = bus_alloc_resource(hba->pcidev,
- SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL)
+ if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev,
+ SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL)
{
os_printk("can't allocate interrupt");
return ;
Index: sys/dev/hptiop/hptiop.c
===================================================================
--- sys/dev/hptiop/hptiop.c
+++ sys/dev/hptiop/hptiop.c
@@ -2052,8 +2052,8 @@
xpt_action((union ccb *)&ccb);
rid = 0;
- if ((hba->irq_res = bus_alloc_resource(hba->pcidev, SYS_RES_IRQ,
- &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+ if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev, SYS_RES_IRQ,
+ &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
device_printf(dev, "allocate irq failed!\n");
goto free_hba_path;
}
Index: sys/dev/hptmv/entry.c
===================================================================
--- sys/dev/hptmv/entry.c
+++ sys/dev/hptmv/entry.c
@@ -1990,7 +1990,7 @@
return rid;
rid = 0;
- if ((pAdapter->hpt_irq = bus_alloc_resource(pAdapter->hpt_dev, SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL)
+ if ((pAdapter->hpt_irq = bus_alloc_resource_any(pAdapter->hpt_dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL)
{
hpt_printk(("can't allocate interrupt\n"));
return(ENXIO);
Index: sys/dev/hptnr/hptnr_osm_bsd.c
===================================================================
--- sys/dev/hptnr/hptnr_osm_bsd.c
+++ sys/dev/hptnr/hptnr_osm_bsd.c
@@ -1445,8 +1445,8 @@
for (hba = vbus_ext->hba_list; hba; hba = hba->next) {
int rid = 0;
- if ((hba->irq_res = bus_alloc_resource(hba->pcidev,
- SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL)
+ if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev,
+ SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL)
{
os_printk("can't allocate interrupt");
return ;
Index: sys/dev/hptrr/hptrr_osm_bsd.c
===================================================================
--- sys/dev/hptrr/hptrr_osm_bsd.c
+++ sys/dev/hptrr/hptrr_osm_bsd.c
@@ -1093,8 +1093,8 @@
for (hba = vbus_ext->hba_list; hba; hba = hba->next) {
int rid = 0;
- if ((hba->irq_res = bus_alloc_resource(hba->pcidev,
- SYS_RES_IRQ, &rid, 0, ~0ul, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL)
+ if ((hba->irq_res = bus_alloc_resource_any(hba->pcidev,
+ SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)) == NULL)
{
os_printk("can't allocate interrupt");
return ;
Index: sys/dev/isci/isci.c
===================================================================
--- sys/dev/isci/isci.c
+++ sys/dev/isci/isci.c
@@ -138,8 +138,8 @@
struct ISCI_PCI_BAR *pci_bar = &isci->pci_bar[i];
pci_bar->resource_id = PCIR_BAR(i*2);
- pci_bar->resource = bus_alloc_resource(isci->device,
- SYS_RES_MEMORY, &pci_bar->resource_id, 0, ~0, 1,
+ pci_bar->resource = bus_alloc_resource_any(isci->device,
+ SYS_RES_MEMORY, &pci_bar->resource_id,
RF_ACTIVE);
if(pci_bar->resource == NULL)
Index: sys/dev/ixgb/if_ixgb.c
===================================================================
--- sys/dev/ixgb/if_ixgb.c
+++ sys/dev/ixgb/if_ixgb.c
@@ -1243,8 +1243,8 @@
device_t dev = adapter->dev;
rid = IXGB_MMBA;
- adapter->res_memory = bus_alloc_resource(dev, SYS_RES_MEMORY,
- &rid, 0, ~0, 1,
+ adapter->res_memory = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &rid,
RF_ACTIVE);
if (!(adapter->res_memory)) {
device_printf(dev, "Unable to allocate bus resource: memory\n");
@@ -1257,9 +1257,9 @@
adapter->hw.hw_addr = (uint8_t *) & adapter->osdep.mem_bus_space_handle;
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)) {
device_printf(dev,
"Unable to allocate bus resource: interrupt\n");
Index: sys/dev/lmc/if_lmc.c
===================================================================
--- sys/dev/lmc/if_lmc.c
+++ sys/dev/lmc/if_lmc.c
@@ -4510,8 +4510,8 @@
sc->csr_res_id = TLP_CBMA;
sc->csr_res_type = SYS_RES_MEMORY;
# endif
- sc->csr_res = bus_alloc_resource(dev, sc->csr_res_type, &sc->csr_res_id,
- 0, ~0, 1, RF_ACTIVE);
+ sc->csr_res = bus_alloc_resource_any(dev, sc->csr_res_type, &sc->csr_res_id,
+ RF_ACTIVE);
if (sc->csr_res == NULL)
{
printf("%s: bus_alloc_resource(csr) failed.\n", NAME_UNIT);
@@ -4522,8 +4522,8 @@
/* Allocate PCI interrupt resources for the card. */
sc->irq_res_id = 0;
- sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_res_id,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_res_id,
+ RF_ACTIVE | RF_SHAREABLE);
if (sc->irq_res == NULL)
{
printf("%s: bus_alloc_resource(irq) failed.\n", NAME_UNIT);
Index: sys/dev/mrsas/mrsas.c
===================================================================
--- sys/dev/mrsas/mrsas.c
+++ sys/dev/mrsas/mrsas.c
@@ -833,8 +833,8 @@
bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4);
sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */
- if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
- &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE))
+ if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &(sc->reg_res_id), RF_ACTIVE))
== NULL) {
device_printf(dev, "Cannot allocate PCI registers\n");
goto attach_fail;
Index: sys/dev/mxge/if_mxge.c
===================================================================
--- sys/dev/mxge/if_mxge.c
+++ sys/dev/mxge/if_mxge.c
@@ -4661,8 +4661,8 @@
rid = 0;
sc->legacy_irq = 1;
}
- sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, 0, ~0,
- 1, RF_SHAREABLE | RF_ACTIVE);
+ sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE | RF_ACTIVE);
if (sc->irq_res == NULL) {
device_printf(sc->dev, "could not alloc interrupt\n");
return ENXIO;
@@ -4813,8 +4813,8 @@
/* Map the board into the kernel */
rid = PCIR_BARS;
- 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 == NULL) {
device_printf(dev, "could not map memory\n");
err = ENXIO;
Index: sys/dev/nvme/nvme_ctrlr.c
===================================================================
--- sys/dev/nvme/nvme_ctrlr.c
+++ sys/dev/nvme/nvme_ctrlr.c
@@ -52,8 +52,8 @@
ctrlr->resource_id = PCIR_BAR(0);
- ctrlr->resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY,
- &ctrlr->resource_id, 0, ~0, 1, RF_ACTIVE);
+ ctrlr->resource = bus_alloc_resource_any(ctrlr->dev, SYS_RES_MEMORY,
+ &ctrlr->resource_id, RF_ACTIVE);
if(ctrlr->resource == NULL) {
nvme_printf(ctrlr, "unable to allocate pci resource\n");
@@ -72,8 +72,8 @@
* bus_alloc_resource() will just return NULL which is OK.
*/
ctrlr->bar4_resource_id = PCIR_BAR(4);
- ctrlr->bar4_resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY,
- &ctrlr->bar4_resource_id, 0, ~0, 1, RF_ACTIVE);
+ ctrlr->bar4_resource = bus_alloc_resource_any(ctrlr->dev, SYS_RES_MEMORY,
+ &ctrlr->bar4_resource_id, RF_ACTIVE);
return (0);
}
Index: sys/dev/sound/pci/envy24.c
===================================================================
--- sys/dev/sound/pci/envy24.c
+++ sys/dev/sound/pci/envy24.c
@@ -2482,17 +2482,17 @@
{
/* allocate I/O port resource */
sc->csid = PCIR_CCS;
- sc->cs = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
- &sc->csid, 0, ~0, 1, RF_ACTIVE);
+ sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+ &sc->csid, RF_ACTIVE);
sc->ddmaid = PCIR_DDMA;
- sc->ddma = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
- &sc->ddmaid, 0, ~0, 1, RF_ACTIVE);
+ sc->ddma = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+ &sc->ddmaid, RF_ACTIVE);
sc->dsid = PCIR_DS;
- sc->ds = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
- &sc->dsid, 0, ~0, 1, RF_ACTIVE);
+ sc->ds = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+ &sc->dsid, RF_ACTIVE);
sc->mtid = PCIR_MT;
- sc->mt = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
- &sc->mtid, 0, ~0, 1, RF_ACTIVE);
+ sc->mt = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+ &sc->mtid, RF_ACTIVE);
if (!sc->cs || !sc->ddma || !sc->ds || !sc->mt) {
device_printf(sc->dev, "unable to map IO port space\n");
return ENXIO;
@@ -2516,8 +2516,8 @@
/* allocate interrupt resource */
sc->irqid = 0;
- sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24_intr, sc, &sc->ih)) {
device_printf(sc->dev, "unable to map interrupt\n");
Index: sys/dev/sound/pci/envy24ht.c
===================================================================
--- sys/dev/sound/pci/envy24ht.c
+++ sys/dev/sound/pci/envy24ht.c
@@ -2400,11 +2400,11 @@
{
/* allocate I/O port resource */
sc->csid = PCIR_CCS;
- sc->cs = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
- &sc->csid, 0, ~0, 1, RF_ACTIVE);
+ sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+ &sc->csid, RF_ACTIVE);
sc->mtid = ENVY24HT_PCIR_MT;
- sc->mt = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
- &sc->mtid, 0, ~0, 1, RF_ACTIVE);
+ sc->mt = bus_alloc_resource_any(sc->dev, SYS_RES_IOPORT,
+ &sc->mtid, RF_ACTIVE);
if (!sc->cs || !sc->mt) {
device_printf(sc->dev, "unable to map IO port space\n");
return ENXIO;
@@ -2422,8 +2422,8 @@
/* allocate interrupt resource */
sc->irqid = 0;
- sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24ht_intr, sc, &sc->ih)) {
device_printf(sc->dev, "unable to map interrupt\n");
Index: sys/dev/sound/pci/hdspe.c
===================================================================
--- sys/dev/sound/pci/hdspe.c
+++ sys/dev/sound/pci/hdspe.c
@@ -128,8 +128,8 @@
/* Allocate resource. */
sc->csid = PCIR_BAR(0);
- sc->cs = bus_alloc_resource(sc->dev, SYS_RES_MEMORY,
- &sc->csid, 0, ~0, 1, RF_ACTIVE);
+ sc->cs = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY,
+ &sc->csid, RF_ACTIVE);
if (!sc->cs) {
device_printf(sc->dev, "Unable to map SYS_RES_MEMORY.\n");
@@ -141,8 +141,8 @@
/* Allocate interrupt resource. */
sc->irqid = 0;
- sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
bus_setup_intr(sc->dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV,
Index: sys/dev/sound/pci/vibes.c
===================================================================
--- sys/dev/sound/pci/vibes.c
+++ sys/dev/sound/pci/vibes.c
@@ -759,8 +759,8 @@
/* Register IRQ handler */
sc->irqid = 0;
- sc->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid,
- 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE);
+ sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid,
+ RF_ACTIVE | RF_SHAREABLE);
if (!sc->irq ||
snd_setup_intr(dev, sc->irq, 0, sv_intr, sc, &sc->ih)) {
device_printf(dev, "sv_attach: Unable to map interrupt\n");
Index: sys/dev/twa/tw_osl_freebsd.c
===================================================================
--- sys/dev/twa/tw_osl_freebsd.c
+++ sys/dev/twa/tw_osl_freebsd.c
@@ -338,8 +338,8 @@
return(error);
}
sc->reg_res_id = PCIR_BARS + bar0_offset;
- if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
- &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE))
+ if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &(sc->reg_res_id), RF_ACTIVE))
== NULL) {
tw_osli_printf(sc, "error = %d",
TW_CL_SEVERITY_ERROR_STRING,
@@ -355,8 +355,8 @@
/* Allocate and register our interrupt. */
sc->irq_res_id = 0;
- if ((sc->irq_res = bus_alloc_resource(sc->bus_dev, SYS_RES_IRQ,
- &(sc->irq_res_id), 0, ~0, 1,
+ if ((sc->irq_res = bus_alloc_resource_any(sc->bus_dev, SYS_RES_IRQ,
+ &(sc->irq_res_id),
RF_SHAREABLE | RF_ACTIVE)) == NULL) {
tw_osli_printf(sc, "error = %d",
TW_CL_SEVERITY_ERROR_STRING,
Index: sys/dev/tws/tws.c
===================================================================
--- sys/dev/tws/tws.c
+++ sys/dev/tws/tws.c
@@ -245,8 +245,8 @@
/* allocate MMIO register space */
sc->reg_res_id = TWS_PCI_BAR1; /* BAR1 offset */
- if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
- &(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE))
+ if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &(sc->reg_res_id), RF_ACTIVE))
== NULL) {
tws_log(sc, ALLOC_MEMORY_RES);
goto attach_fail_1;
Index: sys/isa/isa_common.c
===================================================================
--- sys/isa/isa_common.c
+++ sys/isa/isa_common.c
@@ -150,8 +150,8 @@
start += MAX(align, 1)) {
bus_set_resource(child, SYS_RES_MEMORY, i,
start, size);
- res[i] = bus_alloc_resource(child,
- SYS_RES_MEMORY, &i, 0, ~0, 1,
+ res[i] = bus_alloc_resource_any(child,
+ SYS_RES_MEMORY, &i,
rman_make_alignment_flags(align) /* !RF_ACTIVE */);
if (res[i]) {
result->ic_mem[i].ir_start = start;
@@ -224,8 +224,8 @@
start += align) {
bus_set_resource(child, SYS_RES_IOPORT, i,
start, size);
- res[i] = bus_alloc_resource(child,
- SYS_RES_IOPORT, &i, 0, ~0, 1,
+ res[i] = bus_alloc_resource_any(child,
+ SYS_RES_IOPORT, &i,
rman_make_alignment_flags(align) /* !RF_ACTIVE */);
if (res[i]) {
result->ic_port[i].ir_start = start;
Index: sys/mips/sibyte/ata_zbbus.c
===================================================================
--- sys/mips/sibyte/ata_zbbus.c
+++ sys/mips/sibyte/ata_zbbus.c
@@ -67,7 +67,7 @@
ch->attached = 1;
rid = 0;
- 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)
return (ENXIO);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 12, 8:10 PM (10 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35010169
Default Alt Text
D5306.id13380.diff (16 KB)
Attached To
Mode
D5306: Replace several bus_alloc_resource() calls with default arguments with bus_alloc_resource_any()
Attached
Detach File
Event Timeline
Log In to Comment