diff options
| author | Fabian Imhof <fabian.imhof@ost.ch> | 2024-10-20 08:13:40 +0000 |
|---|---|---|
| committer | Fabian Imhof <fabian.imhof@ost.ch> | 2024-10-20 08:13:40 +0000 |
| commit | 7bfa4740598ed8ffe1012e6683f9d814400ba1ca (patch) | |
| tree | 19a3a65bf3f2e53403044bfd0496b33d96ca9009 /arch/x86_64 | |
| parent | 5b5e8dec97f6f619faa13ee813df21837fe83a57 (diff) | |
| parent | 89ad7a0b60ce74c70fc3865e0967c601a6050674 (diff) | |
| download | teachos-7bfa4740598ed8ffe1012e6683f9d814400ba1ca.tar.xz teachos-7bfa4740598ed8ffe1012e6683f9d814400ba1ca.zip | |
Merge branch 'feat_memory_manager' of ssh://gitlab.ost.ch:45022/teachos/kernel into feat_memory_manager
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/src/memory/paging/page_table.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86_64/src/memory/paging/page_table.cpp b/arch/x86_64/src/memory/paging/page_table.cpp index 3c4f6d8..ab7331a 100644 --- a/arch/x86_64/src/memory/paging/page_table.cpp +++ b/arch/x86_64/src/memory/paging/page_table.cpp @@ -26,8 +26,13 @@ namespace teachos::arch::memory::paging exception_handling::assert(current_level != LEVEL1, "[Page Table] Attempted to call next_table on level 1 page table"); auto address = next_table_address(table_index); - current_table = reinterpret_cast<table_content *>(address.value()); - current_level = static_cast<level>(current_level - 1U); + bool const success = address.has_value(); + if (success) + { + current_table = reinterpret_cast<table_content *>(address.value()); + current_level = static_cast<level>(current_level - 1U); + } + return success; } auto page_table::operator[](std::size_t index) -> entry & @@ -47,7 +52,6 @@ namespace teachos::arch::memory::paging std::size_t const table_address = reinterpret_cast<std::size_t>(current_table); return ((table_address << 9) | (table_index << 12)); } - // TODO: Implement behaviour for huge pages currently not done return std::nullopt; } } // namespace teachos::arch::memory::paging |
