Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/uebayasi-xip]: src/sys/uvm Always map device pages via cdev as unmanaged...



details:   https://anonhg.NetBSD.org/src/rev/0d6891ec8221
branches:  uebayasi-xip
changeset: 751684:0d6891ec8221
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Tue Apr 27 08:20:09 2010 +0000

description:
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.

diffstat:

 sys/uvm/uvm_device.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 8b751d18200b -r 0d6891ec8221 sys/uvm/uvm_device.c
--- a/sys/uvm/uvm_device.c      Tue Apr 27 07:19:27 2010 +0000
+++ b/sys/uvm/uvm_device.c      Tue Apr 27 08:20:09 2010 +0000
@@ -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,



Home | Main Index | Thread Index | Old Index