summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-06-04 20:31:20 +0000
committermarius <marius@FreeBSD.org>2005-06-04 20:31:20 +0000
commitef0744154b04fc79183d4ebd783ac14e684ec72f (patch)
tree857200665a892abb96a5462dec121cb2dd3dac30 /sys/sparc64
parentba798e730cc935095a1520e37541f02b99d7fc99 (diff)
downloadFreeBSD-src-ef0744154b04fc79183d4ebd783ac14e684ec72f.zip
FreeBSD-src-ef0744154b04fc79183d4ebd783ac14e684ec72f.tar.gz
Now that all affected drivers have been changed remove the helpers
for the SYS_RES_IOPORT -> SYS_RES_MEMORY transition again. While it was helpful to not need to change all of the affected drivers in a single pass together with ebus(4) we probably shouldn't start into 6.0 with such a hack. This requires some of the modules of affected drivers to be rebuilt, namely: auxio(4), snd_audiocs(4) and puc(4).
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/ebus/ebus.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/sys/sparc64/ebus/ebus.c b/sys/sparc64/ebus/ebus.c
index da03495..73f8337 100644
--- a/sys/sparc64/ebus/ebus.c
+++ b/sys/sparc64/ebus/ebus.c
@@ -110,7 +110,6 @@ static bus_probe_nomatch_t ebus_probe_nomatch;
static bus_alloc_resource_t ebus_alloc_resource;
static bus_release_resource_t ebus_release_resource;
static bus_get_resource_list_t ebus_get_resource_list;
-static bus_get_resource_t ebus_get_resource;
static ofw_bus_get_compat_t ebus_get_compat;
static ofw_bus_get_model_t ebus_get_model;
static ofw_bus_get_name_t ebus_get_name;
@@ -137,7 +136,7 @@ static device_method_t ebus_methods[] = {
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_release_resource, ebus_release_resource),
- DEVMETHOD(bus_get_resource, ebus_get_resource),
+ DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_compat, ebus_get_compat),
@@ -309,12 +308,11 @@ ebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
* allocation type.
*/
switch (type) {
- case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
KASSERT(!(isdefault && passthrough),
("ebus_alloc_resource: passthrough of default alloc"));
if (!passthrough) {
- rle = resource_list_find(rl, SYS_RES_MEMORY, *rid);
+ rle = resource_list_find(rl, type, *rid);
if (rle == NULL)
return (NULL);
KASSERT(rle->res == NULL,
@@ -366,12 +364,11 @@ ebus_release_resource(device_t bus, device_t child, int type, int rid,
rl = BUS_GET_RESOURCE_LIST(bus, child);
switch (type) {
- case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
if ((rv = rman_release_resource(res)) != 0)
return (rv);
if (!passthrough) {
- rle = resource_list_find(rl, SYS_RES_MEMORY, rid);
+ rle = resource_list_find(rl, type, rid);
KASSERT(rle != NULL, ("ebus_release_resource: "
"resource entry not found!"));
KASSERT(rle->res != NULL, ("ebus_alloc_resource: "
@@ -397,34 +394,6 @@ ebus_get_resource_list(device_t dev, device_t child)
return (&edi->edi_rl);
}
-static int
-ebus_get_resource(device_t dev, device_t child, int type, int rid,
- u_long *startp, u_long *countp)
-{
- struct resource_list *rl;
- struct resource_list_entry *rle;
-
- switch (type) {
- case SYS_RES_IOPORT:
- case SYS_RES_MEMORY:
- rl = BUS_GET_RESOURCE_LIST(dev, child);
- if (!rl)
- return (EINVAL);
- rle = resource_list_find(rl, SYS_RES_MEMORY, rid);
- if (!rle)
- return (ENOENT);
- if (startp)
- *startp = rle->start;
- if (countp)
- *countp = rle->count;
- return (0);
- case SYS_RES_IRQ:
- return (bus_generic_rl_get_resource(dev, child, type, rid,
- startp, countp));
- }
- return (EINVAL);
-}
-
static struct ebus_devinfo *
ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, phandle_t node,
char *name)
OpenPOWER on IntegriCloud