mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-11 19:07:57 -05:00
Kernel: Store the program id in the Process class instead of the CodeSet class.
There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
This commit is contained in:
@ -15,7 +15,7 @@ static Memory::PageTable* page_table = nullptr;
|
||||
TestEnvironment::TestEnvironment(bool mutable_memory_)
|
||||
: mutable_memory(mutable_memory_), test_memory(std::make_shared<TestMemory>(this)) {
|
||||
|
||||
Kernel::g_current_process = Kernel::Process::Create("");
|
||||
Kernel::g_current_process = Kernel::Process::Create("", 0);
|
||||
page_table = &Kernel::g_current_process->vm_manager.page_table;
|
||||
|
||||
page_table->pointers.fill(nullptr);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory][!hide]") {
|
||||
SECTION("these regions should not be mapped on an empty process") {
|
||||
auto process = Kernel::Process::Create("");
|
||||
auto process = Kernel::Process::Create("", 0);
|
||||
CHECK(Memory::IsValidVirtualAddress(*process, Memory::PROCESS_IMAGE_VADDR) == false);
|
||||
CHECK(Memory::IsValidVirtualAddress(*process, Memory::HEAP_VADDR) == false);
|
||||
CHECK(Memory::IsValidVirtualAddress(*process, Memory::LINEAR_HEAP_VADDR) == false);
|
||||
@ -20,14 +20,14 @@ TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory][!hide]") {
|
||||
}
|
||||
|
||||
SECTION("CONFIG_MEMORY_VADDR and SHARED_PAGE_VADDR should be valid after mapping them") {
|
||||
auto process = Kernel::Process::Create("");
|
||||
auto process = Kernel::Process::Create("", 0);
|
||||
Kernel::MapSharedPages(process->vm_manager);
|
||||
CHECK(Memory::IsValidVirtualAddress(*process, Memory::CONFIG_MEMORY_VADDR) == true);
|
||||
CHECK(Memory::IsValidVirtualAddress(*process, Memory::SHARED_PAGE_VADDR) == true);
|
||||
}
|
||||
|
||||
SECTION("special regions should be valid after mapping them") {
|
||||
auto process = Kernel::Process::Create("");
|
||||
auto process = Kernel::Process::Create("", 0);
|
||||
SECTION("VRAM") {
|
||||
Kernel::HandleSpecialMapping(process->vm_manager,
|
||||
{Memory::VRAM_VADDR, Memory::VRAM_SIZE, false, false});
|
||||
@ -48,7 +48,7 @@ TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory][!hide]") {
|
||||
}
|
||||
|
||||
SECTION("Unmapping a VAddr should make it invalid") {
|
||||
auto process = Kernel::Process::Create("");
|
||||
auto process = Kernel::Process::Create("", 0);
|
||||
Kernel::MapSharedPages(process->vm_manager);
|
||||
process->vm_manager.UnmapRange(Memory::CONFIG_MEMORY_VADDR, Memory::CONFIG_MEMORY_SIZE);
|
||||
CHECK(Memory::IsValidVirtualAddress(*process, Memory::CONFIG_MEMORY_VADDR) == false);
|
||||
|
Reference in New Issue
Block a user