diff options
Diffstat (limited to 'arch/x86_64/src/kapi')
| -rw-r--r-- | arch/x86_64/src/kapi/memory.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
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 <atomic> #include <bit> +#include <cstddef> +#include <cstdint> #include <memory> #include <span> +#include <utility> namespace teachos::memory { namespace { - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - auto constinit allocator = static_cast<frame_allocator *>(nullptr); - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - auto constinit mapper = static_cast<page_mapper *>(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{}; |
