aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/powermac
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-03-13 22:05:54 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-03-13 22:05:54 +0000
commitd77f2092ceebaba115e6be53410428f6f5f6ae83 (patch)
tree7ef42f41d2c2ca7060e9261236ce5ab27adf3d1e /sys/powerpc/powermac
parentfef01f0498aa7b256bc37bbf28ee0e8ac9b2536f (diff)
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r--sys/powerpc/powermac/macio.c17
-rw-r--r--sys/powerpc/powermac/uninorth.c17
2 files changed, 16 insertions, 18 deletions
diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c
index b443f277ec89..cb4471bbcca1 100644
--- a/sys/powerpc/powermac/macio.c
+++ b/sys/powerpc/powermac/macio.c
@@ -92,10 +92,10 @@ static int macio_deactivate_resource(device_t, device_t, int, int,
struct resource *);
static int macio_release_resource(device_t, device_t, int, int,
struct resource *);
-static int macio_map_resource(device_t, device_t, int, struct resource *,
+static int macio_map_resource(device_t, device_t, struct resource *,
struct resource_map_request *,
struct resource_map *);
-static int macio_unmap_resource(device_t, device_t, int, struct resource *,
+static int macio_unmap_resource(device_t, device_t, struct resource *,
struct resource_map *);
static struct resource_list *macio_get_resource_list (device_t, device_t);
static ofw_bus_get_devinfo_t macio_get_devinfo;
@@ -663,9 +663,8 @@ macio_deactivate_resource(device_t bus, device_t child, int type, int rid,
}
static int
-macio_map_resource(device_t bus, device_t child, int type,
- struct resource *r, struct resource_map_request *argsp,
- struct resource_map *map)
+macio_map_resource(device_t bus, device_t child, struct resource *r,
+ struct resource_map_request *argsp, struct resource_map *map)
{
struct resource_map_request args;
struct macio_softc *sc;
@@ -677,7 +676,7 @@ macio_map_resource(device_t bus, device_t child, int type,
return (ENXIO);
/* Mappings are only supported on I/O and memory resources. */
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
break;
@@ -705,13 +704,13 @@ macio_map_resource(device_t bus, device_t child, int type,
}
static int
-macio_unmap_resource(device_t bus, device_t child, int type,
- struct resource *r, struct resource_map *map)
+macio_unmap_resource(device_t bus, device_t child, struct resource *r,
+ struct resource_map *map)
{
/*
* If this is a memory resource, unmap it.
*/
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
pmap_unmapdev(map->r_vaddr, map->r_size);
diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c
index b9cb4814b986..c7842311d730 100644
--- a/sys/powerpc/powermac/uninorth.c
+++ b/sys/powerpc/powermac/uninorth.c
@@ -82,10 +82,10 @@ static int unin_chip_activate_resource(device_t, device_t, int, int,
struct resource *);
static int unin_chip_deactivate_resource(device_t, device_t, int, int,
struct resource *);
-static int unin_chip_map_resource(device_t, device_t, int, struct resource *,
+static int unin_chip_map_resource(device_t, device_t, struct resource *,
struct resource_map_request *,
struct resource_map *);
-static int unin_chip_unmap_resource(device_t, device_t, int, struct resource *,
+static int unin_chip_unmap_resource(device_t, device_t, struct resource *,
struct resource_map *);
static int unin_chip_release_resource(device_t, device_t, int, int,
struct resource *);
@@ -621,9 +621,8 @@ unin_chip_deactivate_resource(device_t bus, device_t child, int type, int rid,
}
static int
-unin_chip_map_resource(device_t bus, device_t child, int type,
- struct resource *r, struct resource_map_request *argsp,
- struct resource_map *map)
+unin_chip_map_resource(device_t bus, device_t child, struct resource *r,
+ struct resource_map_request *argsp, struct resource_map *map)
{
struct resource_map_request args;
rman_res_t length, start;
@@ -634,7 +633,7 @@ unin_chip_map_resource(device_t bus, device_t child, int type,
return (ENXIO);
/* Mappings are only supported on I/O and memory resources. */
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
break;
@@ -661,13 +660,13 @@ unin_chip_map_resource(device_t bus, device_t child, int type,
}
static int
-unin_chip_unmap_resource(device_t bus, device_t child, int type,
- struct resource *r, struct resource_map *map)
+unin_chip_unmap_resource(device_t bus, device_t child, struct resource *r,
+ struct resource_map *map)
{
/*
* If this is a memory resource, unmap it.
*/
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
pmap_unmapdev(map->r_vaddr, map->r_size);