diff options
author | MerryMage <MerryMage@users.noreply.github.com> | 2017-09-24 22:42:42 +0100 |
---|---|---|
committer | MerryMage <MerryMage@users.noreply.github.com> | 2017-09-24 22:42:42 +0100 |
commit | c02bbb7030efd072511bd0051a44d9e503016f74 (patch) | |
tree | cf830eadae6493ee83b7de8b44c10c89d668b5ca /src/core/memory.cpp | |
parent | 93930a966f7ed208ecd31b05ec2094d0c820ee38 (diff) |
memory: Add GetCurrentPageTable/SetCurrentPageTable
Don't expose Memory::current_page_table as a global.
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r-- | src/core/memory.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 68a6b1ac26..17fa10b499 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -22,12 +22,20 @@ namespace Memory { static std::array<u8, Memory::VRAM_SIZE> vram; static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; -PageTable* current_page_table = nullptr; +static PageTable* current_page_table = nullptr; std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { return ¤t_page_table->pointers; } +void SetCurrentPageTable(PageTable* page_table) { + current_page_table = page_table; +} + +PageTable* GetCurrentPageTable() { + return current_page_table; +} + static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE, (base + size) * PAGE_SIZE); |