Fix a damn silly bug. On some occasions, we could have spcflags() set to

EXEC_RETURN | HANDLE_INTERRUPT. And then, we handled the interrupt, but
EXEC_RETURN was set so we returned very quickly without completing the
interrupt routine. As a side effect, this occasionnaly hung the emulator
most likely with {ethernet,audio}-based applications that trigger a lot
of interrupts.

The fix is to always honour EXEC_RETURN flag at first, of course.
This commit is contained in:
gbeauche 2005-06-30 15:29:11 +00:00
parent fd69df24f3
commit ec8661f431

View File

@ -451,6 +451,16 @@ void powerpc_registers::interrupt_copy(powerpc_registers &oregs, powerpc_registe
bool powerpc_cpu::check_spcflags()
{
if (spcflags().test(SPCFLAG_CPU_EXEC_RETURN)) {
spcflags().clear(SPCFLAG_CPU_EXEC_RETURN);
#ifndef SHEEPSHAVER
// FIXME: add unwind info to the translation cache? Otherwise
// we have to manually handle the exit syscall here
if (syscall_exit_code >= 0)
throw kernel_syscall_exit(syscall_exit_code);
#endif
return false;
}
#ifdef SHEEPSHAVER
if (spcflags().test(SPCFLAG_CPU_HANDLE_INTERRUPT)) {
spcflags().clear(SPCFLAG_CPU_HANDLE_INTERRUPT);
@ -469,16 +479,6 @@ bool powerpc_cpu::check_spcflags()
spcflags().set(SPCFLAG_CPU_HANDLE_INTERRUPT);
}
#endif
if (spcflags().test(SPCFLAG_CPU_EXEC_RETURN)) {
spcflags().clear(SPCFLAG_CPU_EXEC_RETURN);
#ifndef SHEEPSHAVER
// FIXME: add unwind info to the translation cache? Otherwise
// we have to manually handle the exit syscall here
if (syscall_exit_code >= 0)
throw kernel_syscall_exit(syscall_exit_code);
#endif
return false;
}
if (spcflags().test(SPCFLAG_CPU_ENTER_MON)) {
spcflags().clear(SPCFLAG_CPU_ENTER_MON);
#if ENABLE_MON