diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-21 12:37:36 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-21 12:37:36 +0000 |
| commit | 4b6e66f686a0341613a303b45e16e5bc744c32dd (patch) | |
| tree | c9e2a3a710de0eb661d599e328e97237fb9ac455 /arch/x86_64 | |
| parent | 72cb015567cb65527e9105e653c001be3c04eab5 (diff) | |
| download | teachos-4b6e66f686a0341613a303b45e16e5bc744c32dd.tar.xz teachos-4b6e66f686a0341613a303b45e16e5bc744c32dd.zip | |
Fix weird linker error
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/src/memory/paging/page_mapper.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86_64/src/memory/paging/page_mapper.cpp b/arch/x86_64/src/memory/paging/page_mapper.cpp index 01c39ca..28e248b 100644 --- a/arch/x86_64/src/memory/paging/page_mapper.cpp +++ b/arch/x86_64/src/memory/paging/page_mapper.cpp @@ -9,10 +9,9 @@ namespace teachos::arch::memory::paging auto create_or_get() -> page_table_handle { - static page_table_handle active_page{reinterpret_cast<page_table *>(PAGE_TABLE_LEVEL_4_ADDRESS), - page_table::LEVEL4}; - - return active_page; + static page_table * const active_page{reinterpret_cast<page_table *>(PAGE_TABLE_LEVEL_4_ADDRESS)}; + // We can not save page_table_handle as a static variable directly, if we do the program will fail to link. + return page_table_handle{active_page, page_table::LEVEL4}; } auto translate_page(virtual_page page) -> std::optional<allocator::physical_frame> |
