diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2024-04-10 15:38:12 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2024-04-10 15:38:12 +0000 |
commit | 302be32608d626092931ab692a05a83cfa2c815c (patch) | |
tree | f63086cb4e7f9d1b1d1cfeb7543230cb91ce3769 /sys/arch/alpha | |
parent | 63ce2e4e1c9f4c35136d95d1c25d093095e7949a (diff) |
Use km_alloc(9) to allocate USPACE instead of uvm_pglistalloc(9).
ok miod@
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r-- | sys/arch/alpha/alpha/cpu.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c index 0b605f6af46..86362bb00a9 100644 --- a/sys/arch/alpha/alpha/cpu.c +++ b/sys/arch/alpha/alpha/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.48 2023/10/24 13:20:09 claudio Exp $ */ +/* $OpenBSD: cpu.c,v 1.49 2024/04/10 15:38:11 mpi Exp $ */ /* $NetBSD: cpu.c,v 1.44 2000/05/23 05:12:53 thorpej Exp $ */ /*- @@ -228,10 +228,13 @@ cpuattach(struct device *parent, struct device *dev, void *aux) #endif u_int32_t major, minor; #if defined(MULTIPROCESSOR) - extern paddr_t avail_start, avail_end; + vaddr_t pcbva; struct pcb *pcb; - struct pglist mlist; - int error; + const struct kmem_pa_mode kp_contig = { + .kp_constraint = &no_constraint, + .kp_maxseg = 1, + .kp_zero = 1 + }; #endif p = LOCATE_PCS(hwrpb, ma->ma_slot); @@ -326,10 +329,8 @@ recognized: /* * Allocate UPAGES contiguous pages for the idle PCB and stack. */ - TAILQ_INIT(&mlist); - error = uvm_pglistalloc(USPACE, avail_start, avail_end - 1, 0, 0, - &mlist, 1, UVM_PLA_WAITOK); - if (error != 0) { + pcbva = (vaddr_t)km_alloc(USPACE, &kv_any, &kp_contig, &kd_waitok); + if (pcbva == 0) { if (ma->ma_slot == hwrpb->rpb_primary_cpu_id) { panic("cpu_attach: unable to allocate idle stack for" " primary"); @@ -338,10 +339,8 @@ recognized: return; } - ci->ci_idle_pcb_paddr = VM_PAGE_TO_PHYS(TAILQ_FIRST(&mlist)); - pcb = ci->ci_idle_pcb = (struct pcb *) - ALPHA_PHYS_TO_K0SEG(ci->ci_idle_pcb_paddr); - memset(pcb, 0, USPACE); + ci->ci_idle_pcb_paddr = ALPHA_K0SEG_TO_PHYS(pcbva); + pcb = ci->ci_idle_pcb = (struct pcb *)pcbva; /* * Initialize the idle stack pointer, reserving space for an |