summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar B3n302017-09-25 08:29:32 +0200
committerGravatar GitHub2017-09-25 08:29:32 +0200
commitd881dee818e7e59b72cb11cea634eb70bdcd3d35 (patch)
tree4f9b241fb63b90647e2992e83d83de7d25bb5d42 /src/core/memory.cpp
parentMerge pull request #2951 from huwpascoe/perf-4 (diff)
parentARM_Interface: Implement PageTableChanged (diff)
downloadyuzu-d881dee818e7e59b72cb11cea634eb70bdcd3d35.tar.gz
yuzu-d881dee818e7e59b72cb11cea634eb70bdcd3d35.tar.xz
yuzu-d881dee818e7e59b72cb11cea634eb70bdcd3d35.zip
Merge pull request #2952 from MerryMage/page-tables
Switchable Page Tables
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp15
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 @@
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "common/logging/log.h" 10#include "common/logging/log.h"
11#include "common/swap.h" 11#include "common/swap.h"
12#include "core/arm/arm_interface.h"
13#include "core/core.h"
12#include "core/hle/kernel/memory.h" 14#include "core/hle/kernel/memory.h"
13#include "core/hle/kernel/process.h" 15#include "core/hle/kernel/process.h"
14#include "core/hle/lock.h" 16#include "core/hle/lock.h"
@@ -22,10 +24,17 @@ namespace Memory {
22static std::array<u8, Memory::VRAM_SIZE> vram; 24static std::array<u8, Memory::VRAM_SIZE> vram;
23static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; 25static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram;
24 26
25PageTable* current_page_table = nullptr; 27static PageTable* current_page_table = nullptr;
26 28
27std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { 29void SetCurrentPageTable(PageTable* page_table) {
28 return &current_page_table->pointers; 30 current_page_table = page_table;
31 if (Core::System::GetInstance().IsPoweredOn()) {
32 Core::CPU().PageTableChanged();
33 }
34}
35
36PageTable* GetCurrentPageTable() {
37 return current_page_table;
29} 38}
30 39
31static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { 40static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) {