mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-06 12:45:21 +02:00
Plumb through the PC value for syscalls, so we can get better diagnostics for unresolved ones.
This commit is contained in:
@@ -219,13 +219,20 @@ void Arm64JitBackend::CompIR_System(IRInst inst) {
|
||||
// Skip the CallSyscall where possible.
|
||||
{
|
||||
MIPSOpcode op(inst.constant);
|
||||
void *quickFunc = GetQuickSyscallFunc(op);
|
||||
if (quickFunc) {
|
||||
MOVP2R(X0, GetSyscallFuncPointer(op));
|
||||
QuickCallFunction(SCRATCH2_64, (const u8 *)quickFunc);
|
||||
const HLEFunction *func = GetSyscallFunctionData(op, 0);
|
||||
if (func) {
|
||||
void *quickFunc = GetQuickSyscallFunc(func, op);
|
||||
if (quickFunc) {
|
||||
MOVP2R(X0, func);
|
||||
QuickCallFunction(SCRATCH2_64, (const u8 *)quickFunc);
|
||||
} else {
|
||||
MOVI2R(W0, inst.constant);
|
||||
QuickCallFunction(SCRATCH2_64, &CallSyscall);
|
||||
}
|
||||
} else {
|
||||
MOVI2R(W0, inst.constant);
|
||||
QuickCallFunction(SCRATCH2_64, &CallSyscall);
|
||||
// Shouldn't get here.
|
||||
MOVI2R(W0, 0);
|
||||
QuickCallFunction(SCRATCH2_64, &CallSyscallUnresolvedAtPC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -235,6 +242,16 @@ void Arm64JitBackend::CompIR_System(IRInst inst) {
|
||||
// This is always followed by an ExitToPC, where we check coreState.
|
||||
break;
|
||||
|
||||
case IROp::SyscallUnresolved:
|
||||
FlushAll();
|
||||
SaveStaticRegisters();
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::SYSCALL);
|
||||
MOVI2R(W0, inst.constant);
|
||||
QuickCallFunction(SCRATCH2_64, &CallSyscallUnresolvedAtPC);
|
||||
WriteDebugProfilerStatus(IRProfilerStatus::IN_JIT);
|
||||
LoadStaticRegisters();
|
||||
break;
|
||||
|
||||
case IROp::CallReplacement:
|
||||
FlushAll();
|
||||
SaveStaticRegisters();
|
||||
|
||||
Reference in New Issue
Block a user