summaryrefslogtreecommitdiff
path: root/na/mm/vma.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-05-02 23:33:11 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-05-02 23:33:11 +0800
commit11a6be89b6c75b31f29c86136d53aac5044da7a2 (patch)
tree0ca910710dea9169be608966b03ce5581926f797 /na/mm/vma.cc
parent6907a90418ba856ff9331e6b4ba5d26b76034c2d (diff)
downloadlume-11a6be89b6c75b31f29c86136d53aac5044da7a2.tar.gz
lume-11a6be89b6c75b31f29c86136d53aac5044da7a2.tar.xz
feat: refactor memory management and integrate memblock
- Updated physical memory management (PMM) to utilize memblock for memory layout and frame allocation. - Enhanced the virtual memory manager (VMM) to allocate the frame map from memblock, ensuring it starts at the correct virtual address without relocation. - Improved frame allocation and deallocation functions to handle physical addresses more consistently. - Adjusted the slab allocator to correctly convert between physical and virtual addresses. - Refined page fault handling to ensure proper frame allocation and address translation. - Streamlined the initialization process for PMM and VMM, ensuring a more robust setup of memory structures. Co-authored-by: Copilot <copilot@github.com>
Diffstat (limited to 'na/mm/vma.cc')
-rw-r--r--na/mm/vma.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/na/mm/vma.cc b/na/mm/vma.cc
index e27853e..02f92b0 100644
--- a/na/mm/vma.cc
+++ b/na/mm/vma.cc
@@ -158,7 +158,7 @@ int vmm_handle_page_fault(VmSpace* space, uint64 fault_addr, uint64 cause) {
Frame* f = pmm_alloc_frame();
if (!f) return -ENOMEM;
- uint64 pa = frame_to_pa(f);
+ uint64 pa = frame_to_pa(f).raw;
/* Translate MI permission flags to hardware PTE bits (MD layer) */
uint64 pte_perm = pmap::vm_perm_to_pte(vma->perm);