svn commit: r269333 - projects/arm64/sys/arm64/arm64
Andrew Turner
andrew at FreeBSD.org
Thu Jul 31 14:48:36 UTC 2014
Author: andrew
Date: Thu Jul 31 14:48:35 2014
New Revision: 269333
URL: http://svnweb.freebsd.org/changeset/base/269333
Log:
Implement the map and unmap functions.
Modified:
projects/arm64/sys/arm64/arm64/bus_machdep.c
Modified: projects/arm64/sys/arm64/arm64/bus_machdep.c
==============================================================================
--- projects/arm64/sys/arm64/arm64/bus_machdep.c Thu Jul 31 14:47:26 2014 (r269332)
+++ projects/arm64/sys/arm64/arm64/bus_machdep.c Thu Jul 31 14:48:35 2014 (r269333)
@@ -28,8 +28,36 @@
#include <sys/param.h>
__FBSDID("$FreeBSD$");
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
#include <machine/bus.h>
+static int
+generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags,
+ bus_space_handle_t *bshp)
+{
+ void *va;
+
+ va = pmap_mapdev(bpa, size);
+ if (va == NULL)
+ return (ENOMEM);
+ *bshp = (bus_space_handle_t)va;
+ return (0);
+}
+
+static void
+generic_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size)
+{
+
+ pmap_unmapdev(bsh, size);
+}
+
struct bus_space memmap_bus = {
+ /* cookie */
.bs_cookie = NULL,
+
+ /* mapping/unmapping */
+ .bs_map = generic_bs_map,
+ .bs_unmap = generic_bs_unmap,
};
More information about the svn-src-projects
mailing list