Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Introduce uvm_km_protect.
details: https://anonhg.NetBSD.org/src/rev/f49290085134
branches: trunk
changeset: 346581:f49290085134
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Jul 20 12:38:43 2016 +0000
description:
Introduce uvm_km_protect.
diffstat:
sys/uvm/uvm_extern.h | 4 +++-
sys/uvm/uvm_km.c | 14 ++++++++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
diffs (53 lines):
diff -r a9f82172e2ec -r f49290085134 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h Wed Jul 20 12:33:59 2016 +0000
+++ b/sys/uvm/uvm_extern.h Wed Jul 20 12:38:43 2016 +0000
@@ -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 @@
/* 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);
diff -r a9f82172e2ec -r f49290085134 sys/uvm/uvm_km.c
--- a/sys/uvm/uvm_km.c Wed Jul 20 12:33:59 2016 +0000
+++ b/sys/uvm/uvm_km.c Wed Jul 20 12:38:43 2016 +0000
@@ -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_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
*/
Home |
Main Index |
Thread Index |
Old Index