diff options
author | GPUCode <[email protected]> | 2023-11-23 11:26:06 +0200 |
---|---|---|
committer | t895 <[email protected]> | 2023-11-25 00:47:43 -0500 |
commit | 9ff8d0f3e652fee83d9f4374d9f6e0aa1759dd88 (patch) | |
tree | d3bf69c51eab1e4c56db1615ecf5193aa76badcc /src/core/arm | |
parent | d040b27a35fdf520b17fe6b1cd792058172c8ccc (diff) | |
download | yuzu-mainline-9ff8d0f3e652fee83d9f4374d9f6e0aa1759dd88.tar.gz yuzu-mainline-9ff8d0f3e652fee83d9f4374d9f6e0aa1759dd88.zip |
Address more review comments
Diffstat (limited to 'src/core/arm')
-rw-r--r-- | src/core/arm/nce/patch.cpp | 12 | ||||
-rw-r--r-- | src/core/arm/nce/patch.h | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/core/arm/nce/patch.cpp b/src/core/arm/nce/patch.cpp index 30c3c6cdd..a08859d0b 100644 --- a/src/core/arm/nce/patch.cpp +++ b/src/core/arm/nce/patch.cpp @@ -90,6 +90,10 @@ void Patcher::PatchText(const Kernel::PhysicalMemory& program_image, WriteMsrHandler(AddRelocations(), oaknut::XReg{static_cast<int>(msr.GetRt())}); continue; } + + if (auto exclusive = Exclusive{inst}; exclusive.Verify()) { + m_exclusives.push_back(i); + } } // Determine patching mode for the final relocation step @@ -163,11 +167,9 @@ void Patcher::RelocateAndCopy(Common::ProcessAddress load_base, // Cortex-A57 seems to treat all exclusives as ordered, but newer processors do not. // Convert to ordered to preserve this assumption. - for (u32 i = ModuleCodeIndex; i < static_cast<u32>(text_words.size()); i++) { - const u32 inst = text_words[i]; - if (auto exclusive = Exclusive{inst}; exclusive.Verify()) { - text_words[i] = exclusive.AsOrdered(); - } + for (const ModuleTextAddress i : m_exclusives) { + auto exclusive = Exclusive{text_words[i]}; + text_words[i] = exclusive.AsOrdered(); } // Copy to program image diff --git a/src/core/arm/nce/patch.h b/src/core/arm/nce/patch.h index dcce1bfc6..112f839a4 100644 --- a/src/core/arm/nce/patch.h +++ b/src/core/arm/nce/patch.h @@ -93,6 +93,7 @@ private: std::vector<Relocation> m_branch_to_patch_relocations{}; std::vector<Relocation> m_branch_to_module_relocations{}; std::vector<Relocation> m_write_module_pc_relocations{}; + std::vector<ModuleTextAddress> m_exclusives{}; oaknut::Label m_save_context{}; oaknut::Label m_load_context{}; PatchMode mode{PatchMode::None}; |