示例#1
0
void __TriggerRunInterrupts(int type)
{
	// If interrupts aren't enabled, we run them later.
	if (interruptsEnabled && !inInterrupt)
	{
		if ((type & PSP_INTR_HLE) != 0)
			hleRunInterrupts();
		else if ((type & PSP_INTR_ALWAYS_RESCHED) != 0)
		{
			if (!__RunOnePendingInterrupt())
				__KernelSwitchOffThread("interrupt");
		}
		else
			__RunOnePendingInterrupt();
	}
}
示例#2
0
void __KernelReturnFromInterrupt()
{
    DEBUG_LOG(CPU, "Left interrupt handler at %08x", currentMIPS->pc);

    // This is what we just ran.
    PendingInterrupt pend = pendingInterrupts.front();
    pendingInterrupts.pop_front();

    intrHandlers[pend.intr]->handleResult(pend);
    inInterrupt = false;

    // Restore context after running the interrupt.
    intState.restore();
    // All should now be back to normal, including PC.

    // Alright, let's see if there's any more interrupts queued...
    if (!__RunOnePendingInterrupt())
    {
        // Otherwise, we reschedule when dispatch was enabled, or switch back otherwise.
        if (__KernelIsDispatchEnabled())
            __KernelReSchedule("return from interrupt");
        else
            __KernelSwitchToThread(threadBeforeInterrupt, "return from interrupt");
    }
}
示例#3
0
void __TriggerInterruptWithArg(PSPInterrupt intno, int subintr, int arg)
{
	intrHandlers[intno].queueUpWithArg(subintr, arg);
	DEBUG_LOG(HLE, "Triggering subinterrupts for interrupt %i sub %i with arg %i (%i in queue)", intno, subintr, arg, pendingInterrupts.size());
	if (!inInterrupt)
		__RunOnePendingInterrupt();
}
示例#4
0
inline void hleFinishSyscall(const HLEFunction &info)
{
	if ((hleAfterSyscall & HLE_AFTER_SKIP_DEADBEEF) == 0)
		SetDeadbeefRegs();

	if ((hleAfterSyscall & HLE_AFTER_CURRENT_CALLBACKS) != 0 && (hleAfterSyscall & HLE_AFTER_RESCHED_CALLBACKS) == 0)
		__KernelForceCallbacks();

	if ((hleAfterSyscall & HLE_AFTER_RUN_INTERRUPTS) != 0)
		__RunOnePendingInterrupt();

	if ((hleAfterSyscall & HLE_AFTER_RESCHED_CALLBACKS) != 0)
		__KernelReSchedule(true, hleAfterSyscallReschedReason);
	else if ((hleAfterSyscall & HLE_AFTER_RESCHED) != 0)
		__KernelReSchedule(hleAfterSyscallReschedReason);

	if ((hleAfterSyscall & HLE_AFTER_DEBUG_BREAK) != 0)
	{
		if (!hleExecuteDebugBreak(info))
		{
			// We'll do it next syscall.
			hleAfterSyscall = HLE_AFTER_DEBUG_BREAK;
			hleAfterSyscallReschedReason = 0;
			return;
		}
	}

	hleAfterSyscall = HLE_AFTER_NOTHING;
	hleAfterSyscallReschedReason = 0;
}
示例#5
0
void NullGPU::DrawSync(int mode)
{
	if (mode == 0)  // Wait for completion
	{
		__RunOnePendingInterrupt();
	}
}
示例#6
0
void __TriggerInterrupt(PSPInterrupt intno)
{
	intrHandlers[intno].queueUp();
	DEBUG_LOG(HLE, "Triggering subinterrupts for interrupt %i (%i in queue)", intno, pendingInterrupts.size());
	if (!inInterrupt)
		__RunOnePendingInterrupt();
}
void __TriggerRunInterrupts(int type)
{
	// If interrupts aren't enabled, we run them later.
	if (interruptsEnabled && !inInterrupt)
	{
		if ((type & PSP_INTR_HLE) != 0)
			hleRunInterrupts();
		else
			__RunOnePendingInterrupt();
	}
}
示例#8
0
void __TriggerRunInterrupts(int type)
{
    // If interrupts aren't enabled, we run them later.
    if (interruptsEnabled && !inInterrupt)
    {
        if ((type & PSP_INTR_HLE) != 0)
            hleRunInterrupts();
        else if ((type & PSP_INTR_ALWAYS_RESCHED) != 0)
        {
            // "Always" only means if dispatch is enabled.
            if (!__RunOnePendingInterrupt() && __KernelIsDispatchEnabled())
            {
                SceUID savedThread = __KernelGetCurThread();
                if (__KernelSwitchOffThread("interrupt"))
                    threadBeforeInterrupt = savedThread;
            }
        }
        else
            __RunOnePendingInterrupt();
    }
}
示例#9
0
void __KernelReturnFromInterrupt()
{
	DEBUG_LOG(CPU, "Left interrupt handler at %08x", currentMIPS->pc);
	inInterrupt = false;
	// Restore context after running the interrupt.
	intState.restore();
	// All should now be back to normal, including PC.

	// Alright, let's see if there's any more interrupts queued...

	if (!__RunOnePendingInterrupt())
	{
		// Hmmm...
		//__KernelReSchedule("return from interrupt");
	}
}
示例#10
0
void __KernelReturnFromInterrupt()
{
	DEBUG_LOG(CPU, "Left interrupt handler at %08x", currentMIPS->pc);

	// This is what we just ran.
	PendingInterrupt pend = pendingInterrupts.front();
	pendingInterrupts.pop_front();

	intrHandlers[pend.intr]->handleResult(pend);
	inInterrupt = false;

	// Restore context after running the interrupt.
	intState.restore();
	// All should now be back to normal, including PC.

	// Alright, let's see if there's any more interrupts queued...
	if (!__RunOnePendingInterrupt())
		__KernelReSchedule("return from interrupt");
}
示例#11
0
void __KernelReturnFromInterrupt()
{
	DEBUG_LOG(CPU, "Left interrupt handler at %08x", currentMIPS->pc);
	inInterrupt = false;

	// This is what we just ran.
	PendingInterrupt pend = pendingInterrupts.front();
	pendingInterrupts.pop_front();

	SubIntrHandler *handler = intrHandlers[pend.intr].get(pend.subintr);
	if (handler != NULL)
		handler->handleResult(currentMIPS->r[MIPS_REG_V0]);
	else
		ERROR_LOG(HLE, "Interrupt released itself?  Should not happen.");

	// Restore context after running the interrupt.
	intState.restore();
	// All should now be back to normal, including PC.

	// Alright, let's see if there's any more interrupts queued...
	if (!__RunOnePendingInterrupt())
		__KernelReSchedule("return from interrupt");
}