No need to manually decide pending or not for mipscalls.

This commit is contained in:
shenweip
2020-03-16 07:46:13 +08:00
parent 3ffb20b66b
commit 2f088d0970
3 changed files with 10 additions and 17 deletions
+5 -5
View File
@@ -3125,10 +3125,10 @@ void __KernelChangeThreadState(Thread *thread, ThreadStatus newStatus) {
static bool __CanExecuteCallbackNow(Thread *thread) {
return g_inCbCount == 0;
return currentCallbackThreadID == 0 && g_inCbCount == 0;
}
void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, const u32 args[], int numargs, bool reschedAfter, SceUID cbId, bool forcePending = false)
void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, const u32 args[], int numargs, bool reschedAfter, SceUID cbId)
{
if (!thread || thread->isStopped()) {
WARN_LOG_REPORT(SCEKERNEL, "Running mipscall on dormant thread");
@@ -3179,7 +3179,7 @@ void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, co
u32 callId = mipsCalls.add(call);
bool called = false;
if ((!thread || thread == __GetCurrentThread()) && !forcePending) {
if ((!thread || thread == __GetCurrentThread())) {
if (__CanExecuteCallbackNow(thread)) {
thread = __GetCurrentThread();
__KernelChangeThreadState(thread, THREADSTATUS_RUNNING);
@@ -3197,9 +3197,9 @@ void __KernelCallAddress(Thread *thread, u32 entryPoint, Action *afterAction, co
}
}
void __KernelDirectMipsCall(u32 entryPoint, Action *afterAction, u32 args[], int numargs, bool reschedAfter, bool forcePending)
void __KernelDirectMipsCall(u32 entryPoint, Action *afterAction, u32 args[], int numargs, bool reschedAfter)
{
__KernelCallAddress(__GetCurrentThread(), entryPoint, afterAction, args, numargs, reschedAfter, 0, forcePending);
__KernelCallAddress(__GetCurrentThread(), entryPoint, afterAction, args, numargs, reschedAfter, 0);
}
bool __KernelExecuteMipsCallOnCurrentThread(u32 callId, bool reschedAfter)