From 43ddde5e30a0d71aa11025a5ae232cea83e7fbde Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 15 Dec 2025 16:28:16 +0100 Subject: kapi: remodel memory API to follow cio API --- arch/x86_64/src/kapi/memory.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'arch/x86_64/src/kapi/memory.cpp') diff --git a/arch/x86_64/src/kapi/memory.cpp b/arch/x86_64/src/kapi/memory.cpp index 748893a..abfb32e 100644 --- a/arch/x86_64/src/kapi/memory.cpp +++ b/arch/x86_64/src/kapi/memory.cpp @@ -21,19 +21,17 @@ #include #include +#include +#include #include #include +#include namespace teachos::memory { namespace { - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - auto constinit allocator = static_cast(nullptr); - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - auto constinit mapper = static_cast(nullptr); - constexpr auto static unused_page_address = linear_address{0x0000'7fff'cafe'faceuz}; constexpr auto static recursive_page_map_index = x86_64::page_table::entry_count - 2; @@ -152,25 +150,6 @@ namespace teachos::memory } // namespace - auto active_frame_allocator() -> frame_allocator & - { - if (!allocator) - { - system::panic("[x86_64] The frame allocator has not been set yet."); - } - - return *allocator; - } - - auto active_page_mapper() -> page_mapper & - { - if (!mapper) - { - system::panic("[x86_64] The page mapper has not been set you."); - } - return *mapper; - } - auto init() -> void { auto static constinit is_initialized = std::atomic_flag{}; -- cgit v1.2.3