diff options
author | tech-ticks <techticksdev@gmail.com> | 2022-04-08 21:31:56 +0200 |
---|---|---|
committer | tech-ticks <techticksdev@gmail.com> | 2022-04-09 13:29:19 +0200 |
commit | 3b91d213b172a0f66ba421d4583f1bf1a3dbdca6 (patch) | |
tree | b6c7d389b3217543cf2b40794bb3c15934039166 /src/core/hle/kernel/k_page_table.cpp | |
parent | Merge pull request #8162 from german77/bombslinger (diff) | |
download | yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.tar yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.tar.gz yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.tar.bz2 yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.tar.lz yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.tar.xz yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.tar.zst yuzu-3b91d213b172a0f66ba421d4583f1bf1a3dbdca6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 599013cf6..47ea3c89c 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp @@ -346,7 +346,8 @@ ResultCode KPageTable::MapCodeMemory(VAddr dst_address, VAddr src_address, std:: return ResultSuccess; } -ResultCode KPageTable::UnmapCodeMemory(VAddr dst_address, VAddr src_address, std::size_t size) { +ResultCode KPageTable::UnmapCodeMemory(VAddr dst_address, VAddr src_address, std::size_t size, + ICacheInvalidationStrategy icache_invalidation_strategy) { // Validate the mapping request. R_UNLESS(this->CanContain(dst_address, size, KMemoryState::AliasCode), ResultInvalidMemoryRegion); @@ -396,7 +397,11 @@ ResultCode KPageTable::UnmapCodeMemory(VAddr dst_address, VAddr src_address, std bool reprotected_pages = false; SCOPE_EXIT({ if (reprotected_pages && any_code_pages) { - system.InvalidateCpuInstructionCacheRange(dst_address, size); + if (icache_invalidation_strategy == ICacheInvalidationStrategy::InvalidateRange) { + system.InvalidateCpuInstructionCacheRange(dst_address, size); + } else { + system.InvalidateCpuInstructionCaches(); + } } }); @@ -563,6 +568,8 @@ ResultCode KPageTable::UnmapProcessMemory(VAddr dst_addr, std::size_t size, block_manager->Update(dst_addr, num_pages, KMemoryState::Free, KMemoryPermission::None, KMemoryAttribute::None); + system.InvalidateCpuInstructionCaches(); + return ResultSuccess; } |