diff options
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r-- | src/core/memory.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 68a6b1ac2..a6b5f6c99 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -9,6 +9,8 @@ #include "common/common_types.h" #include "common/logging/log.h" #include "common/swap.h" +#include "core/arm/arm_interface.h" +#include "core/core.h" #include "core/hle/kernel/memory.h" #include "core/hle/kernel/process.h" #include "core/hle/lock.h" @@ -22,10 +24,17 @@ 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; + if (Core::System::GetInstance().IsPoweredOn()) { + Core::CPU().PageTableChanged(); + } +} + +PageTable* GetCurrentPageTable() { + return current_page_table; } static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { |