diff options
author | bunnei <bunneidev@gmail.com> | 2017-09-29 20:58:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-29 20:58:42 +0200 |
commit | b07af7dda822898e9c8f231c5ddcd1741d93dbef (patch) | |
tree | d41c9221d6065b8cf9e6a2405565b675a9c83c51 /src/tests/core/arm/arm_test_common.cpp | |
parent | Merge pull request #2907 from Subv/warnings3 (diff) | |
parent | Loaders: Don't automatically set the current process every time we load an application. (diff) | |
download | yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.gz yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.bz2 yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.lz yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.xz yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.tar.zst yuzu-b07af7dda822898e9c8f231c5ddcd1741d93dbef.zip |
Diffstat (limited to '')
-rw-r--r-- | src/tests/core/arm/arm_test_common.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp index cfe0d503a..484713a92 100644 --- a/src/tests/core/arm/arm_test_common.cpp +++ b/src/tests/core/arm/arm_test_common.cpp @@ -3,30 +3,34 @@ // Refer to the license.txt file included. #include "core/core.h" +#include "core/hle/kernel/process.h" #include "core/memory.h" #include "core/memory_setup.h" #include "tests/core/arm/arm_test_common.h" namespace ArmTests { -static Memory::PageTable page_table; +static Memory::PageTable* page_table = nullptr; TestEnvironment::TestEnvironment(bool mutable_memory_) : mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) { - page_table.pointers.fill(nullptr); - page_table.attributes.fill(Memory::PageType::Unmapped); - page_table.cached_res_count.fill(0); + Kernel::g_current_process = Kernel::Process::Create(Kernel::CodeSet::Create("", 0)); + page_table = &Kernel::g_current_process->vm_manager.page_table; - Memory::MapIoRegion(page_table, 0x00000000, 0x80000000, test_memory); - Memory::MapIoRegion(page_table, 0x80000000, 0x80000000, test_memory); + page_table->pointers.fill(nullptr); + page_table->attributes.fill(Memory::PageType::Unmapped); + page_table->cached_res_count.fill(0); - Memory::SetCurrentPageTable(&page_table); + Memory::MapIoRegion(*page_table, 0x00000000, 0x80000000, test_memory); + Memory::MapIoRegion(*page_table, 0x80000000, 0x80000000, test_memory); + + Memory::SetCurrentPageTable(page_table); } TestEnvironment::~TestEnvironment() { - Memory::UnmapRegion(page_table, 0x80000000, 0x80000000); - Memory::UnmapRegion(page_table, 0x00000000, 0x80000000); + Memory::UnmapRegion(*page_table, 0x80000000, 0x80000000); + Memory::UnmapRegion(*page_table, 0x00000000, 0x80000000); } void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) { |