diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-22 09:22:04 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-22 09:22:04 +0000 |
| commit | ef22c9394534014dbda3e2a070df3d02a9fd041e (patch) | |
| tree | 1a551f74b2fdb07a142d55463aa047b75a510bf9 /arch/x86_64 | |
| parent | d42ef85dbc3786fb45b8b4625b3f07446f51390d (diff) | |
| download | teachos-ef22c9394534014dbda3e2a070df3d02a9fd041e.tar.xz teachos-ef22c9394534014dbda3e2a070df3d02a9fd041e.zip | |
Remove default initalization of member variables
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging/page_entry.hpp | 4 | ||||
| -rw-r--r-- | arch/x86_64/include/arch/memory/paging/page_mapper.hpp | 3 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/paging/page_table.cpp | 5 |
3 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86_64/include/arch/memory/paging/page_entry.hpp b/arch/x86_64/include/arch/memory/paging/page_entry.hpp index 73aa554..9ca5469 100644 --- a/arch/x86_64/include/arch/memory/paging/page_entry.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_entry.hpp @@ -85,8 +85,8 @@ namespace teachos::arch::memory::paging */ auto calculate_physical_address() const -> std::size_t; - std::bitset<64U> flags = {}; ///< Underlying bitset used to read the flags from. Bits 9 - 11 and 52 - 62 can be - ///< freely used for additional flags by the operating system. + std::bitset<64U> flags; ///< Underlying bitset used to read the flags from. Bits 9 - 11 and 52 - 62 can be + ///< freely used for additional flags by the operating system. }; } // namespace teachos::arch::memory::paging diff --git a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp index 4735c13..80f6eb4 100644 --- a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp @@ -79,8 +79,7 @@ namespace teachos::arch::memory::paging // There should now be an entry at the previously not existent index, therefore we can simply access it again. next_handle = current_handle.next_table(level_index); exception_handling::assert(next_handle.has_value(), "[Page mapper] Unable to create new entry into page table"); - - // TODO: Crashes here! + // TODO: Crashes when trying to access underlying entries array. next_handle.value().zero_entries(); } current_handle = next_handle.value(); diff --git a/arch/x86_64/src/memory/paging/page_table.cpp b/arch/x86_64/src/memory/paging/page_table.cpp index 5faad24..33d0b75 100644 --- a/arch/x86_64/src/memory/paging/page_table.cpp +++ b/arch/x86_64/src/memory/paging/page_table.cpp @@ -46,8 +46,8 @@ namespace teachos::arch::memory::paging */ auto next_table_address(std::size_t table_index) -> std::optional<std::size_t>; - entry entries[PAGE_TABLE_ENTRY_COUNT] = {}; ///< Entries containing addresses to page tables of a level below or - ///< actual virtual addresses for the level 1 page table. + entry entries[PAGE_TABLE_ENTRY_COUNT]; ///< Entries containing addresses to page tables of a level below or + ///< actual virtual addresses for the level 1 page table. }; auto page_table::zero_entries() -> void @@ -55,7 +55,6 @@ namespace teachos::arch::memory::paging constexpr size_t entry_amount = sizeof(entries) / sizeof(entries[0]); for (size_t i = 0; i < entry_amount; ++i) { - // TODO: Crashes when trying to access entry! auto entry = this->operator[](i); entry.set_unused(); } |
