Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/riscv/pmap.c
Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Lines | pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) | ||||
* will add themselves later in init_secondary(). The SBI firmware | * will add themselves later in init_secondary(). The SBI firmware | ||||
* may rely on this mask being precise, so CPU_FILL() is not used. | * may rely on this mask being precise, so CPU_FILL() is not used. | ||||
*/ | */ | ||||
CPU_SET(PCPU_GET(hart), &kernel_pmap->pm_active); | CPU_SET(PCPU_GET(hart), &kernel_pmap->pm_active); | ||||
/* Assume the address we were loaded to is a valid physical address. */ | /* Assume the address we were loaded to is a valid physical address. */ | ||||
min_pa = max_pa = kernstart; | min_pa = max_pa = kernstart; | ||||
physmap_idx = physmem_avail(physmap, nitems(physmap)); | physmap_idx = physmem_hwregions(physmap, nitems(physmap)); | ||||
physmap_idx /= 2; | physmap_idx /= 2; | ||||
/* | /* | ||||
* Find the minimum physical address. physmap is sorted, | * Find the minimum physical address. physmap is sorted, | ||||
* but may contain empty ranges. | * but may contain empty ranges. | ||||
*/ | */ | ||||
for (i = 0; i < physmap_idx * 2; i += 2) { | for (i = 0; i < physmap_idx * 2; i += 2) { | ||||
if (physmap[i] == physmap[i + 1]) | if (physmap[i] == physmap[i + 1]) | ||||
▲ Show 20 Lines • Show All 4,049 Lines • Show Last 20 Lines |