Module Name: src Committed By: jmcneill Date: Fri Feb 11 23:05:55 UTC 2011
Modified Files: src/sys/uvm: uvm_device.c uvm_pmap.h Log Message: add optional MD pmap_mmap_flags macro for passing flags between cdev_mmap and pmap_enter, ok matt@ To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/uvm/uvm_device.c cvs rdiff -u -r1.35 -r1.36 src/sys/uvm/uvm_pmap.h 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.58 src/sys/uvm/uvm_device.c:1.59 --- src/sys/uvm/uvm_device.c:1.58 Wed Feb 2 15:13:34 2011 +++ src/sys/uvm/uvm_device.c Fri Feb 11 23:05:55 2011 @@ -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, Index: src/sys/uvm/uvm_pmap.h diff -u src/sys/uvm/uvm_pmap.h:1.35 src/sys/uvm/uvm_pmap.h:1.36 --- src/sys/uvm/uvm_pmap.h:1.35 Mon Nov 29 09:49:33 2010 +++ src/sys/uvm/uvm_pmap.h Fri Feb 11 23:05:55 2011 @@ -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);