]> 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)
commitda410fae2dd9ec058a02e2b1061fe03ae48b1ae9
treee3559920034cd16bb8b6a5d4a2f2e5781667b6db
parent96c9e11a833f9ac9c3c6062d33c4e6d91126ac4a
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]