diff options
author | Fernando S <fsahmkow27@gmail.com> | 2023-12-06 14:19:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 14:19:17 +0100 |
commit | 8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a (patch) | |
tree | 265bf3c7970a570479c6a3ac1250549995f0329c /src/core/hle/kernel/k_page_table_base.cpp | |
parent | Merge pull request #12271 from liamwhite/pretext-fix (diff) | |
parent | arm: fix context save of vector regs (diff) | |
download | yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.gz yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.bz2 yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.lz yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.xz yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.zst yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.zip |
Diffstat (limited to 'src/core/hle/kernel/k_page_table_base.cpp')
-rw-r--r-- | src/core/hle/kernel/k_page_table_base.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_page_table_base.cpp b/src/core/hle/kernel/k_page_table_base.cpp index 6691586ed..4c416d809 100644 --- a/src/core/hle/kernel/k_page_table_base.cpp +++ b/src/core/hle/kernel/k_page_table_base.cpp @@ -69,8 +69,16 @@ public: }; template <typename AddressType> -void InvalidateInstructionCache(Core::System& system, AddressType addr, u64 size) { - system.InvalidateCpuInstructionCacheRange(GetInteger(addr), size); +void InvalidateInstructionCache(KernelCore& kernel, AddressType addr, u64 size) { + // TODO: lock the process list + for (auto& process : kernel.GetProcessList()) { + for (size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { + auto* interface = process->GetArmInterface(i); + if (interface) { + interface->InvalidateCacheRange(GetInteger(addr), size); + } + } + } } template <typename AddressType> @@ -1261,7 +1269,7 @@ Result KPageTableBase::UnmapCodeMemory(KProcessAddress dst_address, KProcessAddr bool reprotected_pages = false; SCOPE_EXIT({ if (reprotected_pages && any_code_pages) { - InvalidateInstructionCache(m_system, dst_address, size); + InvalidateInstructionCache(m_kernel, dst_address, size); } }); @@ -1997,7 +2005,7 @@ Result KPageTableBase::SetProcessMemoryPermission(KProcessAddress addr, size_t s for (const auto& block : pg) { StoreDataCache(GetHeapVirtualPointer(m_kernel, block.GetAddress()), block.GetSize()); } - InvalidateInstructionCache(m_system, addr, size); + InvalidateInstructionCache(m_kernel, addr, size); } R_SUCCEED(); @@ -3239,7 +3247,7 @@ Result KPageTableBase::WriteDebugMemory(KProcessAddress dst_address, KProcessAdd R_TRY(PerformCopy()); // Invalidate the instruction cache, as this svc allows modifying executable pages. - InvalidateInstructionCache(m_system, dst_address, size); + InvalidateInstructionCache(m_kernel, dst_address, size); R_SUCCEED(); } |