summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2016-02-16 15:18:12 +0000
committerandrew <andrew@FreeBSD.org>2016-02-16 15:18:12 +0000
commit05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2 (patch)
treeef2970757da3567fedb2a64ae083c1be0e25f35d /sys/mips
parent284f6cde63476cc099b272baa04262937e75e289 (diff)
downloadFreeBSD-src-05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2.zip
FreeBSD-src-05274f8a8b8da8cd3adf7aa6d8a877992dbc44d2.tar.gz
Allow callers of OF_decode_addr to get the size of the found mapping. This
will allow for code that uses the old fdt_get_range and fdt_regsize functions to find a range, map it, access, then unmap to replace this, up to and including the map, with a call to OF_decode_addr. As this function should only be used in the early boot code the unmap is mostly do document we no longer need the mapping as it's a no-op, at least on arm. Reviewed by: jhibbits Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5258
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/mips/ofw_machdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/mips/mips/ofw_machdep.c b/sys/mips/mips/ofw_machdep.c
index 82e2959..26bc260 100644
--- a/sys/mips/mips/ofw_machdep.c
+++ b/sys/mips/mips/ofw_machdep.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
int
OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag,
- bus_space_handle_t *handle)
+ bus_space_handle_t *handle, bus_size_t *sz)
{
bus_addr_t addr;
bus_size_t size;
@@ -66,5 +66,9 @@ OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag,
*tag = fdtbus_bs_tag;
flags = 0;
#endif
+
+ if (sz != NULL)
+ *sz = size;
+
return (bus_space_map(*tag, addr, size, flags, handle));
}
OpenPOWER on IntegriCloud