diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/tests/core/arm/arm_test_common.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/tests/core/arm/arm_test_common.cpp b/src/tests/core/arm/arm_test_common.cpp index 1df6c5677..8384ce744 100644 --- a/src/tests/core/arm/arm_test_common.cpp +++ b/src/tests/core/arm/arm_test_common.cpp | |||
| @@ -3,20 +3,30 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/core.h" | 5 | #include "core/core.h" |
| 6 | #include "core/memory.h" | ||
| 6 | #include "core/memory_setup.h" | 7 | #include "core/memory_setup.h" |
| 7 | #include "tests/core/arm/arm_test_common.h" | 8 | #include "tests/core/arm/arm_test_common.h" |
| 8 | 9 | ||
| 9 | namespace ArmTests { | 10 | namespace ArmTests { |
| 10 | 11 | ||
| 12 | static Memory::PageTable page_table; | ||
| 13 | |||
| 11 | TestEnvironment::TestEnvironment(bool mutable_memory_) | 14 | TestEnvironment::TestEnvironment(bool mutable_memory_) |
| 12 | : mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) { | 15 | : mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) { |
| 13 | Memory::MapIoRegion(0x00000000, 0x80000000, test_memory); | 16 | |
| 14 | Memory::MapIoRegion(0x80000000, 0x80000000, test_memory); | 17 | page_table.pointers.fill(nullptr); |
| 18 | page_table.attributes.fill(Memory::PageType::Unmapped); | ||
| 19 | page_table.cached_res_count.fill(0); | ||
| 20 | |||
| 21 | Memory::MapIoRegion(page_table, 0x00000000, 0x80000000, test_memory); | ||
| 22 | Memory::MapIoRegion(page_table, 0x80000000, 0x80000000, test_memory); | ||
| 23 | |||
| 24 | Memory::current_page_table = &page_table; | ||
| 15 | } | 25 | } |
| 16 | 26 | ||
| 17 | TestEnvironment::~TestEnvironment() { | 27 | TestEnvironment::~TestEnvironment() { |
| 18 | Memory::UnmapRegion(0x80000000, 0x80000000); | 28 | Memory::UnmapRegion(page_table, 0x80000000, 0x80000000); |
| 19 | Memory::UnmapRegion(0x00000000, 0x80000000); | 29 | Memory::UnmapRegion(page_table, 0x00000000, 0x80000000); |
| 20 | } | 30 | } |
| 21 | 31 | ||
| 22 | void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) { | 32 | void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) { |