Expand description
Memory-management syscall handlers: mmap, munmap, brk.
Implements:
sys_mmap– map anonymous virtual memory (SYS_MMAP = 100)sys_munmap– unmap a virtual memory range (SYS_MUNMAP = 101)sys_brk– set / query the program break / heap top (SYS_BRK = 102)sys_mremap– resize/remap an existing region (SYS_MREMAP = 103)sys_mprotect– change page permissions (SYS_MPROTECT = 104)
Constants§
- BRK_
BASE - Base virtual address for the heap (
brk-managed region). - MAP_
ANONYMOUS 🔒 - MAP_
FIXED 🔒 - MAP_
FIXED_ 🔒NOREPLACE - MAP_
HUGETLB 🔒 - MAP_
PRIVATE 🔒 - MAP_
SHARED 🔒 - MMAP_
BASE - Initial hint address for anonymous
mmapallocations. - MREMAP_
MAYMOVE 🔒 - PROT_
EXEC 🔒 - PROT_
READ 🔒 - PROT_
WRITE 🔒 - USER_
SPACE_ 🔒END - Exclusive upper bound of the canonical user-space address range.
Functions§
- huge_
page_ 🔒align_ up - Round
addrup to the nearest 2 MiB boundary. - page_
align_ 🔒up - Round
addrup to the nearest 4 KiB page boundary. - prot_
to_ 🔒vma_ flags - Convert POSIX protection flags to
VmaFlags. - sys_brk
- SYS_BRK (102): set or query the program break (top of heap).
- sys_
mem_ region_ export - SYS_MEM_REGION_EXPORT (105): export a tracked region as a public handle.
- sys_
mem_ region_ info - SYS_MEM_REGION_INFO (107): query metadata about an exported region.
- sys_
mem_ region_ map - SYS_MEM_REGION_MAP (106): map an exported region into the caller.
- sys_
mmap - SYS_MMAP (100): map anonymous virtual memory.
- sys_
mprotect - SYS_MPROTECT (104): change permissions in an existing mapping range.
- sys_
mremap - SYS_MREMAP (103): resize an existing mapping.
- sys_
munmap - SYS_MUNMAP (101): unmap a virtual memory range.
- vma_
flags_ 🔒to_ prot - Convert
VmaFlagsinto ABI protection bits.