aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/kapi
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-01-16 13:41:46 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-01-16 13:41:46 +0100
commit086c5439f27d803ea84445f81f7a0006681dc585 (patch)
tree5d86e41656d6043fb5465b16de451b8f0b227d9d /arch/x86_64/kapi
parent7d6f0ed063790042a808f4bf07c50d308b3f2de4 (diff)
downloadteachos-086c5439f27d803ea84445f81f7a0006681dc585.tar.xz
teachos-086c5439f27d803ea84445f81f7a0006681dc585.zip
kapi/memory: move buffered allocator
Diffstat (limited to 'arch/x86_64/kapi')
-rw-r--r--arch/x86_64/kapi/memory.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86_64/kapi/memory.cpp b/arch/x86_64/kapi/memory.cpp
index e366ee1..b71fa17 100644
--- a/arch/x86_64/kapi/memory.cpp
+++ b/arch/x86_64/kapi/memory.cpp
@@ -1,12 +1,12 @@
#include "kapi/memory.hpp"
#include "kapi/boot.hpp"
+#include "kapi/memory/buffered_allocator.hpp"
#include "kapi/system.hpp"
#include "arch/boot/boot.hpp"
#include "arch/boot/ld.hpp"
#include "arch/cpu/registers.hpp"
-#include "arch/memory/buffered_allocator.hpp"
#include "arch/memory/kernel_mapper.hpp"
#include "arch/memory/mmu.hpp"
#include "arch/memory/page_table.hpp"
@@ -151,7 +151,7 @@ namespace kapi::memory
}
auto constinit region_based_allocator = std::optional<arch::memory::region_allocator>{};
- auto constinit buffered_allocator = std::optional<arch::memory::buffered_allocator<4>>{};
+ auto constinit allocation_buffer = std::optional<buffered_allocator<4>>{};
auto constinit recursive_page_mapper = std::optional<arch::memory::recursive_page_mapper>{};
} // namespace
@@ -170,12 +170,12 @@ namespace kapi::memory
enable_cpu_protections();
region_based_allocator.emplace(collect_memory_information());
- buffered_allocator.emplace(&*region_based_allocator);
- recursive_page_mapper.emplace(*buffered_allocator);
+ allocation_buffer.emplace(&*region_based_allocator);
+ recursive_page_mapper.emplace(*allocation_buffer);
kstd::println("[x86_64:MEM] Preparing new paging hierarchy.");
- auto new_pml4_frame = inject_faux_pml4(*buffered_allocator, *recursive_page_mapper);
+ auto new_pml4_frame = inject_faux_pml4(*allocation_buffer, *recursive_page_mapper);
remap_kernel(*recursive_page_mapper);
remap_vga_text_mode_buffer(*recursive_page_mapper);
@@ -187,7 +187,7 @@ namespace kapi::memory
cr3.frame(new_pml4_frame);
arch::cpu::cr3::write(cr3);
- set_frame_allocator(*buffered_allocator);
+ set_frame_allocator(*allocation_buffer);
set_page_mapper(*recursive_page_mapper);
}