From 388a5417caf214e74d248d63a62c6606ff9357e6 Mon Sep 17 00:00:00 2001 From: mpi Date: Wed, 21 Apr 2021 10:02:05 +0000 Subject: [PATCH] Convert remaining uvm_km_zalloc(9) to km_alloc(9). Tested by bluhm@, jj@, kettenis@ and Scott Bennett. ok kettenis@ --- sys/kern/kern_malloc.c | 6 +++--- sys/uvm/uvm_page.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 2c768625607..f487cab77db 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.144 2021/02/23 13:50:16 jsg Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.145 2021/04/21 10:02:05 mpi Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -580,8 +580,8 @@ kmeminit(void) FALSE, &kmem_map_store); kmembase = (char *)base; kmemlimit = (char *)limit; - kmemusage = (struct kmemusage *) uvm_km_zalloc(kernel_map, - (vsize_t)(nkmempages * sizeof(struct kmemusage))); + kmemusage = km_alloc(round_page(nkmempages * sizeof(struct kmemusage)), + &kv_any, &kp_zero, &kd_waitok); for (indx = 0; indx < MINBUCKET + 16; indx++) { XSIMPLEQ_INIT(&bucket[indx].kb_freelist); } diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 4a9563c570f..8307b76113e 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.156 2021/03/26 13:40:05 mpi Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.157 2021/04/21 10:02:05 mpi Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ /* @@ -542,8 +542,8 @@ uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start, npages = end - start; /* # of pages */ - pgs = (struct vm_page *)uvm_km_zalloc(kernel_map, - npages * sizeof(*pgs)); + pgs = km_alloc(npages * sizeof(*pgs), &kv_any, &kp_zero, + &kd_waitok); if (pgs == NULL) { printf("uvm_page_physload: can not malloc vm_page " "structs for segment\n"); -- 2.20.1