From 48213aa5eba7dfa4c0c0b3bd676efdb7fea4fa14 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sat, 5 Mar 2005 18:33:30 +0000 Subject: [PATCH] Revert to no nested native ppc interrupt processing, also filter out cases where InterruptFlags is 0. --- SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp b/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp index 2000eacc..f48eadaa 100644 --- a/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp +++ b/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp @@ -929,7 +929,13 @@ void HandleInterrupt(powerpc_registers *r) if (int32(ReadMacInt32(XLM_IRQ_NEST)) > 0) return; - // Increment interrupt counter + // Do nothing if there is no pending interrupt + if (InterruptFlags == 0) + return; + + // Current interrupt nest level + static int interrupt_depth = 0; + ++interrupt_depth; #if EMUL_TIME_STATS interrupt_count++; #endif @@ -945,7 +951,7 @@ void HandleInterrupt(powerpc_registers *r) #if INTERRUPTS_IN_NATIVE_MODE case MODE_NATIVE: // 68k emulator inactive, in nanokernel? - if (r->gpr[1] != KernelDataAddr) { + if (r->gpr[1] != KernelDataAddr && interrupt_depth == 1) { // Prepare for 68k interrupt level 1 WriteMacInt16(tswap32(kernel_data->v[0x67c >> 2]), 1); @@ -1003,6 +1009,9 @@ void HandleInterrupt(powerpc_registers *r) break; #endif } + + // We are done with this interrupt + --interrupt_depth; } static void get_resource(void);