Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/riscv/pmap.c
Show First 20 Lines • Show All 698 Lines • ▼ Show 20 Lines | |||||
#define alloc_pages(var, np) \ | #define alloc_pages(var, np) \ | ||||
(var) = freemempos; \ | (var) = freemempos; \ | ||||
freemempos += (np * PAGE_SIZE); \ | freemempos += (np * PAGE_SIZE); \ | ||||
memset((char *)(var), 0, ((np) * PAGE_SIZE)); | memset((char *)(var), 0, ((np) * PAGE_SIZE)); | ||||
mode = 0; | mode = 0; | ||||
TUNABLE_INT_FETCH("vm.pmap.mode", &mode); | TUNABLE_INT_FETCH("vm.pmap.mode", &mode); | ||||
if (mode == PMAP_MODE_SV48) { | if (mode == PMAP_MODE_SV48 && (mmu_caps & MMU_SV48) != 0) { | ||||
/* | /* | ||||
* Enable SV48 mode: allocate an L0 page and set SV48 mode in | * Enable SV48 mode: allocate an L0 page and set SV48 mode in | ||||
* SATP. If the implementation does not provide SV48 mode, | * SATP. If the implementation does not provide SV48 mode, | ||||
* the mode read back from the (WARL) SATP register will be | * the mode read back from the (WARL) SATP register will be | ||||
* unchanged, and we continue in SV39 mode. | * unchanged, and we continue in SV39 mode. | ||||
*/ | */ | ||||
alloc_pages(l0pv, 1); | alloc_pages(l0pv, 1); | ||||
l0p = (void *)l0pv; | l0p = (void *)l0pv; | ||||
▲ Show 20 Lines • Show All 4,299 Lines • Show Last 20 Lines |