Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm add optional MD pmap_mmap_flags macro for passing fl...



details:   https://anonhg.NetBSD.org/src/rev/358a5bf611c2
branches:  trunk
changeset: 761944:358a5bf611c2
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Feb 11 23:05:55 2011 +0000

description:
add optional MD pmap_mmap_flags macro for passing flags between cdev_mmap
and pmap_enter, ok matt@

diffstat:

 sys/uvm/uvm_device.c |  10 ++++++----
 sys/uvm/uvm_pmap.h   |   5 ++++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r e2584995811e -r 358a5bf611c2 sys/uvm/uvm_device.c
--- a/sys/uvm/uvm_device.c      Fri Feb 11 17:53:35 2011 +0000
+++ b/sys/uvm/uvm_device.c      Fri Feb 11 23:05:55 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_device.c,v 1.58 2011/02/02 15:13:34 chuck Exp $    */
+/*     $NetBSD: uvm_device.c,v 1.59 2011/02/11 23:05:55 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.58 2011/02/02 15:13:34 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.59 2011/02/11 23:05:55 jmcneill Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -355,6 +355,7 @@
        vaddr_t curr_va;
        off_t curr_offset;
        paddr_t paddr, mdpgno;
+       u_int mmapflags;
        int lcv, retval;
        dev_t device;
        vm_prot_t mapprot;
@@ -415,12 +416,13 @@
                        break;
                }
                paddr = pmap_phys_address(mdpgno);
+               mmapflags = pmap_mmap_flags(mdpgno);
                mapprot = ufi->entry->protection;
                UVMHIST_LOG(maphist,
                    "  MAPPING: device: pm=0x%x, va=0x%x, pa=0x%lx, at=%d",
                    ufi->orig_map->pmap, curr_va, paddr, mapprot);
-               if (pmap_enter(ufi->orig_map->pmap, curr_va, paddr,
-                   mapprot, PMAP_CANFAIL | mapprot) != 0) {
+               if (pmap_enter(ufi->orig_map->pmap, curr_va, paddr, mapprot,
+                   PMAP_CANFAIL | mapprot | mmapflags) != 0) {
                        /*
                         * pmap_enter() didn't have the resource to
                         * enter this mapping.  Unlock everything,
diff -r e2584995811e -r 358a5bf611c2 sys/uvm/uvm_pmap.h
--- a/sys/uvm/uvm_pmap.h        Fri Feb 11 17:53:35 2011 +0000
+++ b/sys/uvm/uvm_pmap.h        Fri Feb 11 23:05:55 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pmap.h,v 1.35 2010/11/29 09:49:33 mrg Exp $        */
+/*     $NetBSD: uvm_pmap.h,v 1.36 2011/02/11 23:05:55 jmcneill Exp $   */
 
 /*
  * Copyright (c) 1991, 1993
@@ -178,6 +178,9 @@
 #if !defined(pmap_phys_address)
 paddr_t                pmap_phys_address(paddr_t);
 #endif
+#if !defined(pmap_mmap_flags)
+#define pmap_mmap_flags(x)     0
+#endif
 void           pmap_protect(pmap_t, vaddr_t, vaddr_t, vm_prot_t);
 #if !defined(pmap_reference)
 void           pmap_reference(pmap_t);



Home | Main Index | Thread Index | Old Index