Expand description
Cap-index convention for transpiler-emitted Images.
The geometry of a linked program — which data regions exist, how
many pages each occupies, and where they land in the guest address
space — belongs to [nub_program::Regions] and is decided by the
linker. What lives here is the one thing that is genuinely a JAVM
choice: which cnode slot each region’s Cap::Data is filed under.
Slots 65..68 are arbitrary but fixed. They sit above the low slots a
guest’s own cnode uses, and the runtime resolves each Image
MemoryMapping’s source path through them.
Constants§
- CODE_
BASE - Re-exported PVM2 ABI layout constants (see [
nub_program::abi]). Guest virtual address where the (single) code region maps read-only. A PVM PC isCODE_BASE + byte_offset. Sits at 4 MiB so[0, 4 MiB)is an unmapped null guard. - DATA_
BASE - Re-exported PVM2 ABI layout constants (see [
nub_program::abi]). Guest virtual address where the data region begins. All data regions (stack / ro / rw / heap) and instance overlays live in[DATA_BASE, 4 GiB). At 256 MiB, well clear of the largest permitted code region. - HEAP_
CAP_ INDEX - Cap index of the heap DATA cap.
- MAX_
CODE_ SIZE - Re-exported PVM2 ABI layout constants (see [
nub_program::abi]). Maximum byte length of the code region. Code occupies[CODE_BASE, CODE_BASE + code_len)and must stay belowDATA_BASE, socode_len ≤ DATA_BASE − CODE_BASE= 252 MiB. - PVM_
PAGE_ SIZE - PVM page size in bytes. PVM page size in bytes. Every region is a whole number of pages.
- RO_
CAP_ INDEX - Cap index of the read-only DATA cap (
.rodata). - RW_
CAP_ INDEX - Cap index of the read-write DATA cap (
.data+.bss). - STACK_
CAP_ INDEX - Cap index of the stack DATA cap.
Functions§
- cap_
index - The cnode slot a region’s
Cap::Datais filed under.