]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: extract generic VMM wrappers from x86 implementation to src/mm/vmm.c
authorTulio A M Mendes <[email protected]>
Thu, 12 Feb 2026 07:04:21 +0000 (04:04 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 02:44:55 +0000 (23:44 -0300)
commit98ac9a0ae1ea557fbe6044d97792e831111e5023
treed93a9e20ccdb0a1fe8b7f74d0838ef3c0f2ef743
parent497402d328dbc69eb47fcf1740e4379470e123b8
refactor: extract generic VMM wrappers from x86 implementation to src/mm/vmm.c

Moved vmm_protect_range(), vmm_as_activate(), and vmm_as_map_page()
from src/arch/x86/vmm.c to src/mm/vmm.c. These functions contain only
architecture-independent logic (looping over pages, delegating to HAL
for address space switching).

The x86-specific VMM code (PAE page table manipulation, recursive
mapping, CoW handling, address space create/destroy/clone) remains
in src/arch/x86/vmm.c where it belongs.

This ensures new architectures only need to implement the core
primitives (vmm_init, vmm_map_page, vmm_unmap_page, vmm_set_page_flags,
vmm_as_create_kernel_clone, vmm_as_destroy, vmm_as_clone_user,
vmm_as_clone_user_cow, vmm_handle_cow_fault) and get the wrapper
functions for free.
src/arch/x86/vmm.c
src/mm/vmm.c [new file with mode: 0644]