From: mpi Date: Sat, 17 Aug 2024 13:35:01 +0000 (+0000) Subject: Use km_alloc(9) to allocate USPACE instead of uvm_pglistalloc(9). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a5db629194d16656467b2f1f27c388f64c8de888;p=openbsd Use km_alloc(9) to allocate USPACE instead of uvm_pglistalloc(9). ok miod@ --- diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c index 4e4a89976dc..ddffcd62dbb 100644 --- a/sys/arch/mips64/mips64/cpu.c +++ b/sys/arch/mips64/mips64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.83 2023/06/15 22:18:07 cheloha Exp $ */ +/* $OpenBSD: cpu.c,v 1.84 2024/08/17 13:35:01 mpi Exp $ */ /* * Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se) @@ -408,21 +408,19 @@ cpu_unidle(struct cpu_info *ci) mips64_send_ipi(ci->ci_cpuid, MIPS64_IPI_NOP); } -vaddr_t -alloc_contiguous_pages(size_t size) +vaddr_t +alloc_contiguous_pages(size_t sz) { - struct pglist mlist; - struct vm_page *m; - int error; + const struct kmem_pa_mode kp_contig = { + .kp_constraint = &no_constraint, + .kp_maxseg = 1, + .kp_zero = 1 + }; paddr_t pa; - TAILQ_INIT(&mlist); - error = uvm_pglistalloc(round_page(size), 0, (paddr_t)-1, 0, 0, - &mlist, 1, UVM_PLA_NOWAIT | UVM_PLA_ZERO); - if (error) + pa = (paddr_t)km_alloc(round_page(sz), &kv_any, &kp_contig, &kd_nowait); + if (pa == 0) return 0; - m = TAILQ_FIRST(&mlist); - pa = VM_PAGE_TO_PHYS(m); return PHYS_TO_XKPHYS(pa, CCA_CACHED); }