mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-10-07 12:56:21 +00:00
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:
parent
fd69df24f3
commit
ec8661f431
@ -451,6 +451,16 @@ void powerpc_registers::interrupt_copy(powerpc_registers &oregs, powerpc_registe
|
|||||||
|
|
||||||
bool powerpc_cpu::check_spcflags()
|
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
|
#ifdef SHEEPSHAVER
|
||||||
if (spcflags().test(SPCFLAG_CPU_HANDLE_INTERRUPT)) {
|
if (spcflags().test(SPCFLAG_CPU_HANDLE_INTERRUPT)) {
|
||||||
spcflags().clear(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);
|
spcflags().set(SPCFLAG_CPU_HANDLE_INTERRUPT);
|
||||||
}
|
}
|
||||||
#endif
|
#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)) {
|
if (spcflags().test(SPCFLAG_CPU_ENTER_MON)) {
|
||||||
spcflags().clear(SPCFLAG_CPU_ENTER_MON);
|
spcflags().clear(SPCFLAG_CPU_ENTER_MON);
|
||||||
#if ENABLE_MON
|
#if ENABLE_MON
|
||||||
|
Loading…
Reference in New Issue
Block a user