diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-23 13:42:32 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-23 13:42:32 +0000 |
| commit | 355993d16fcdb2d020d6f1ff02adfa191f8f4d48 (patch) | |
| tree | c13c80d51a0a08a67d013d1738f44589ddaca078 /arch/x86_64 | |
| parent | c373109b4912e857273c30b3ebd2d25296da85fe (diff) | |
| download | teachos-355993d16fcdb2d020d6f1ff02adfa191f8f4d48.tar.xz teachos-355993d16fcdb2d020d6f1ff02adfa191f8f4d48.zip | |
Initalize page table on first call
Diffstat (limited to 'arch/x86_64')
| -rw-r--r-- | arch/x86_64/src/memory/paging/page_mapper.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86_64/src/memory/paging/page_mapper.cpp b/arch/x86_64/src/memory/paging/page_mapper.cpp index 995f2c3..39b5e64 100644 --- a/arch/x86_64/src/memory/paging/page_mapper.cpp +++ b/arch/x86_64/src/memory/paging/page_mapper.cpp @@ -4,15 +4,11 @@ namespace teachos::arch::memory::paging { - namespace - { - static page_table * PAGE_TABLE_LEVEL_4_ADDRESS = boot::page_map_level_4; - } // namespace - auto create_or_get() -> page_table_handle { + static page_table * table = boot::page_map_level_4; // 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{PAGE_TABLE_LEVEL_4_ADDRESS, page_table_handle::LEVEL4}; + return page_table_handle{table, page_table_handle::LEVEL4}; } auto translate_page(virtual_page page) -> std::optional<allocator::physical_frame> |
