From: mpi Date: Sat, 24 Aug 2024 10:46:43 +0000 (+0000) Subject: Place uvm_km_zalloc(9) under #ifdef __i386__. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0944b500c9fb6bc0c22032a51787e48aef571026;p=openbsd Place uvm_km_zalloc(9) under #ifdef __i386__. This allocator is only used by a single pmap which will be hopefully converted. Suggested by guenther@ --- diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index 973c4ab1b52..3bbd15047cb 100644 --- a/sys/uvm/uvm_extern.h +++ b/sys/uvm/uvm_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_extern.h,v 1.176 2024/08/24 10:38:44 mpi Exp $ */ +/* $OpenBSD: uvm_extern.h,v 1.177 2024/08/24 10:46:43 mpi Exp $ */ /* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */ /* @@ -287,7 +287,9 @@ int uvm_io(vm_map_t, struct uio *, int); #define UVM_IO_FIXPROT 0x01 -vaddr_t uvm_km_zalloc(vm_map_t, vsize_t, vsize_t); +#ifdef __i386__ +vaddr_t uvm_km_zalloc(vm_map_t, vsize_t); +#endif void uvm_km_free(vm_map_t, vaddr_t, vsize_t); vaddr_t uvm_km_kmemalloc_pla(struct vm_map *, struct uvm_object *, vsize_t, vsize_t, int, diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index 9d3af6cf962..b2c4ba882e9 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.153 2024/08/24 10:38:44 mpi Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.154 2024/08/24 10:46:43 mpi Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -433,13 +433,14 @@ uvm_km_free(struct vm_map *map, vaddr_t addr, vsize_t size) uvm_unmap(map, trunc_page(addr), round_page(addr+size)); } +#ifdef __i386__ /* * uvm_km_zalloc: allocate wired down memory in the kernel map. * * => we can sleep if needed */ vaddr_t -uvm_km_zalloc(struct vm_map *map, vsize_t size, vsize_t align) +uvm_km_zalloc(struct vm_map *map, vsize_t size) { vaddr_t kva, loopva; voff_t offset; @@ -452,7 +453,7 @@ uvm_km_zalloc(struct vm_map *map, vsize_t size, vsize_t align) /* allocate some virtual space */ if (__predict_false(uvm_map(map, &kva, size, uvm.kernel_object, - UVM_UNKNOWN_OFFSET, align, + UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_INHERIT_NONE, MADV_RANDOM, 0)) != 0)) { @@ -510,6 +511,7 @@ uvm_km_zalloc(struct vm_map *map, vsize_t size, vsize_t align) return kva; } +#endif #if defined(__HAVE_PMAP_DIRECT) /*