diff --git a/Source/Core/Core/HLE/HLE.cpp b/Source/Core/Core/HLE/HLE.cpp index 1707709f2d..5d7de6eccf 100644 --- a/Source/Core/Core/HLE/HLE.cpp +++ b/Source/Core/Core/HLE/HLE.cpp @@ -166,10 +166,10 @@ void Execute(const Core::CPUThreadGuard& guard, u32 current_pc, u32 hook_index) } } -void ExecuteFromJIT(u32 current_pc, u32 hook_index) +void ExecuteFromJIT(u32 current_pc, u32 hook_index, Core::System& system) { ASSERT(Core::IsCPUThread()); - Core::CPUThreadGuard guard(Core::System::GetInstance()); + Core::CPUThreadGuard guard(system); Execute(guard, current_pc, hook_index); } diff --git a/Source/Core/Core/HLE/HLE.h b/Source/Core/Core/HLE/HLE.h index a43ada5adf..3935ce4c5e 100644 --- a/Source/Core/Core/HLE/HLE.h +++ b/Source/Core/Core/HLE/HLE.h @@ -61,7 +61,7 @@ void Patch(Core::System& system, u32 pc, std::string_view func_name); u32 UnPatch(Core::System& system, std::string_view patch_name); u32 UnpatchRange(Core::System& system, u32 start_addr, u32 end_addr); void Execute(const Core::CPUThreadGuard& guard, u32 current_pc, u32 hook_index); -void ExecuteFromJIT(u32 current_pc, u32 hook_index); +void ExecuteFromJIT(u32 current_pc, u32 hook_index, Core::System& system); // Returns the HLE hook index of the address u32 GetHookByAddress(u32 address); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 83e99da156..4e8fa16889 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -396,7 +396,7 @@ void Jit64::HLEFunction(u32 hook_index) gpr.Flush(); fpr.Flush(); ABI_PushRegistersAndAdjustStack({}, 0); - ABI_CallFunctionCC(HLE::ExecuteFromJIT, js.compilerPC, hook_index); + ABI_CallFunctionCCP(HLE::ExecuteFromJIT, js.compilerPC, hook_index, &m_system); ABI_PopRegistersAndAdjustStack({}, 0); } diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 26e7ce2aeb..5d7e9b2831 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -248,7 +248,7 @@ void JitArm64::HLEFunction(u32 hook_index) gpr.Flush(FlushMode::All, ARM64Reg::INVALID_REG); fpr.Flush(FlushMode::All, ARM64Reg::INVALID_REG); - ABI_CallFunction(&HLE::ExecuteFromJIT, js.compilerPC, hook_index); + ABI_CallFunction(&HLE::ExecuteFromJIT, js.compilerPC, hook_index, &m_system); } void JitArm64::DoNothing(UGeckoInstruction inst)