diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-12-15 02:24:24 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-12-15 02:24:24 +0000 |
commit | f61f2ae4bb51d8b7a9ee01c2989522f336618d7d (patch) | |
tree | 5a1de4696d0daa317cad34f8858407df1e10805f /sys/uvm/uvm_km.c | |
parent | ec8373aeb4f1b524b9597fc90351bc52eb411ca2 (diff) |
Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,
eliminating the must-be-kept-in-sync UVM_INH_* macros
ok deraadt@ tedu@
Diffstat (limited to 'sys/uvm/uvm_km.c')
-rw-r--r-- | sys/uvm/uvm_km.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index d0f21231d5c..53ddeef501c 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.121 2014/11/27 21:40:52 kettenis Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.122 2014/12/15 02:24:23 guenther Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -184,7 +184,7 @@ uvm_km_init(vaddr_t start, vaddr_t end) if (base != start && uvm_map(&kernel_map_store, &base, start - base, NULL, UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, - UVM_INH_NONE, POSIX_MADV_RANDOM, UVM_FLAG_FIXED)) != 0) + MAP_INHERIT_NONE, POSIX_MADV_RANDOM, UVM_FLAG_FIXED)) != 0) panic("uvm_km_init: could not reserve space for kernel"); kernel_map = &kernel_map_store; @@ -211,7 +211,7 @@ uvm_km_suballoc(struct vm_map *map, vaddr_t *min, vaddr_t *max, vsize_t size, /* first allocate a blank spot in the parent map */ if (uvm_map(map, min, size, NULL, UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, UVM_INH_NONE, + PROT_READ | PROT_WRITE, MAP_INHERIT_NONE, POSIX_MADV_RANDOM, mapflags)) != 0) { panic("uvm_km_suballoc: unable to allocate space in parent map"); } @@ -341,7 +341,7 @@ uvm_km_kmemalloc_pla(struct vm_map *map, struct uvm_object *obj, vsize_t size, /* allocate some virtual space */ if (__predict_false(uvm_map(map, &kva, size, obj, UVM_UNKNOWN_OFFSET, valign, UVM_MAPFLAG(PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, UVM_INH_NONE, + PROT_READ | PROT_WRITE, MAP_INHERIT_NONE, POSIX_MADV_RANDOM, (flags & UVM_KMF_TRYLOCK))) != 0)) { return(0); } @@ -460,7 +460,7 @@ uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit) UVM_UNKNOWN_OFFSET, align, UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE | PROT_EXEC, - UVM_INH_NONE, POSIX_MADV_RANDOM, 0)) != 0)) { + MAP_INHERIT_NONE, POSIX_MADV_RANDOM, 0)) != 0)) { return(0); } @@ -548,7 +548,7 @@ uvm_km_valloc_align(struct vm_map *map, vsize_t size, vsize_t align, int flags) if (__predict_false(uvm_map(map, &kva, size, uvm.kernel_object, UVM_UNKNOWN_OFFSET, align, UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, - UVM_INH_NONE, POSIX_MADV_RANDOM, flags)) != 0)) { + MAP_INHERIT_NONE, POSIX_MADV_RANDOM, flags)) != 0)) { return(0); } @@ -583,7 +583,7 @@ uvm_km_valloc_prefer_wait(struct vm_map *map, vsize_t size, voff_t prefer) if (__predict_true(uvm_map(map, &kva, size, uvm.kernel_object, prefer, 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, - UVM_INH_NONE, POSIX_MADV_RANDOM, 0)) == 0)) { + MAP_INHERIT_NONE, POSIX_MADV_RANDOM, 0)) == 0)) { return(kva); } @@ -667,7 +667,7 @@ uvm_km_page_init(void) if (uvm_map(kernel_map, &addr, (vsize_t)bulk << PAGE_SHIFT, NULL, UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, UVM_INH_NONE, + PROT_READ | PROT_WRITE, MAP_INHERIT_NONE, POSIX_MADV_RANDOM, UVM_KMF_TRYLOCK)) != 0) { bulk /= 2; continue; @@ -732,7 +732,7 @@ uvm_km_thread(void *arg) */ flags = UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, - UVM_INH_NONE, POSIX_MADV_RANDOM, + MAP_INHERIT_NONE, POSIX_MADV_RANDOM, fp != NULL ? UVM_KMF_TRYLOCK : 0); memset(pg, 0, sizeof(pg)); for (i = 0; i < nitems(pg); i++) { @@ -746,7 +746,7 @@ uvm_km_thread(void *arg) /* made progress, so don't sleep for more */ flags = UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, - UVM_INH_NONE, POSIX_MADV_RANDOM, + MAP_INHERIT_NONE, POSIX_MADV_RANDOM, UVM_KMF_TRYLOCK); } @@ -920,7 +920,7 @@ try_map: map = *kv->kv_map; va = vm_map_min(map); if (uvm_map(map, &va, sz, uobj, kd->kd_prefer, - kv->kv_align, UVM_MAPFLAG(prot, prot, UVM_INH_NONE, + kv->kv_align, UVM_MAPFLAG(prot, prot, MAP_INHERIT_NONE, POSIX_MADV_RANDOM, mapflags))) { if (kv->kv_wait && kd->kd_waitok) { tsleep(map, PVM, "km_allocva", 0); |