summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdt/simplefb.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-12-18 10:13:45 +0000
committerkettenis <kettenis@openbsd.org>2017-12-18 10:13:45 +0000
commit8186ecd8fbb8a8a2a9b7ecdfb31294d26a3db07e (patch)
treed3e549269ef00f8a5d0713d1a360b68fddf6b690 /sys/dev/fdt/simplefb.c
parentRevert support for multiple threads to enter kqueue_scan() in parallel. (diff)
downloadwireguard-openbsd-8186ecd8fbb8a8a2a9b7ecdfb31294d26a3db07e.tar.xz
wireguard-openbsd-8186ecd8fbb8a8a2a9b7ecdfb31294d26a3db07e.zip
Map framebuffer into userland as non-cachable (but normal) memory. We still
map the framebuffer as device memory in the kernel. Using mismatched memory attributes like this is discouraged (and we should probably fix this at some point) but this particular case is well-defined and the potential side-effects should not matter for thus use-case. ok patrick@
Diffstat (limited to 'sys/dev/fdt/simplefb.c')
-rw-r--r--sys/dev/fdt/simplefb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c
index 893dafea658..11c1a28d94a 100644
--- a/sys/dev/fdt/simplefb.c
+++ b/sys/dev/fdt/simplefb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: simplefb.c,v 1.2 2017/08/27 12:42:22 kettenis Exp $ */
+/* $OpenBSD: simplefb.c,v 1.3 2017/12/18 10:13:45 kettenis Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -19,6 +19,8 @@
#include <sys/systm.h>
#include <sys/device.h>
+#include <uvm/uvm_extern.h>
+
#include <machine/bus.h>
#include <machine/fdt.h>
@@ -276,7 +278,7 @@ simplefb_wsmmap(void *v, off_t off, int prot)
if (off < 0 || off >= sc->sc_psize)
return -1;
- return sc->sc_paddr + off;
+ return ((sc->sc_paddr + off) | PMAP_NOCACHE);
}
int