Skip to main content

Module mem

Module mem 

Source
Expand description

Guest and host page geometry for Darwin arm64 images on Linux.

Structs§

AddressSpace
Tracked guest VA ranges for one process (borrowed images + owned mmaps).
GuestMemory
Fully mapped guest image address space (slide applied).
MapRequest
Request to map one segment-like region from a Mach-O image.
MappedRegion
One mapped guest region (host-owned).
PageLayout
Combined host + guest geometry for one process session.
RegRegionSnapshot
Snapshot of a registry entry (no ownership).

Enums§

GuestPageSize
Guest page size policy for image planning.
HostPageSize
Supported host page sizes we handle explicitly.
MapError
Errors while mapping guest memory.
PageError
Errors from page-size detection or validation.
RemoveOutcome
Result of AddressSpace::remove_range / remove_range.

Constants§

DARWIN_ARM64_PAGE_SIZE
Default guest page size for arm64 Darwin images (bytes).
VM_PROT_EXECUTE
VM_PROT_READ
Darwin VM_PROT_* bits (same numeric values as XNU).
VM_PROT_WRITE

Functions§

darwin_to_host_prot
Converts Darwin VM_PROT_* to host PROT_*.
map_stack
Maps an anonymous RW stack region (guest VA == host VA, kernel-chosen).
mprotect_darwin
Restores Darwin-derived host protection on a region.
mprotect_rw
Temporarily makes a region read/write (for SVC patching / bind writes).
register_borrowed
Registers a borrowed region on the active address space.
register_owned
Registers an owned anonymous mapping on the active address space.
registry_check_range
Validates a range against the active address space.
registry_clear
Clears the active address space. Owned mappings are munmap’d.
registry_find
Finds a covering region in the active address space.
registry_install
Installs space as the active trap-path address space.
registry_is_active
True when the active space has at least one region.
registry_remove
Removes a range from the active address space.
registry_take
Takes the active address space, leaving an empty one installed.
registry_update_prot
Updates protection on a region in the active address space.
registry_with_active
Runs f with shared access to the active address space.
registry_with_active_mut
Runs f with exclusive access to the active address space.