diff options
Diffstat (limited to 'src/core/arm/nce/patch.cpp')
| -rw-r--r-- | src/core/arm/nce/patch.cpp | 12 |
1 files changed, 7 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 |