Remove savedIdRegister/MIPS_CALL_ID.

We've never trusted it anyway, simpler without dealing with this stuff.
This commit is contained in:
Unknown W. Brackets 2014-06-22 11:29:47 -07:00
parent 756ad884ed
commit 8851fc1685
3 changed files with 6 additions and 14 deletions

View File

@ -150,7 +150,9 @@ public:
p.Do(savedRA);
p.Do(savedV0);
p.Do(savedV1);
p.Do(savedIdRegister);
// No longer used.
u32 legacySavedIdRegister = 0;
p.Do(legacySavedIdRegister);
}
NativeCallback nc;
@ -159,7 +161,6 @@ public:
u32 savedRA;
u32 savedV0;
u32 savedV1;
u32 savedIdRegister;
};
#if COMMON_LITTLE_ENDIAN
@ -944,7 +945,9 @@ void MipsCall::DoState(PointerWrap &p)
p.Do(cbId);
p.DoArray(args, ARRAY_SIZE(args));
p.Do(numArgs);
p.Do(savedIdRegister);
// No longer used.
u32 legacySavedIdRegister = 0;
p.Do(legacySavedIdRegister);
p.Do(savedRa);
p.Do(savedPc);
p.Do(savedV0);
@ -3356,16 +3359,12 @@ void __KernelExecuteMipsCallOnCurrentThread(u32 callId, bool reschedAfter)
call->savedRa = currentMIPS->r[MIPS_REG_RA];
call->savedV0 = currentMIPS->r[MIPS_REG_V0];
call->savedV1 = currentMIPS->r[MIPS_REG_V1];
call->savedIdRegister = currentMIPS->r[MIPS_REG_CALL_ID];
call->savedId = cur->currentMipscallId;
call->reschedAfter = reschedAfter;
// Set up the new state
currentMIPS->pc = call->entryPoint;
currentMIPS->r[MIPS_REG_RA] = __KernelMipsCallReturnAddress();
// We put this two places in case the game overwrites it.
// We may want it later to "inject" return values.
currentMIPS->r[MIPS_REG_CALL_ID] = callId;
cur->currentMipscallId = callId;
for (int i = 0; i < call->numArgs; i++) {
currentMIPS->r[MIPS_REG_A0 + i] = call->args[i];
@ -3388,9 +3387,6 @@ void __KernelReturnFromMipsCall()
}
u32 callId = cur->currentMipscallId;
if (currentMIPS->r[MIPS_REG_CALL_ID] != callId)
WARN_LOG_REPORT(SCEKERNEL, "__KernelReturnFromMipsCall(): s0 is %08x != %08x", currentMIPS->r[MIPS_REG_CALL_ID], callId);
MipsCall *call = mipsCalls.pop(callId);
// Value returned by the callback function
@ -3408,7 +3404,6 @@ void __KernelReturnFromMipsCall()
currentMIPS->r[MIPS_REG_RA] = call->savedRa;
currentMIPS->r[MIPS_REG_V0] = call->savedV0;
currentMIPS->r[MIPS_REG_V1] = call->savedV1;
currentMIPS->r[MIPS_REG_CALL_ID] = call->savedIdRegister;
cur->currentMipscallId = call->savedId;
if (call->cbId != 0)

View File

@ -251,7 +251,6 @@ struct MipsCall {
u32 args[6];
int numArgs;
Action *doAfter;
u32 savedIdRegister;
u32 savedRa;
u32 savedPc;
u32 savedV0;

View File

@ -63,8 +63,6 @@ enum MIPSGPReg
MIPS_REG_FP=30,
MIPS_REG_RA=31,
// ID for mipscall "callback" is stored here - from JPCSP
MIPS_REG_CALL_ID=MIPS_REG_S0,
MIPS_REG_INVALID=-1,
// Not real regs, just for convenience/jit mapping.