diff options
| author | JosJuice <josjuice@gmail.com> | 2023-09-30 17:32:51 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-10-31 19:43:49 +0100 |
| commit | 899d61bc7dd093393aafcd88c4f072ff879228a7 (patch) | |
| tree | 188dda7a7167c194804b547af8ba7af9fe59eccd /Source/Core/Common/CodeBlock.h | |
| parent | 5e74a8b850d67bc44b0e41e2ec9f3220dfa811ac (diff) | |
Jit64: Recompile asm routines on cache clear
This is needed so that the checks added in the previous commit will be
reevaluated if the value of m_enable_dcache changes.
JitArm64 was already recompiling its asm routines on cache clear by
necessity. It doesn't have the same setup as Jit64 where the asm
routines are in a separate region, so clearing the JitArm64 cache
results in the asm routines being cleared too.
Diffstat (limited to 'Source/Core/Common/CodeBlock.h')
| -rw-r--r-- | Source/Core/Common/CodeBlock.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h index aa35d3b782..fbd4cdb00a 100644 --- a/Source/Core/Common/CodeBlock.h +++ b/Source/Core/Common/CodeBlock.h @@ -82,9 +82,14 @@ public: } bool IsInSpace(const u8* ptr) const { return ptr >= region && ptr < (region + region_size); } - // Cannot currently be undone. Will write protect the entire code region. - // Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()). - void WriteProtect() { Common::WriteProtectMemory(region, region_size, true); } + void WriteProtect(bool allow_execute) + { + Common::WriteProtectMemory(region, region_size, allow_execute); + } + void UnWriteProtect(bool allow_execute) + { + Common::UnWriteProtectMemory(region, region_size, allow_execute); + } void ResetCodePtr() { T::SetCodePtr(region, region + region_size); } size_t GetSpaceLeft() const { |
