Module Name: src Committed By: maxv Date: Wed Jul 20 12:38:44 UTC 2016
Modified Files: src/sys/uvm: uvm_extern.h uvm_km.c Log Message: Introduce uvm_km_protect. To generate a diff of this commit: cvs rdiff -u -r1.197 -r1.198 src/sys/uvm/uvm_extern.h cvs rdiff -u -r1.139 -r1.140 src/sys/uvm/uvm_km.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_extern.h diff -u src/sys/uvm/uvm_extern.h:1.197 src/sys/uvm/uvm_extern.h:1.198 --- src/sys/uvm/uvm_extern.h:1.197 Wed May 25 17:43:58 2016 +++ src/sys/uvm/uvm_extern.h Wed Jul 20 12:38:43 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_extern.h,v 1.197 2016/05/25 17:43:58 christos Exp $ */ +/* $NetBSD: uvm_extern.h,v 1.198 2016/07/20 12:38:43 maxv Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -627,6 +627,8 @@ int uvm_io(struct vm_map *, struct uio /* uvm_km.c */ vaddr_t uvm_km_alloc(struct vm_map *, vsize_t, vsize_t, uvm_flag_t); +int uvm_km_protect(struct vm_map *, vaddr_t, vsize_t, + vm_prot_t); void uvm_km_free(struct vm_map *, vaddr_t, vsize_t, uvm_flag_t); Index: src/sys/uvm/uvm_km.c diff -u src/sys/uvm/uvm_km.c:1.139 src/sys/uvm/uvm_km.c:1.140 --- src/sys/uvm/uvm_km.c:1.139 Fri Feb 6 18:19:22 2015 +++ src/sys/uvm/uvm_km.c Wed Jul 20 12:38:43 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_km.c,v 1.139 2015/02/06 18:19:22 maxv Exp $ */ +/* $NetBSD: uvm_km.c,v 1.140 2016/07/20 12:38:43 maxv Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -152,7 +152,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_km.c,v 1.139 2015/02/06 18:19:22 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_km.c,v 1.140 2016/07/20 12:38:43 maxv Exp $"); #include "opt_uvmhist.h" @@ -708,6 +708,16 @@ uvm_km_alloc(struct vm_map *map, vsize_t } /* + * uvm_km_protect: change the protection of an allocated area + */ + +int +uvm_km_protect(struct vm_map *map, vaddr_t addr, vsize_t size, vm_prot_t prot) +{ + return uvm_map_protect(map, addr, addr + round_page(size), prot, false); +} + +/* * uvm_km_free: free an area of kernel memory */