Module address_space

Module address_space 

Source
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

§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, and VirtualAddress / PhysicalAddress for endpoints. Alignment is asserted via typed helpers.
  • Keeps unsafe confined to mapping a physical frame to a typed table through the PhysMapper.

§Safety

  • Mutating active mappings requires appropriate TLB maintenance (e.g., invlpg per page or CR3 reload).
  • The provided PhysMapper must yield writable references to table frames.

Modules§

map_size 🔒
Memory Page Table Mapping Size

Structs§

AddressSpace
Handle to a single, concrete address space.

Enums§

AddressSpaceMapOneError
A mapping error.
AddressSpaceMapRegionError
A mapping error.
EnsureTarget
Target table/level produced by ensure_chain.
WalkResult 🔒
The result of a table walk.

Traits§

MapSize
Page-size–directed mapping behavior

Type Aliases§

RootPage
The PML4 root page for an AddressSpace.