Report usage if callback "injection."

These are generally giving incorrect results, but it will help to know
what games are triggering it.
This commit is contained in:
Unknown W. Brackets
2014-01-26 18:41:42 -08:00
parent efa6640807
commit cb4e72058a
+10 -2
View File
@@ -3131,9 +3131,10 @@ void Thread::setReturnValue(u32 retval)
u32 callId = this->currentMipscallId; u32 callId = this->currentMipscallId;
MipsCall *call = mipsCalls.get(callId); MipsCall *call = mipsCalls.get(callId);
if (call) { if (call) {
ERROR_LOG_REPORT(SCEKERNEL, "Injecting return value into thread in callback");
call->setReturnValue(retval); call->setReturnValue(retval);
} else { } else {
ERROR_LOG(SCEKERNEL, "Failed to inject return value %08x in thread", retval); ERROR_LOG_REPORT(SCEKERNEL, "Failed to inject return value %08x in thread", retval);
} }
} else { } else {
currentMIPS->r[2] = retval; currentMIPS->r[2] = retval;
@@ -3150,9 +3151,10 @@ void Thread::setReturnValue(u64 retval)
u32 callId = this->currentMipscallId; u32 callId = this->currentMipscallId;
MipsCall *call = mipsCalls.get(callId); MipsCall *call = mipsCalls.get(callId);
if (call) { if (call) {
ERROR_LOG_REPORT(SCEKERNEL, "Injecting return value into thread in callback");
call->setReturnValue(retval); call->setReturnValue(retval);
} else { } else {
ERROR_LOG(SCEKERNEL, "Failed to inject return value %08llx in thread", retval); ERROR_LOG_REPORT(SCEKERNEL, "Failed to inject return value %08llx in thread", retval);
} }
} else { } else {
currentMIPS->r[2] = retval & 0xFFFFFFFF; currentMIPS->r[2] = retval & 0xFFFFFFFF;
@@ -3170,6 +3172,7 @@ void Thread::resumeFromWait()
ActionAfterMipsCall *action = getRunningCallbackAction(); ActionAfterMipsCall *action = getRunningCallbackAction();
if (action) if (action)
{ {
ERROR_LOG_REPORT(SCEKERNEL, "Injecting thread resume within callback, type %d", (int)action->waitType);
action->status &= ~THREADSTATUS_WAIT; action->status &= ~THREADSTATUS_WAIT;
if (!(action->status & (THREADSTATUS_WAITSUSPEND | THREADSTATUS_DORMANT | THREADSTATUS_DEAD))) if (!(action->status & (THREADSTATUS_WAITSUSPEND | THREADSTATUS_DORMANT | THREADSTATUS_DEAD)))
action->status = THREADSTATUS_READY; action->status = THREADSTATUS_READY;
@@ -3194,6 +3197,7 @@ bool Thread::isWaitingFor(WaitType type, int id)
ActionAfterMipsCall *action = getRunningCallbackAction(); ActionAfterMipsCall *action = getRunningCallbackAction();
if (action) if (action)
{ {
ERROR_LOG_REPORT(SCEKERNEL, "Checking wait status from within callback (incorrect result, type %d)", (int)action->waitType);
if (action->status & THREADSTATUS_WAIT) if (action->status & THREADSTATUS_WAIT)
return action->waitType == type && action->waitID == id; return action->waitType == type && action->waitID == id;
return false; return false;
@@ -3210,6 +3214,7 @@ int Thread::getWaitID(WaitType type)
ActionAfterMipsCall *action = getRunningCallbackAction(); ActionAfterMipsCall *action = getRunningCallbackAction();
if (action) if (action)
{ {
ERROR_LOG_REPORT(SCEKERNEL, "Checking wait id from within callback (incorrect result, type %d)", (int)action->waitType);
if (action->waitType == type) if (action->waitType == type)
return action->waitID; return action->waitID;
return 0; return 0;
@@ -3225,7 +3230,10 @@ ThreadWaitInfo Thread::getWaitInfo()
// Thread might be in a callback right now. // Thread might be in a callback right now.
ActionAfterMipsCall *action = getRunningCallbackAction(); ActionAfterMipsCall *action = getRunningCallbackAction();
if (action) if (action)
{
ERROR_LOG_REPORT(SCEKERNEL, "Checking wait info from within callback (incorrect result, type %d)", (int)action->waitType);
return action->waitInfo; return action->waitInfo;
}
return this->waitInfo; return this->waitInfo;
} }