summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/atkbd_isa.c8
-rw-r--r--sys/isa/atkbdc_isa.c14
-rw-r--r--sys/isa/fd.c16
-rw-r--r--sys/isa/isa_common.c24
-rw-r--r--sys/isa/orm.c7
-rw-r--r--sys/isa/psm.c15
6 files changed, 39 insertions, 45 deletions
diff --git a/sys/isa/atkbd_isa.c b/sys/isa/atkbd_isa.c
index 6b99e91..715ab05 100644
--- a/sys/isa/atkbd_isa.c
+++ b/sys/isa/atkbd_isa.c
@@ -96,8 +96,8 @@ atkbdprobe(device_t dev)
/* see if IRQ is available */
rid = KBDC_RID_KBD;
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
- RF_SHAREABLE | RF_ACTIVE);
+ res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE | RF_ACTIVE);
if (res == NULL) {
if (bootverbose)
device_printf(dev, "unable to allocate IRQ\n");
@@ -134,8 +134,8 @@ atkbdattach(device_t dev)
return error;
/* declare our interrupt handler */
- sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
- RF_SHAREABLE | RF_ACTIVE);
+ sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE | RF_ACTIVE);
if (sc->intr == NULL)
return ENXIO;
error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, atkbd_isa_intr,
diff --git a/sys/isa/atkbdc_isa.c b/sys/isa/atkbdc_isa.c
index 2618adf..1750336 100644
--- a/sys/isa/atkbdc_isa.c
+++ b/sys/isa/atkbdc_isa.c
@@ -143,16 +143,14 @@ atkbdc_probe(device_t dev)
return ENXIO;
if (count > 1) /* adjust the count */
bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1);
- port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
- RF_ACTIVE);
+ port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
if (port0 == NULL)
return ENXIO;
rid = 1;
if (bus_get_resource(dev, SYS_RES_IOPORT, rid, NULL, NULL) != 0)
bus_set_resource(dev, SYS_RES_IOPORT, 1,
start + KBD_STATUS_PORT, 1);
- port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
- RF_ACTIVE);
+ port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
if (port1 == NULL) {
bus_release_resource(dev, SYS_RES_IOPORT, 0, port0);
return ENXIO;
@@ -193,13 +191,13 @@ atkbdc_attach(device_t dev)
}
rid = 0;
- sc->port0 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
- RF_ACTIVE);
+ sc->port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+ RF_ACTIVE);
if (sc->port0 == NULL)
return ENXIO;
rid = 1;
- sc->port1 = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
- RF_ACTIVE);
+ sc->port1 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+ RF_ACTIVE);
if (sc->port1 == NULL) {
bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0);
return ENXIO;
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 265ae1b..2dc88b9 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -762,9 +762,8 @@ fdc_alloc_resources(struct fdc_data *fdc)
/*
* Now (finally!) allocate the control port.
*/
- fdc->res_ctl = bus_alloc_resource(dev, SYS_RES_IOPORT,
- &fdc->rid_ctl,
- 0ul, ~0ul, 1, RF_ACTIVE);
+ fdc->res_ctl = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+ &fdc->rid_ctl, RF_ACTIVE);
if (fdc->res_ctl == 0) {
device_printf(dev,
"cannot reserve control I/O port range (control port)\n");
@@ -774,18 +773,17 @@ fdc_alloc_resources(struct fdc_data *fdc)
fdc->ctlh = rman_get_bushandle(fdc->res_ctl);
}
- fdc->res_irq = bus_alloc_resource(dev, SYS_RES_IRQ,
- &fdc->rid_irq, 0ul, ~0ul, 1,
- RF_ACTIVE);
+ fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ &fdc->rid_irq, RF_ACTIVE);
if (fdc->res_irq == 0) {
device_printf(dev, "cannot reserve interrupt line\n");
return ENXIO;
}
if ((fdc->flags & FDC_NODMA) == 0) {
- fdc->res_drq = bus_alloc_resource(dev, SYS_RES_DRQ,
- &fdc->rid_drq, 0ul, ~0ul, 1,
- RF_ACTIVE);
+ fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ,
+ &fdc->rid_drq,
+ RF_ACTIVE);
if (fdc->res_drq == 0) {
device_printf(dev, "cannot reserve DMA request line\n");
return ENXIO;
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
index 4f84093..1ce40b2 100644
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -153,9 +153,9 @@ isa_find_memory(device_t child,
start += align) {
bus_set_resource(child, SYS_RES_MEMORY, i,
start, size);
- res[i] = bus_alloc_resource(child,
- SYS_RES_MEMORY, &i,
- 0, ~0, 1, 0 /* !RF_ACTIVE */);
+ res[i] = bus_alloc_resource_any(child,
+ SYS_RES_MEMORY, &i,
+ 0 /* !RF_ACTIVE */);
if (res[i]) {
result->ic_mem[i].ir_start = start;
result->ic_mem[i].ir_end = start + size - 1;
@@ -228,9 +228,9 @@ isa_find_port(device_t child,
start += align) {
bus_set_resource(child, SYS_RES_IOPORT, i,
start, size);
- res[i] = bus_alloc_resource(child,
- SYS_RES_IOPORT, &i,
- 0, ~0, 1, 0 /* !RF_ACTIVE */);
+ res[i] = bus_alloc_resource_any(child,
+ SYS_RES_IOPORT, &i,
+ 0 /* !RF_ACTIVE */);
if (res[i]) {
result->ic_port[i].ir_start = start;
result->ic_port[i].ir_end = start + size - 1;
@@ -320,9 +320,9 @@ isa_find_irq(device_t child,
irq = find_next_bit(mask, irq)) {
bus_set_resource(child, SYS_RES_IRQ, i,
irq, 1);
- res[i] = bus_alloc_resource(child,
- SYS_RES_IRQ, &i,
- 0, ~0, 1, 0 /* !RF_ACTIVE */ );
+ res[i] = bus_alloc_resource_any(child,
+ SYS_RES_IRQ, &i,
+ 0 /* !RF_ACTIVE */ );
if (res[i]) {
result->ic_irqmask[i] = (1 << irq);
break;
@@ -386,9 +386,9 @@ isa_find_drq(device_t child,
drq = find_next_bit(mask, drq)) {
bus_set_resource(child, SYS_RES_DRQ, i,
drq, 1);
- res[i] = bus_alloc_resource(child,
- SYS_RES_DRQ, &i,
- 0, ~0, 1, 0 /* !RF_ACTIVE */);
+ res[i] = bus_alloc_resource_any(child,
+ SYS_RES_DRQ, &i,
+ 0 /* !RF_ACTIVE */);
if (res[i]) {
result->ic_drqmask[i] = (1 << drq);
break;
diff --git a/sys/isa/orm.c b/sys/isa/orm.c
index 18979a1..5865159 100644
--- a/sys/isa/orm.c
+++ b/sys/isa/orm.c
@@ -101,8 +101,8 @@ orm_identify(driver_t* driver, device_t parent)
bus_set_resource(child, SYS_RES_MEMORY, sc->rnum, chunk,
IOMEM_STEP);
rid = sc->rnum;
- res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul,
- ~0ul, 1, RF_ACTIVE);
+ res = bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid,
+ RF_ACTIVE);
if (res == NULL) {
bus_delete_resource(child, SYS_RES_MEMORY, sc->rnum);
chunk += IOMEM_STEP;
@@ -133,8 +133,7 @@ orm_identify(driver_t* driver, device_t parent)
bus_set_resource(child, SYS_RES_MEMORY, sc->rnum, chunk,
rom_size);
rid = sc->rnum;
- res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul,
- ~0ul, 1, 0);
+ res = bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid, 0);
if (res == NULL) {
bus_delete_resource(child, SYS_RES_MEMORY, sc->rnum);
chunk += IOMEM_STEP;
diff --git a/sys/isa/psm.c b/sys/isa/psm.c
index dd2fd7e..a414ba6 100644
--- a/sys/isa/psm.c
+++ b/sys/isa/psm.c
@@ -943,8 +943,8 @@ psmprobe(device_t dev)
/* see if IRQ is available */
rid = KBDC_RID_AUX;
- sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
- RF_SHAREABLE | RF_ACTIVE);
+ sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE | RF_ACTIVE);
if (sc->intr == NULL) {
if (bootverbose)
device_printf(dev, "unable to allocate IRQ\n");
@@ -1254,8 +1254,8 @@ psmattach(device_t dev)
/* Setup our interrupt handler */
rid = KBDC_RID_AUX;
- sc->intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
- RF_SHAREABLE | RF_ACTIVE);
+ sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE | RF_ACTIVE);
if (sc->intr == NULL)
return (ENXIO);
error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, psmintr, sc, &sc->ih);
@@ -3058,8 +3058,8 @@ psmcpnp_probe(device_t dev)
"assuming irq %ld\n", irq);
bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1);
}
- res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
- RF_SHAREABLE);
+ res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE);
bus_release_resource(dev, SYS_RES_IRQ, rid, res);
/* keep quiet */
@@ -3087,8 +3087,7 @@ psmcpnp_attach(device_t dev)
* (See psmidentify() above.)
*/
rid = 0;
- bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
- RF_SHAREABLE);
+ bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE);
}
return 0;
OpenPOWER on IntegriCloud