mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-09-07 16:54:28 +00:00
Completely avoid any form of nested interrupt processing.
This commit is contained in:
parent
55f5e3a41b
commit
c9b044aeaf
@ -935,13 +935,7 @@ void HandleInterrupt(powerpc_registers *r)
|
|||||||
if (int32(ReadMacInt32(XLM_IRQ_NEST)) > 0)
|
if (int32(ReadMacInt32(XLM_IRQ_NEST)) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Do nothing if there is no pending interrupt
|
// Update interrupt count
|
||||||
if (InterruptFlags == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Current interrupt nest level
|
|
||||||
static int interrupt_depth = 0;
|
|
||||||
++interrupt_depth;
|
|
||||||
#if EMUL_TIME_STATS
|
#if EMUL_TIME_STATS
|
||||||
interrupt_count++;
|
interrupt_count++;
|
||||||
#endif
|
#endif
|
||||||
@ -957,7 +951,7 @@ void HandleInterrupt(powerpc_registers *r)
|
|||||||
#if INTERRUPTS_IN_NATIVE_MODE
|
#if INTERRUPTS_IN_NATIVE_MODE
|
||||||
case MODE_NATIVE:
|
case MODE_NATIVE:
|
||||||
// 68k emulator inactive, in nanokernel?
|
// 68k emulator inactive, in nanokernel?
|
||||||
if (r->gpr[1] != KernelDataAddr && interrupt_depth == 1) {
|
if (r->gpr[1] != KernelDataAddr) {
|
||||||
|
|
||||||
// Prepare for 68k interrupt level 1
|
// Prepare for 68k interrupt level 1
|
||||||
WriteMacInt16(tswap32(kernel_data->v[0x67c >> 2]), 1);
|
WriteMacInt16(tswap32(kernel_data->v[0x67c >> 2]), 1);
|
||||||
@ -1015,9 +1009,6 @@ void HandleInterrupt(powerpc_registers *r)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are done with this interrupt
|
|
||||||
--interrupt_depth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_resource(void);
|
static void get_resource(void);
|
||||||
|
@ -454,10 +454,15 @@ bool powerpc_cpu::check_spcflags()
|
|||||||
#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);
|
||||||
|
static bool processing_interrupt = false;
|
||||||
|
if (!processing_interrupt) {
|
||||||
|
processing_interrupt = true;
|
||||||
powerpc_registers r;
|
powerpc_registers r;
|
||||||
powerpc_registers::interrupt_copy(r, regs);
|
powerpc_registers::interrupt_copy(r, regs);
|
||||||
HandleInterrupt(&r);
|
HandleInterrupt(&r);
|
||||||
powerpc_registers::interrupt_copy(regs, r);
|
powerpc_registers::interrupt_copy(regs, r);
|
||||||
|
processing_interrupt = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (spcflags().test(SPCFLAG_CPU_TRIGGER_INTERRUPT)) {
|
if (spcflags().test(SPCFLAG_CPU_TRIGGER_INTERRUPT)) {
|
||||||
spcflags().clear(SPCFLAG_CPU_TRIGGER_INTERRUPT);
|
spcflags().clear(SPCFLAG_CPU_TRIGGER_INTERRUPT);
|
||||||
|
Loading…
Reference in New Issue
Block a user