mirror of
https://github.com/opnsense/src.git
synced 2026-06-06 15:22:34 -04:00
riscv: fix a bug in calculating the pindex for L1 page
pmap_l1_pindex(va) expands to: ((va >> L1_SHIFT) + NUL2E)
Reviewed by: mhorne
MFC after: 1 week
Fixes: a4667e09e6 ("Convert vm_page_alloc() callers to...")
Pull Request: https://github.com/freebsd/freebsd-src/pull/1360
This commit is contained in:
parent
05cf677bb8
commit
2e33abc354
1 changed files with 4 additions and 4 deletions
|
|
@ -1887,8 +1887,8 @@ pmap_growkernel(vm_offset_t addr)
|
|||
nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT |
|
||||
VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO);
|
||||
if (nkpg == NULL)
|
||||
panic("pmap_growkernel: no memory to grow kernel");
|
||||
nkpg->pindex = kernel_vm_end >> L1_SHIFT;
|
||||
panic("%s: no memory to grow kernel", __func__);
|
||||
nkpg->pindex = pmap_l1_pindex(kernel_vm_end);
|
||||
paddr = VM_PAGE_TO_PHYS(nkpg);
|
||||
|
||||
pn = (paddr / PAGE_SIZE);
|
||||
|
|
@ -1913,8 +1913,8 @@ pmap_growkernel(vm_offset_t addr)
|
|||
nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT |
|
||||
VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO);
|
||||
if (nkpg == NULL)
|
||||
panic("pmap_growkernel: no memory to grow kernel");
|
||||
nkpg->pindex = kernel_vm_end >> L2_SHIFT;
|
||||
panic("%s: no memory to grow kernel", __func__);
|
||||
nkpg->pindex = pmap_l2_pindex(kernel_vm_end);
|
||||
paddr = VM_PAGE_TO_PHYS(nkpg);
|
||||
|
||||
pn = (paddr / PAGE_SIZE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue