summaryrefslogtreecommitdiffstats
path: root/src/tests/core
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-09-27 00:29:06 +0200
committerSubv <subv2112@gmail.com>2017-09-27 00:29:06 +0200
commitc102e3ae282ae849667ae91f5f0213a80adf474f (patch)
tree5e75e55abf0d90e600a2dfda63466c278a1a5860 /src/tests/core
parentMemory: Allow IsValidVirtualAddress to be called with a specific process parameter. (diff)
downloadyuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.tar
yuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.tar.gz
yuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.tar.bz2
yuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.tar.lz
yuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.tar.xz
yuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.tar.zst
yuzu-c102e3ae282ae849667ae91f5f0213a80adf474f.zip
Diffstat (limited to 'src/tests/core')
-rw-r--r--src/tests/core/arm/arm_test_common.cpp22
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) {