mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix some log semicolons that might affect logic.
But, these should all be right.
This commit is contained in:
parent
5db79dcf11
commit
0078faef8b
4 changed files with 40 additions and 51 deletions
|
@ -603,30 +603,26 @@ bool __KernelCheckResumeMsgPipeReceive(MsgPipe *m, MsgPipeWaitingThread &waitInf
|
|||
return true;
|
||||
}
|
||||
|
||||
void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId)
|
||||
{
|
||||
void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId) {
|
||||
u32 error;
|
||||
u32 waitValue = __KernelGetWaitValue(threadID, error);
|
||||
u32 timeoutPtr = __KernelGetWaitTimeoutPtr(threadID, error);
|
||||
SceUID uid = __KernelGetWaitID(threadID, WAITTYPE_MSGPIPE, error);
|
||||
MsgPipe *ko = uid == 0 ? NULL : kernelObjects.Get<MsgPipe>(uid, error);
|
||||
|
||||
if (ko == NULL)
|
||||
{
|
||||
if (ko == NULL) {
|
||||
ERROR_LOG_REPORT(SCEKERNEL, "__KernelMsgPipeEndCallback: Invalid object");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (waitValue)
|
||||
{
|
||||
switch (waitValue) {
|
||||
case MSGPIPE_WAIT_VALUE_SEND:
|
||||
{
|
||||
MsgPipeWaitingThread dummy;
|
||||
auto result = HLEKernel::WaitEndCallback<MsgPipe, WAITTYPE_MSGPIPE, MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeSend, dummy, ko->sendWaitingThreads, ko->pausedSendWaits);
|
||||
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT)
|
||||
DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Resuming wait from callback")
|
||||
else if (result == HLEKernel::WAIT_CB_TIMED_OUT)
|
||||
{
|
||||
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) {
|
||||
DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Resuming wait from callback");
|
||||
} else if (result == HLEKernel::WAIT_CB_TIMED_OUT) {
|
||||
// It was re-added to the the waiting threads list, but it timed out. Let's remove it.
|
||||
ko->RemoveSendWaitingThread(threadID);
|
||||
}
|
||||
|
@ -637,10 +633,9 @@ void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId)
|
|||
{
|
||||
MsgPipeWaitingThread dummy;
|
||||
auto result = HLEKernel::WaitEndCallback<MsgPipe, WAITTYPE_MSGPIPE, MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeReceive, dummy, ko->receiveWaitingThreads, ko->pausedReceiveWaits);
|
||||
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT)
|
||||
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Resuming wait from callback")
|
||||
else if (result == HLEKernel::WAIT_CB_TIMED_OUT)
|
||||
{
|
||||
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) {
|
||||
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Resuming wait from callback");
|
||||
} else if (result == HLEKernel::WAIT_CB_TIMED_OUT) {
|
||||
// It was re-added to the the waiting threads list, but it timed out. Let's remove it.
|
||||
ko->RemoveReceiveWaitingThread(threadID);
|
||||
}
|
||||
|
|
|
@ -2507,32 +2507,30 @@ int sceKernelChangeCurrentThreadAttr(u32 clearAttr, u32 setAttr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sceKernelChangeThreadPriority(SceUID threadID, int priority)
|
||||
{
|
||||
if (threadID == 0)
|
||||
int sceKernelChangeThreadPriority(SceUID threadID, int priority) {
|
||||
if (threadID == 0) {
|
||||
threadID = currentThread;
|
||||
}
|
||||
|
||||
// 0 means the current (running) thread's priority, not target's.
|
||||
if (priority == 0)
|
||||
{
|
||||
if (priority == 0) {
|
||||
Thread *cur = __GetCurrentThread();
|
||||
if (!cur)
|
||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): no current thread?", threadID, priority)
|
||||
else
|
||||
if (!cur) {
|
||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): no current thread?", threadID, priority);
|
||||
} else {
|
||||
priority = cur->nt.currentPriority;
|
||||
}
|
||||
}
|
||||
|
||||
u32 error;
|
||||
Thread *thread = kernelObjects.Get<Thread>(threadID, error);
|
||||
if (thread)
|
||||
{
|
||||
if (thread->isStopped())
|
||||
{
|
||||
if (thread) {
|
||||
if (thread->isStopped()) {
|
||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): thread is dormant", threadID, priority);
|
||||
return SCE_KERNEL_ERROR_DORMANT;
|
||||
}
|
||||
|
||||
if (priority < 0x08 || priority > 0x77)
|
||||
{
|
||||
if (priority < 0x08 || priority > 0x77) {
|
||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): bogus priority", threadID, priority);
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_PRIORITY;
|
||||
}
|
||||
|
@ -2544,17 +2542,17 @@ int sceKernelChangeThreadPriority(SceUID threadID, int priority)
|
|||
|
||||
thread->nt.currentPriority = priority;
|
||||
threadReadyQueue.prepare(thread->nt.currentPriority);
|
||||
if (thread->isRunning())
|
||||
if (thread->isRunning()) {
|
||||
thread->nt.status = (thread->nt.status & ~THREADSTATUS_RUNNING) | THREADSTATUS_READY;
|
||||
if (thread->isReady())
|
||||
}
|
||||
if (thread->isReady()) {
|
||||
threadReadyQueue.push_back(thread->nt.currentPriority, threadID);
|
||||
}
|
||||
|
||||
hleEatCycles(450);
|
||||
hleReSchedule("change thread priority");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ERROR_LOG(SCEKERNEL, "%08x=sceKernelChangeThreadPriority(%i, %i) failed - no such thread", error, threadID, priority);
|
||||
return error;
|
||||
}
|
||||
|
|
|
@ -398,8 +398,7 @@ void Jit::Comp_VBranch(MIPSOpcode op)
|
|||
}
|
||||
}
|
||||
|
||||
void Jit::Comp_Jump(MIPSOpcode op)
|
||||
{
|
||||
void Jit::Comp_Jump(MIPSOpcode op) {
|
||||
if (js.inDelaySlot) {
|
||||
ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart);
|
||||
return;
|
||||
|
@ -408,18 +407,17 @@ void Jit::Comp_Jump(MIPSOpcode op)
|
|||
u32 targetAddr = (js.compilerPC & 0xF0000000) | off;
|
||||
|
||||
// Might be a stubbed address or something?
|
||||
if (!Memory::IsValidAddress(targetAddr))
|
||||
{
|
||||
if (js.nextExit == 0)
|
||||
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr)
|
||||
else
|
||||
if (!Memory::IsValidAddress(targetAddr)) {
|
||||
if (js.nextExit == 0) {
|
||||
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr);
|
||||
} else {
|
||||
js.compiling = false;
|
||||
}
|
||||
// TODO: Mark this block dirty or something? May be indication it will be changed by imports.
|
||||
return;
|
||||
}
|
||||
|
||||
switch (op >> 26)
|
||||
{
|
||||
switch (op >> 26) {
|
||||
case 2: //j
|
||||
CompileDelaySlot(DELAYSLOT_NICE);
|
||||
if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions) {
|
||||
|
|
|
@ -516,8 +516,7 @@ void Jit::Comp_VBranch(MIPSOpcode op)
|
|||
}
|
||||
}
|
||||
|
||||
void Jit::Comp_Jump(MIPSOpcode op)
|
||||
{
|
||||
void Jit::Comp_Jump(MIPSOpcode op) {
|
||||
CONDITIONAL_LOG;
|
||||
if (js.inDelaySlot) {
|
||||
ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart);
|
||||
|
@ -527,18 +526,17 @@ void Jit::Comp_Jump(MIPSOpcode op)
|
|||
u32 targetAddr = (js.compilerPC & 0xF0000000) | off;
|
||||
|
||||
// Might be a stubbed address or something?
|
||||
if (!Memory::IsValidAddress(targetAddr))
|
||||
{
|
||||
if (js.nextExit == 0)
|
||||
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr)
|
||||
else
|
||||
if (!Memory::IsValidAddress(targetAddr)) {
|
||||
if (js.nextExit == 0) {
|
||||
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr);
|
||||
} else {
|
||||
js.compiling = false;
|
||||
}
|
||||
// TODO: Mark this block dirty or something? May be indication it will be changed by imports.
|
||||
return;
|
||||
}
|
||||
|
||||
switch (op >> 26)
|
||||
{
|
||||
switch (op >> 26) {
|
||||
case 2: //j
|
||||
CompileDelaySlot(DELAYSLOT_NICE);
|
||||
if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions)
|
||||
|
|
Loading…
Add table
Reference in a new issue