Skip to content
Snippets Groups Projects
Commit 3bde97ea authored by Subv's avatar Subv
Browse files

Tests/VFP: Use a standalone pagetable for the TestEnvironment memory operations.

This fixes building the tests
parent f18a176b
No related branches found
No related tags found
No related merge requests found
...@@ -3,20 +3,30 @@ ...@@ -3,20 +3,30 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/core.h" #include "core/core.h"
#include "core/memory.h"
#include "core/memory_setup.h" #include "core/memory_setup.h"
#include "tests/core/arm/arm_test_common.h" #include "tests/core/arm/arm_test_common.h"
namespace ArmTests { namespace ArmTests {
static Memory::PageTable page_table;
TestEnvironment::TestEnvironment(bool mutable_memory_) TestEnvironment::TestEnvironment(bool mutable_memory_)
: mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) { : mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) {
Memory::MapIoRegion(0x00000000, 0x80000000, test_memory);
Memory::MapIoRegion(0x80000000, 0x80000000, test_memory); page_table.pointers.fill(nullptr);
page_table.attributes.fill(Memory::PageType::Unmapped);
page_table.cached_res_count.fill(0);
Memory::MapIoRegion(page_table, 0x00000000, 0x80000000, test_memory);
Memory::MapIoRegion(page_table, 0x80000000, 0x80000000, test_memory);
Memory::current_page_table = &page_table;
} }
TestEnvironment::~TestEnvironment() { TestEnvironment::~TestEnvironment() {
Memory::UnmapRegion(0x80000000, 0x80000000); Memory::UnmapRegion(page_table, 0x80000000, 0x80000000);
Memory::UnmapRegion(0x00000000, 0x80000000); Memory::UnmapRegion(page_table, 0x00000000, 0x80000000);
} }
void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) { void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment