diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-05-02 12:54:43 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-05-02 12:54:43 +0000 |
commit | 772b0c37f150c6ea557a6f0914cf713d966413c4 (patch) | |
tree | 6326d009e7938e4553f4cb9dfcb9f4e36ed46f87 /sys/uvm | |
parent | 8453a3eb6c668c29ab3d93b698cf7cca6ef0d3ac (diff) |
a few more memset changes.
two cases of pool_get() + memset(0) -> pool_get(,,,PR_ZERO)
1.5 cases of global variables are already zeroed, so don't zero them.
ok ariane@, comments on stuff i'd missed from blambert@ and cnst@.
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_aobj.c | 6 | ||||
-rw-r--r-- | sys/uvm/uvm_init.c | 6 | ||||
-rw-r--r-- | sys/uvm/uvm_map.c | 6 |
3 files changed, 6 insertions, 12 deletions
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index 4fd652fd32d..fb131b0036c 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_aobj.c,v 1.36 2009/03/20 15:19:04 oga Exp $ */ +/* $OpenBSD: uvm_aobj.c,v 1.37 2009/05/02 12:54:42 oga Exp $ */ /* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */ /* @@ -249,11 +249,9 @@ uao_find_swhash_elt(struct uvm_aobj *aobj, int pageidx, boolean_t create) /* * allocate a new entry for the bucket and init/insert it in */ - elt = pool_get(&uao_swhash_elt_pool, PR_WAITOK); + elt = pool_get(&uao_swhash_elt_pool, PR_WAITOK | PR_ZERO); LIST_INSERT_HEAD(swhash, elt, list); elt->tag = page_tag; - elt->count = 0; - memset(elt->slots, 0, sizeof(elt->slots)); return(elt); } diff --git a/sys/uvm/uvm_init.c b/sys/uvm/uvm_init.c index 82bbb31e780..192a781a74f 100644 --- a/sys/uvm/uvm_init.c +++ b/sys/uvm/uvm_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_init.c,v 1.20 2009/03/20 15:19:04 oga Exp $ */ +/* $OpenBSD: uvm_init.c,v 1.21 2009/05/02 12:54:42 oga Exp $ */ /* $NetBSD: uvm_init.c,v 1.14 2000/06/27 17:29:23 mrg Exp $ */ /* @@ -81,10 +81,8 @@ uvm_init(void) } /* - * step 1: zero the uvm structure + * step 1: set up stats. */ - - memset(&uvm, 0, sizeof(uvm)); averunnable.fscale = FSCALE; /* diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 75abac9c9f2..8858a585027 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.109 2009/03/25 20:00:18 oga Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.110 2009/05/02 12:54:42 oga Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -3191,7 +3191,7 @@ uvmspace_alloc(vaddr_t min, vaddr_t max, boolean_t pageable, struct vmspace *vm; UVMHIST_FUNC("uvmspace_alloc"); UVMHIST_CALLED(maphist); - vm = pool_get(&uvm_vmspace_pool, PR_WAITOK); + vm = pool_get(&uvm_vmspace_pool, PR_WAITOK | PR_ZERO); uvmspace_init(vm, NULL, min, max, pageable, remove_holes); UVMHIST_LOG(maphist,"<- done (vm=%p)", vm,0,0,0); return (vm); @@ -3209,8 +3209,6 @@ uvmspace_init(struct vmspace *vm, struct pmap *pmap, vaddr_t min, vaddr_t max, { UVMHIST_FUNC("uvmspace_init"); UVMHIST_CALLED(maphist); - memset(vm, 0, sizeof(*vm)); - uvm_map_setup(&vm->vm_map, min, max, pageable ? VM_MAP_PAGEABLE : 0); if (pmap) |