summaryrefslogtreecommitdiff
path: root/src/core/arm/nce
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm/nce')
-rw-r--r--src/core/arm/nce/patch.cpp12
-rw-r--r--src/core/arm/nce/patch.h1
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,
90 WriteMsrHandler(AddRelocations(), oaknut::XReg{static_cast<int>(msr.GetRt())}); 90 WriteMsrHandler(AddRelocations(), oaknut::XReg{static_cast<int>(msr.GetRt())});
91 continue; 91 continue;
92 } 92 }
93
94 if (auto exclusive = Exclusive{inst}; exclusive.Verify()) {
95 m_exclusives.push_back(i);
96 }
93 } 97 }
94 98
95 // Determine patching mode for the final relocation step 99 // Determine patching mode for the final relocation step
@@ -163,11 +167,9 @@ void Patcher::RelocateAndCopy(Common::ProcessAddress load_base,
163 167
164 // Cortex-A57 seems to treat all exclusives as ordered, but newer processors do not. 168 // Cortex-A57 seems to treat all exclusives as ordered, but newer processors do not.
165 // Convert to ordered to preserve this assumption. 169 // Convert to ordered to preserve this assumption.
166 for (u32 i = ModuleCodeIndex; i < static_cast<u32>(text_words.size()); i++) { 170 for (const ModuleTextAddress i : m_exclusives) {
167 const u32 inst = text_words[i]; 171 auto exclusive = Exclusive{text_words[i]};
168 if (auto exclusive = Exclusive{inst}; exclusive.Verify()) { 172 text_words[i] = exclusive.AsOrdered();
169 text_words[i] = exclusive.AsOrdered();
170 }
171 } 173 }
172 174
173 // Copy to program image 175 // 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:
93 std::vector<Relocation> m_branch_to_patch_relocations{}; 93 std::vector<Relocation> m_branch_to_patch_relocations{};
94 std::vector<Relocation> m_branch_to_module_relocations{}; 94 std::vector<Relocation> m_branch_to_module_relocations{};
95 std::vector<Relocation> m_write_module_pc_relocations{}; 95 std::vector<Relocation> m_write_module_pc_relocations{};
96 std::vector<ModuleTextAddress> m_exclusives{};
96 oaknut::Label m_save_context{}; 97 oaknut::Label m_save_context{};
97 oaknut::Label m_load_context{}; 98 oaknut::Label m_load_context{};
98 PatchMode mode{PatchMode::None}; 99 PatchMode mode{PatchMode::None};