Module Name: src
Committed By: uebayasi
Date: Tue Apr 27 08:20:09 UTC 2010
Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_device.c
Log Message:
Always map device pages via cdev as unmanaged for now.
I need this to read/write a NOR FlashROM from userland. Otherwise pmaps
believe the physload'ed ROM region as managed, and map it as cache
enabled, which prevents me from reading ROM command status, etc.
To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.2.1 src/sys/uvm/uvm_device.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_device.c
diff -u src/sys/uvm/uvm_device.c:1.57 src/sys/uvm/uvm_device.c:1.57.2.1
--- src/sys/uvm/uvm_device.c:1.57 Fri Feb 5 03:49:11 2010
+++ src/sys/uvm/uvm_device.c Tue Apr 27 08:20:09 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_device.c,v 1.57 2010/02/05 03:49:11 uebayasi Exp $ */
+/* $NetBSD: uvm_device.c,v 1.57.2.1 2010/04/27 08:20:09 uebayasi Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.57 2010/02/05 03:49:11 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.57.2.1 2010/04/27 08:20:09 uebayasi Exp $");
#include "opt_uvmhist.h"
@@ -426,8 +426,12 @@
UVMHIST_LOG(maphist,
" MAPPING: device: pm=0x%x, va=0x%x, pa=0x%lx, at=%d",
ufi->orig_map->pmap, curr_va, paddr, mapprot);
+ /*
+ * XXXUEBS
+ * always map device pages as unmanaged (uncached) for now.
+ */
if (pmap_enter(ufi->orig_map->pmap, curr_va, paddr,
- mapprot, PMAP_CANFAIL | mapprot) != 0) {
+ mapprot, PMAP_CANFAIL | PMAP_UNMANAGED | mapprot) != 0) {
/*
* pmap_enter() didn't have the resource to
* enter this mapping. Unlock everything,