Account for ebus(4) defaulting to SYS_RES_MEMORY for memory resources

since ebus.c rev. 1.22.
This commit is contained in:
Marius Strobl 2005-06-04 20:29:28 +00:00
parent 07945ccd23
commit fcff691970
4 changed files with 15 additions and 15 deletions

View File

@ -110,7 +110,7 @@ envctrl_attach(device_t dev)
bzero(sc, sizeof(struct pcf_softc));
/* IO port is mandatory */
sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
&sc->rid_ioport, RF_ACTIVE);
if (sc->res_ioport == 0) {
device_printf(dev, "cannot reserve I/O port range\n");
@ -157,9 +157,9 @@ envctrl_attach(device_t dev)
sc->res_irq);
}
if (sc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
}
return (rv);
@ -186,8 +186,8 @@ envctrl_detach(device_t dev)
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq);
}
bus_deactivate_resource(dev, SYS_RES_IOPORT, sc->rid_ioport, sc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport, sc->res_ioport);
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport);
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport);
return (0);
}

View File

@ -151,7 +151,7 @@ pcf_ebus_attach(device_t dev)
}
/* IO port is mandatory */
sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
&sc->rid_ioport, RF_ACTIVE);
if (sc->res_ioport == 0) {
device_printf(dev, "cannot reserve I/O port range\n");
@ -218,9 +218,9 @@ pcf_ebus_attach(device_t dev)
sc->res_irq);
}
if (sc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
}
return (rv);
@ -249,9 +249,9 @@ pcf_ebus_detach(device_t dev)
sc->res_irq);
}
bus_deactivate_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
return (0);

View File

@ -71,7 +71,7 @@ puc_ebus_attach(device_t dev)
dd.ports[i].bar = 0;
dd.ports[i].offset = 0x40 * i;
dd.ports[i].serialfreq = 0;
dd.ports[i].flags = 0;
dd.ports[i].flags = PUC_FLAGS_MEMORY;
}
return (puc_attach(dev, &dd));
}

View File

@ -247,7 +247,7 @@ sab_probe(device_t dev)
if (strcmp(name, "se") != 0 && strcmp(name, "serial") != 0)
return (ENXIO);
rid = 0;
res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
RF_ACTIVE);
if (res == NULL)
return (ENXIO);
@ -268,7 +268,7 @@ sab_probe(device_t dev)
device_set_desc(dev, "Siemens SAB 82532 ???");
break;
}
bus_release_resource(dev, SYS_RES_IOPORT, rid, res);
bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
return (0);
}
@ -287,7 +287,7 @@ sab_attach(device_t dev)
irqrid = 0;
irqres = NULL;
sc = device_get_softc(dev);
iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &iorid,
iores = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &iorid,
RF_ACTIVE);
if (iores == NULL)
goto error;
@ -350,7 +350,7 @@ sab_detach(device_t dev)
sc = device_get_softc(dev);
bus_generic_detach(dev);
if (sc->sc_iores != NULL)
bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_iorid,
bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_iorid,
sc->sc_iores);
return (0);
}