aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-12-02 18:56:12 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-12-02 18:56:12 +0100
commit588fe1a3600475bdc312a4fe758d2f1125eb149c (patch)
tree3fb0655d67894b0a4ed7a7f87ab01d3c523978ca /arch/x86_64/include
parent331c070547634a2096c5e2165559fb0f11ee6330 (diff)
downloadteachos-588fe1a3600475bdc312a4fe758d2f1125eb149c.tar.xz
teachos-588fe1a3600475bdc312a4fe758d2f1125eb149c.zip
x86_64: basic code cleanup
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/x86_64/memory/page_table.hpp6
-rw-r--r--arch/x86_64/include/x86_64/memory/paging_root.hpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86_64/include/x86_64/memory/page_table.hpp b/arch/x86_64/include/x86_64/memory/page_table.hpp
index 6b8eb8c..c5102a2 100644
--- a/arch/x86_64/include/x86_64/memory/page_table.hpp
+++ b/arch/x86_64/include/x86_64/memory/page_table.hpp
@@ -16,9 +16,6 @@ namespace teachos::memory::x86_64
//! A table containing paging entries.
struct page_table
{
- //! The maximum number of entries in this table.
- constexpr auto static entry_count{512};
-
//! A single page table entry
struct entry
{
@@ -67,6 +64,9 @@ namespace teachos::memory::x86_64
std::uint64_t m_raw{};
};
+ //! The maximum number of entries in this table.
+ constexpr auto static entry_count{page::size / sizeof(entry)};
+
//! Get the entry at the given index.
[[nodiscard]] auto operator[](std::size_t index) -> entry &;
[[nodiscard]] auto operator[](std::size_t index) const -> entry const &;
diff --git a/arch/x86_64/include/x86_64/memory/paging_root.hpp b/arch/x86_64/include/x86_64/memory/paging_root.hpp
index e9b8eef..a9ab6a6 100644
--- a/arch/x86_64/include/x86_64/memory/paging_root.hpp
+++ b/arch/x86_64/include/x86_64/memory/paging_root.hpp
@@ -20,6 +20,8 @@ namespace teachos::memory::x86_64
auto operator=(paging_root const &) -> paging_root & = delete;
auto operator=(paging_root &&) -> paging_root & = delete;
+ ~paging_root() = delete;
+
[[nodiscard]] auto translate(linear_address address) const -> std::optional<physical_address>;
[[nodiscard]] auto translate(page page) const -> std::optional<frame>;