diff options
| author | 2017-09-24 22:42:42 +0100 | |
|---|---|---|
| committer | 2017-09-24 22:42:42 +0100 | |
| commit | c02bbb7030efd072511bd0051a44d9e503016f74 (patch) | |
| tree | cf830eadae6493ee83b7de8b44c10c89d668b5ca /src/core/memory.cpp | |
| parent | Merge pull request #2921 from jroweboy/batch-fix-2 (diff) | |
| download | yuzu-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.cpp | 10 |
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 { | |||
| 22 | static std::array<u8, Memory::VRAM_SIZE> vram; | 22 | static std::array<u8, Memory::VRAM_SIZE> vram; |
| 23 | static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; | 23 | static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; |
| 24 | 24 | ||
| 25 | PageTable* current_page_table = nullptr; | 25 | static PageTable* current_page_table = nullptr; |
| 26 | 26 | ||
| 27 | std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { | 27 | std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { |
| 28 | return ¤t_page_table->pointers; | 28 | return ¤t_page_table->pointers; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | void SetCurrentPageTable(PageTable* page_table) { | ||
| 32 | current_page_table = page_table; | ||
| 33 | } | ||
| 34 | |||
| 35 | PageTable* GetCurrentPageTable() { | ||
| 36 | return current_page_table; | ||
| 37 | } | ||
| 38 | |||
| 31 | static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { | 39 | static 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); |