From 998a001fc621ca0e7560ca09a8acd29469ae3373 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 11 Dec 2025 17:46:02 +0100 Subject: docs: improve documentation --- arch/x86_64/src/memory/page_table.cpp | 18 +++++++++--------- arch/x86_64/src/memory/region_allocator.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'arch/x86_64/src') diff --git a/arch/x86_64/src/memory/page_table.cpp b/arch/x86_64/src/memory/page_table.cpp index e797b22..0e404e5 100644 --- a/arch/x86_64/src/memory/page_table.cpp +++ b/arch/x86_64/src/memory/page_table.cpp @@ -6,39 +6,39 @@ namespace teachos::memory::x86_64 { - auto page_table::entry::clear() -> void + auto page_table::entry::clear() noexcept -> void { m_raw = 0; } - auto page_table::entry::present() const -> bool + auto page_table::entry::present() const noexcept -> bool { return (all_flags() & flags::present) != flags::empty; } - auto page_table::entry::huge() const -> bool + auto page_table::entry::huge() const noexcept -> bool { return (all_flags() & flags::huge_page) != flags::empty; } - auto page_table::entry::all_flags() const -> flags + auto page_table::entry::all_flags() const noexcept -> flags { return std::bit_cast(m_raw & ~frame_number_mask); } - auto page_table::entry::all_flags(flags flags) -> void + auto page_table::entry::all_flags(flags flags) noexcept -> void { m_raw = (m_raw & ~frame_number_mask) | std::to_underlying(flags); } - auto page_table::entry::operator|=(flags rhs) -> page_table::entry & + auto page_table::entry::operator|=(flags rhs) noexcept -> page_table::entry & { auto raw_flags = std::to_underlying(rhs) & ~frame_number_mask; m_raw |= raw_flags; return *this; } - auto page_table::entry::frame() const -> std::optional + auto page_table::entry::frame() const noexcept -> std::optional { if (present()) { @@ -47,7 +47,7 @@ namespace teachos::memory::x86_64 return std::nullopt; } - auto page_table::entry::frame(struct frame frame, flags flags) -> void + auto page_table::entry::frame(struct frame frame, flags flags) noexcept -> void { m_raw = (frame.start_address().raw() | static_cast(flags)); }; @@ -62,7 +62,7 @@ namespace teachos::memory::x86_64 return m_entries.at(index); } - auto page_table::clear() -> void + auto page_table::clear() noexcept -> void { std::ranges::for_each(m_entries, &page_table::entry::clear); } diff --git a/arch/x86_64/src/memory/region_allocator.cpp b/arch/x86_64/src/memory/region_allocator.cpp index 8ea76c6..e477ec0 100644 --- a/arch/x86_64/src/memory/region_allocator.cpp +++ b/arch/x86_64/src/memory/region_allocator.cpp @@ -56,7 +56,7 @@ namespace teachos::memory::x86_64 } } - auto region_allocator::allocate() -> std::optional + auto region_allocator::allocate() noexcept -> std::optional { if (!m_current_region) { -- cgit v1.2.3