summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-26 13:09:12 -0500
committerGravatar Lioncash2019-11-26 21:53:34 -0500
commit323680e5ad3ca0e27f2dd1de26816741b3243bed (patch)
treeac7a9e683831493f0f14c8b9566c0d570807ad62 /src/tests
parentcore/memory: Introduce skeleton of Memory class (diff)
downloadyuzu-323680e5ad3ca0e27f2dd1de26816741b3243bed.tar.gz
yuzu-323680e5ad3ca0e27f2dd1de26816741b3243bed.tar.xz
yuzu-323680e5ad3ca0e27f2dd1de26816741b3243bed.zip
core/memory: Migrate over memory mapping functions to the new Memory class
Migrates all of the direct mapping facilities over to the new memory class. In the process, this also obsoletes the need for memory_setup.h, so we can remove it entirely from the project.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/core/arm/arm_test_common.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp
index ac7ae3e52..17043346b 100644
--- a/src/tests/core/arm/arm_test_common.cpp
+++ b/src/tests/core/arm/arm_test_common.cpp
@@ -8,7 +8,6 @@
8#include "core/core.h" 8#include "core/core.h"
9#include "core/hle/kernel/process.h" 9#include "core/hle/kernel/process.h"
10#include "core/memory.h" 10#include "core/memory.h"
11#include "core/memory_setup.h"
12#include "tests/core/arm/arm_test_common.h" 11#include "tests/core/arm/arm_test_common.h"
13 12
14namespace ArmTests { 13namespace ArmTests {
@@ -16,8 +15,9 @@ namespace ArmTests {
16TestEnvironment::TestEnvironment(bool mutable_memory_) 15TestEnvironment::TestEnvironment(bool mutable_memory_)
17 : mutable_memory(mutable_memory_), 16 : mutable_memory(mutable_memory_),
18 test_memory(std::make_shared<TestMemory>(this)), kernel{Core::System::GetInstance()} { 17 test_memory(std::make_shared<TestMemory>(this)), kernel{Core::System::GetInstance()} {
19 auto process = Kernel::Process::Create(Core::System::GetInstance(), "", 18 auto& system = Core::System::GetInstance();
20 Kernel::Process::ProcessType::Userland); 19
20 auto process = Kernel::Process::Create(system, "", Kernel::Process::ProcessType::Userland);
21 page_table = &process->VMManager().page_table; 21 page_table = &process->VMManager().page_table;
22 22
23 std::fill(page_table->pointers.begin(), page_table->pointers.end(), nullptr); 23 std::fill(page_table->pointers.begin(), page_table->pointers.end(), nullptr);
@@ -25,15 +25,16 @@ TestEnvironment::TestEnvironment(bool mutable_memory_)
25 std::fill(page_table->attributes.begin(), page_table->attributes.end(), 25 std::fill(page_table->attributes.begin(), page_table->attributes.end(),
26 Common::PageType::Unmapped); 26 Common::PageType::Unmapped);
27 27
28 Memory::MapIoRegion(*page_table, 0x00000000, 0x80000000, test_memory); 28 system.Memory().MapIoRegion(*page_table, 0x00000000, 0x80000000, test_memory);
29 Memory::MapIoRegion(*page_table, 0x80000000, 0x80000000, test_memory); 29 system.Memory().MapIoRegion(*page_table, 0x80000000, 0x80000000, test_memory);
30 30
31 kernel.MakeCurrentProcess(process.get()); 31 kernel.MakeCurrentProcess(process.get());
32} 32}
33 33
34TestEnvironment::~TestEnvironment() { 34TestEnvironment::~TestEnvironment() {
35 Memory::UnmapRegion(*page_table, 0x80000000, 0x80000000); 35 auto& system = Core::System::GetInstance();
36 Memory::UnmapRegion(*page_table, 0x00000000, 0x80000000); 36 system.Memory().UnmapRegion(*page_table, 0x80000000, 0x80000000);
37 system.Memory().UnmapRegion(*page_table, 0x00000000, 0x80000000);
37} 38}
38 39
39void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) { 40void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) {