]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: make pmm.c fully architecture-independent
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 06:13:16 +0000 (03:13 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 06:13:16 +0000 (03:13 -0300)
commit96a10e4840e08ffc9a4765d77b55e3254888398d
tree0036df5459fe6661b1b8d3ee35ebaebbb84cbfa7
parent4e33eaa63e8b570289922afb6f3f3a7e0028ff38
refactor: make pmm.c fully architecture-independent

Extract all Multiboot2 x86-specific code from src/mm/pmm.c into
src/arch/x86/pmm_boot.c as pmm_arch_init().

Design:
- pmm.h now exposes pmm_mark_region(), pmm_set_limits(), pmm_arch_init()
- pmm_init() calls pmm_arch_init() (arch-specific) which discovers
  memory and calls pmm_set_limits() + pmm_mark_region()
- pmm.c provides a weak default pmm_arch_init() for archs without one
- Kernel protection uses hal_mm_virt_to_phys() (no #if MIPS/x86)
- x86 pmm_boot.c handles Multiboot2 parsing, module protection,
  and boot info protection
- Zero #if guards remain in pmm.c

Passes: make, cppcheck, QEMU smoke test.
include/pmm.h
src/arch/x86/pmm_boot.c [new file with mode: 0644]
src/mm/pmm.c