1
0
Fork 0
forked from suyu/suyu

service/ldr: Deduplicate instruction cache clearing code in LoadNro()

We don't need to specify all of the ARM interfaces explicitly.
This commit is contained in:
Lioncash 2018-12-05 00:32:53 -05:00
parent d08d4a366b
commit 7c9b194d63

View file

@ -335,10 +335,7 @@ public:
vm_manager.ReprotectRange(*map_address + header.rw_offset, header.rw_size, vm_manager.ReprotectRange(*map_address + header.rw_offset, header.rw_size,
Kernel::VMAPermission::ReadWrite); Kernel::VMAPermission::ReadWrite);
Core::System::GetInstance().ArmInterface(0).ClearInstructionCache(); Core::System::GetInstance().InvalidateCpuInstructionCaches();
Core::System::GetInstance().ArmInterface(1).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(2).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(3).ClearInstructionCache();
nro.insert_or_assign(*map_address, NROInfo{hash, nro_size + bss_size}); nro.insert_or_assign(*map_address, NROInfo{hash, nro_size + bss_size});
@ -391,10 +388,7 @@ public:
Kernel::MemoryState::ModuleCodeStatic) == RESULT_SUCCESS); Kernel::MemoryState::ModuleCodeStatic) == RESULT_SUCCESS);
ASSERT(process->UnmapMemory(mapped_addr, 0, nro_size) == RESULT_SUCCESS); ASSERT(process->UnmapMemory(mapped_addr, 0, nro_size) == RESULT_SUCCESS);
Core::System::GetInstance().ArmInterface(0).ClearInstructionCache(); Core::System::GetInstance().InvalidateCpuInstructionCaches();
Core::System::GetInstance().ArmInterface(1).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(2).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(3).ClearInstructionCache();
nro.erase(iter); nro.erase(iter);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};