summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar MerryMage2017-09-24 22:42:42 +0100
committerGravatar MerryMage2017-09-24 22:42:42 +0100
commitc02bbb7030efd072511bd0051a44d9e503016f74 (patch)
treecf830eadae6493ee83b7de8b44c10c89d668b5ca /src/core/memory.cpp
parentMerge pull request #2921 from jroweboy/batch-fix-2 (diff)
downloadyuzu-c02bbb7030efd072511bd0051a44d9e503016f74.tar.gz
yuzu-c02bbb7030efd072511bd0051a44d9e503016f74.tar.xz
yuzu-c02bbb7030efd072511bd0051a44d9e503016f74.zip
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.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 68a6b1ac2..17fa10b49 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -22,12 +22,20 @@ namespace Memory {
22static std::array<u8, Memory::VRAM_SIZE> vram; 22static std::array<u8, Memory::VRAM_SIZE> vram;
23static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; 23static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram;
24 24
25PageTable* current_page_table = nullptr; 25static PageTable* current_page_table = nullptr;
26 26
27std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { 27std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() {
28 return &current_page_table->pointers; 28 return &current_page_table->pointers;
29} 29}
30 30
31void SetCurrentPageTable(PageTable* page_table) {
32 current_page_table = page_table;
33}
34
35PageTable* GetCurrentPageTable() {
36 return current_page_table;
37}
38
31static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { 39static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) {
32 LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE, 40 LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE,
33 (base + size) * PAGE_SIZE); 41 (base + size) * PAGE_SIZE);