Core/HLE/HLE: Remove global system accessor from ExecuteFromJIT()

We can just pass in our system instance via the ABI function helpers.
This commit is contained in:
Lioncache 2023-12-18 14:33:34 -05:00
parent f4277a901a
commit c0b7e9cd94
4 changed files with 5 additions and 5 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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)