mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-12 20:08:29 -05:00
kernel: Handle page table switching within MakeCurrentProcess()
Centralizes the page table switching to one spot, rather than making calling code deal with it everywhere.
This commit is contained in:
@ -17,7 +17,6 @@ TestEnvironment::TestEnvironment(bool mutable_memory_)
|
||||
: mutable_memory(mutable_memory_),
|
||||
test_memory(std::make_shared<TestMemory>(this)), kernel{Core::System::GetInstance()} {
|
||||
auto process = Kernel::Process::Create(Core::System::GetInstance(), "");
|
||||
kernel.MakeCurrentProcess(process.get());
|
||||
page_table = &process->VMManager().page_table;
|
||||
|
||||
std::fill(page_table->pointers.begin(), page_table->pointers.end(), nullptr);
|
||||
@ -28,7 +27,7 @@ TestEnvironment::TestEnvironment(bool mutable_memory_)
|
||||
Memory::MapIoRegion(*page_table, 0x00000000, 0x80000000, test_memory);
|
||||
Memory::MapIoRegion(*page_table, 0x80000000, 0x80000000, test_memory);
|
||||
|
||||
Memory::SetCurrentPageTable(page_table);
|
||||
kernel.MakeCurrentProcess(process.get());
|
||||
}
|
||||
|
||||
TestEnvironment::~TestEnvironment() {
|
||||
|
Reference in New Issue
Block a user