CoreTiming: wrap into class

This commit is contained in:
Weiyi Wang
2018-10-27 15:53:20 -04:00
parent 7c3d325aff
commit 9458e4d8ec
34 changed files with 413 additions and 413 deletions

View File

@@ -16,10 +16,10 @@ static Memory::PageTable* page_table = nullptr;
TestEnvironment::TestEnvironment(bool mutable_memory_)
: mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) {
CoreTiming::Init();
// HACK: some memory functions are currently referring kernel from the global instance,
// so we need to create the kernel object there.
// Change this when all global states are eliminated.
Core::System::GetInstance().timing = std::make_unique<Core::Timing>();
Core::System::GetInstance().kernel = std::make_unique<Kernel::KernelSystem>(0);
kernel = Core::System::GetInstance().kernel.get();
@@ -38,8 +38,6 @@ TestEnvironment::TestEnvironment(bool mutable_memory_)
TestEnvironment::~TestEnvironment() {
Memory::UnmapRegion(*page_table, 0x80000000, 0x80000000);
Memory::UnmapRegion(*page_table, 0x00000000, 0x80000000);
CoreTiming::Shutdown();
}
void TestEnvironment::SetMemory64(VAddr vaddr, u64 value) {