bootspace
tssym = bootspace.head.va;
tesym = bootspace.head.va; /* (unused...) */
memset(&bootspace, 0, sizeof(bootspace));
bootspace.head.va = KERNTEXTOFF;
bootspace.head.pa = KERNTEXTOFF - KERNBASE;
bootspace.head.sz = 0;
bootspace.segs[i].type = BTSEG_TEXT;
bootspace.segs[i].va = KERNTEXTOFF;
bootspace.segs[i].pa = KERNTEXTOFF - KERNBASE;
bootspace.segs[i].sz = (size_t)&__rodata_start - KERNTEXTOFF;
bootspace.segs[i].type = BTSEG_RODATA;
bootspace.segs[i].va = (vaddr_t)&__rodata_start;
bootspace.segs[i].pa = (paddr_t)&__rodata_start - KERNBASE;
bootspace.segs[i].sz = (size_t)&__data_start - (size_t)&__rodata_start;
bootspace.segs[i].type = BTSEG_DATA;
bootspace.segs[i].va = (vaddr_t)&__data_start;
bootspace.segs[i].pa = (paddr_t)&__data_start - KERNBASE;
bootspace.segs[i].sz = (size_t)&__kernel_end - (size_t)&__data_start;
bootspace.boot.va = (vaddr_t)&__kernel_end;
bootspace.boot.pa = (paddr_t)&__kernel_end - KERNBASE;
bootspace.boot.sz = (size_t)(atdevbase + IOM_SIZE) -
bootspace.spareva = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
bootspace.pdir = (vaddr_t)(PDPpaddr + KERNBASE);
bootspace.smodule = (vaddr_t)atdevbase + IOM_SIZE;
bootspace.emodule = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
pd_entry_t *pdir = (pd_entry_t *)bootspace.pdir;
kva = bootspace.head.va;
kva_end = kva + bootspace.head.sz;
kva = bootspace.segs[i].va;
kva_end = kva + bootspace.segs[i].sz;
if (bootspace.segs[i].type == BTSEG_TEXT ||
bootspace.segs[i].type == BTSEG_RODATA) {
kva = bootspace.boot.va;
kva_end = kva + bootspace.boot.sz;
if (v >= bootspace.smodule && v < bootspace.emodule) {
extern struct bootspace bootspace;
uvm_map_setup(&module_map_store, bootspace.smodule,
bootspace.emodule, 0);
extern struct bootspace bootspace;
pd_entry_t *pdir = (pd_entry_t *)bootspace.pdir;
void *bootspace;
extern struct bootspace bootspace;
memcpy(&bootspace, pkargs->bootspace, sizeof(bootspace));
extern struct bootspace bootspace;
if (bootspace.segs[i].type == BTSEG_NONE) {
kasan_shadow_map((void *)bootspace.segs[i].va,
bootspace.segs[i].sz);
kasan_shadow_map((void *)bootspace.boot.va, bootspace.boot.sz);
kasan_shadow_map((void *)bootspace.smodule,
(size_t)(bootspace.emodule - bootspace.smodule));
kasan_shadow_map((void *)bootspace.spareva, PAGE_SIZE);
extern struct bootspace bootspace;
pt_entry_t *pdir = (pt_entry_t *)bootspace.pdir;
extern struct bootspace bootspace;
if (bootspace.segs[i].type == BTSEG_NONE) {
kmsan_shadow_map((void *)bootspace.segs[i].va,
bootspace.segs[i].sz);
kmsan_shadow_map((void *)bootspace.boot.va, bootspace.boot.sz);
kmsan_shadow_map((void *)bootspace.smodule,
(size_t)(bootspace.emodule - bootspace.smodule));
kmsan_shadow_map((void *)bootspace.spareva, PAGE_SIZE);
if (bootspace.segs[i].type == BTSEG_TEXT) {
} else if (bootspace.segs[i].type == BTSEG_RODATA) {
mm_mprotect(bootspace.segs[i].va, bootspace.segs[i].sz, prot);
if (bootspace.segs[i].type == BTSEG_NONE) {
sva = bootspace.segs[i].va;
eva = sva + bootspace.segs[i].sz;
if (bootspace.segs[i].type == BTSEG_NONE) {
pa = bootspace.segs[i].pa + bootspace.segs[i].sz;
if (bootspace.segs[i].type == BTSEG_NONE) {
bootspace.segs[i].type = type;
bootspace.segs[i].va = va;
bootspace.segs[i].pa = pa;
bootspace.segs[i].sz = sz;
bootspace.head.va = randva;
bootspace.head.pa = kernpa_start;
bootspace.head.sz = size;
bootspace.boot.va = randva;
bootspace.boot.pa = bootpa;
bootspace.boot.sz = (size_t)(iom_base + IOM_SIZE) -
(size_t)bootspace.boot.va;
bootspace.spareva = bootspace.boot.va + NKL2_KIMG_ENTRIES * NBPD_L2;
bootspace.pdir = bootspace.boot.va + (PDPpaddr - bootspace.boot.pa);
bootspace.smodule = (vaddr_t)iom_base + IOM_SIZE;
bootspace.emodule = bootspace.boot.va + NKL2_KIMG_ENTRIES * NBPD_L2;
memset(&bootspace, 0, sizeof(bootspace));
struct bootspace bootspace;
void *bootspace;
extern struct bootspace bootspace;
pkargs.bootspace = &bootspace;
pkargs.lwp0uarea = bootspace.boot.va + (stkpa - bootspace.boot.pa);
memset(&bootspace, 0, sizeof(bootspace));
bootspace.head.va = KERNTEXTOFF;
bootspace.head.pa = KERNTEXTOFF - KERNBASE;
bootspace.head.sz = 0;
bootspace.segs[i].type = BTSEG_TEXT;
bootspace.segs[i].va = KERNTEXTOFF;
bootspace.segs[i].pa = KERNTEXTOFF - KERNBASE;
bootspace.segs[i].sz = (size_t)&__rodata_start - KERNTEXTOFF;
bootspace.segs[i].type = BTSEG_RODATA;
bootspace.segs[i].va = (vaddr_t)&__rodata_start;
bootspace.segs[i].pa = (paddr_t)(vaddr_t)&__rodata_start - KERNBASE;
bootspace.segs[i].sz = (size_t)&__data_start - (size_t)&__rodata_start;
bootspace.segs[i].type = BTSEG_DATA;
bootspace.segs[i].va = (vaddr_t)&__data_start;
bootspace.segs[i].pa = (paddr_t)(vaddr_t)&__data_start - KERNBASE;
bootspace.segs[i].sz = (size_t)&__kernel_end - (size_t)&__data_start;
bootspace.boot.va = (vaddr_t)&__kernel_end;
bootspace.boot.pa = (paddr_t)(vaddr_t)&__kernel_end - KERNBASE;
bootspace.boot.sz = (size_t)(atdevbase + IOM_SIZE) -
bootspace.pdir = (vaddr_t)(PDPpaddr + KERNBASE);
extern struct bootspace bootspace;
extern struct bootspace bootspace;
if (bootspace.segs[i].type != BTSEG_TEXT &&
bootspace.segs[i].type != BTSEG_RODATA) {
if (addr >= bootspace.segs[i].va &&
addr < (bootspace.segs[i].va + bootspace.segs[i].sz)) {
extern struct bootspace bootspace;
if (bootspace.segs[i].type != BTSEG_TEXT)
va = bootspace.segs[i].va;
while (n < bootspace.segs[i].sz) {
kpm->pm_pdir = (pd_entry_t *)bootspace.pdir;
early_zerop = (void *)bootspace.spareva;
tmpva = bootspace.spareva;
spahole = roundup(bootspace.head.pa, NBPD_L2);
epahole = rounddown(bootspace.boot.pa, NBPD_L2);
tmpva = bootspace.spareva;
kva = bootspace.head.va;
kva_end = kva + bootspace.head.sz;
if (bootspace.segs[i].type == BTSEG_NONE) {
kva = bootspace.segs[i].va;
kva_end = kva + bootspace.segs[i].sz;
kva = bootspace.boot.va;
kva_end = kva + bootspace.boot.sz;
if (bootspace.segs[i].type != BTSEG_TEXT) {
kva = roundup(bootspace.segs[i].va, NBPD_L2);
if (kva < bootspace.segs[i].va) {
kva_end = rounddown(bootspace.segs[i].va +
bootspace.segs[i].sz, NBPD_L2);
pa = roundup(bootspace.segs[i].pa, NBPD_L2);
if (bootspace.segs[i].type != BTSEG_RODATA) {
kva = roundup(bootspace.segs[i].va, NBPD_L2);
if (kva < bootspace.segs[i].va) {
kva_end = rounddown(bootspace.segs[i].va +
bootspace.segs[i].sz, NBPD_L2);
pa = roundup(bootspace.segs[i].pa, NBPD_L2);
if (bootspace.segs[i].type != BTSEG_DATA) {
kva = roundup(bootspace.segs[i].va, NBPD_L2);
if (kva < bootspace.segs[i].va) {
kva_end = rounddown(bootspace.segs[i].va +
bootspace.segs[i].sz, NBPD_L2);
pa = roundup(bootspace.segs[i].pa, NBPD_L2);
struct bootspace bootspace __read_mostly;
extern struct bootspace bootspace;
paddr_t pa_kstart = bootspace.head.pa;