diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-05-13 15:59:13 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-05-13 15:59:13 +0800 |
| commit | a1ac35cf7195b73ffeab8bfd612af7b81f921b3b (patch) | |
| tree | 0a59724b54f9bf291db8033cf07b2f4e394f0eec | |
| parent | 45f944c52e592c0386d3cb44dcecdedb67a71ec2 (diff) | |
| download | lume-a1ac35cf7195b73ffeab8bfd612af7b81f921b3b.tar.gz lume-a1ac35cf7195b73ffeab8bfd612af7b81f921b3b.tar.xz | |
feat: update memblock to use page_map instead of frame_map in documentation and allocation functions
| -rw-r--r-- | na/include/lume/memblock.h | 6 | ||||
| -rw-r--r-- | na/mm/memblock.cc | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/na/include/lume/memblock.h b/na/include/lume/memblock.h index 41baf34..cb9a76b 100644 --- a/na/include/lume/memblock.h +++ b/na/include/lume/memblock.h @@ -11,12 +11,12 @@ * * Lifetime: * 1. memblock_init() — discovers RAM via FDT, reserves kernel image - * 2. vmm_init() — uses memblock_alloc for page table pages & frame_map + * 2. vmm_init() — uses memblock_alloc for page table pages & page_map * 3. pmm_init() — absorbs remaining free regions into buddy * 4. memblock_retire() — marks memblock inactive; all alloc via PMM * * This eliminates the need for post-init pointer relocation when - * rebinding frame_map to a VMEMMAP virtual address. + * rebinding page_map to a VMEMMAP virtual address. */ #include <lume/types.h> @@ -30,7 +30,7 @@ void memblock_init(uint64 fdt_paddr); void memblock_reserve(uint64 base, uint64 size); /* Allocate `size` bytes aligned to `align` from top of free memory. - * Returns PA, or 0 on failure. Used for frame_map. */ + * Returns PA, or 0 on failure. Used for page_map. */ uint64 memblock_alloc_top(uint64 size, uint64 align); /* Allocate `size` bytes aligned to `align` from bottom of free memory. diff --git a/na/mm/memblock.cc b/na/mm/memblock.cc index ac71472..4cd0b16 100644 --- a/na/mm/memblock.cc +++ b/na/mm/memblock.cc @@ -106,14 +106,14 @@ void memblock_init(uint64 fdt_paddr) /* 2. Reserve firmware region [mem_base, kernel_start). * OpenSBI occupies the first 2MB of RAM on RISC-V virt. */ - uint64 ks_pa = va_to_pa(virt_addr( + uint64 ks_pa = boot_va_to_pa(virt_addr( reinterpret_cast<uint64>(_stext))).raw; if (ks_pa > mem_base) { memblock_reserve(mem_base, ks_pa - mem_base); } /* 3. Reserve kernel image [_stext, _kernel_end) */ - uint64 ke_pa = va_to_pa(virt_addr( + uint64 ke_pa = boot_va_to_pa(virt_addr( reinterpret_cast<uint64>(_kernel_end))).raw; memblock_reserve(ks_pa, ke_pa - ks_pa); |
