Expand description
§Address Space (x86-64, PML4-rooted)
Strongly-typed helpers to build and manipulate a single virtual address
space (tree rooted at a PML4). This complements the typed paging layers
(PageMapLevel4, PageDirectoryPointerTable, PageDirectory, PageTable).
§Highlights
AddressSpace::map_oneto install one mapping (4 KiB / 2 MiB / 1 GiB).AddressSpace::unmap_oneto clear a single 4 KiB PTE.AddressSpace::queryto translate a VA to PA (handles huge pages).AddressSpace::activateto load CR3 with this space’s root.
§Design
- Non-leaf entries are created with caller-provided non-leaf flags (typically: present + writable, US as needed). Leaf flags come from the mapping call. We never silently set US/GLOBAL/NX; the caller decides.
- Uses
PhysicalPage<Size4K>for page-table frames, andVirtualAddress/PhysicalAddressfor endpoints. Alignment is asserted via typed helpers. - Keeps
unsafeconfined to mapping a physical frame to a typed table through thePhysMapper.
§Safety
- Mutating active mappings requires appropriate TLB maintenance (e.g.,
invlpgper page or CR3 reload). - The provided
PhysMappermust yield writable references to table frames.
Modules§
- map_
size 🔒 - Memory Page Table Mapping Size
Structs§
- Address
Space - Handle to a single, concrete address space.
Enums§
- Address
Space MapOne Error - A mapping error.
- Address
Space MapRegion Error - A mapping error.
- Ensure
Target - Target table/level produced by
ensure_chain. - Walk
Result 🔒 - The result of a table walk.
Traits§
- MapSize
- Page-size–directed mapping behavior
Type Aliases§
- Root
Page - The PML4 root page for an
AddressSpace.