ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp
(Generate patch)

Comparing SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp (file contents):
Revision 1.35 by gbeauche, 2004-04-22T22:54:47Z vs.
Revision 1.36 by gbeauche, 2004-05-12T15:54:23Z

# Line 86 | Line 86 | const uint32 POWERPC_EXEC_RETURN = POWER
86   // Enable multicore (main/interrupts) cpu emulation?
87   #define MULTICORE_CPU (ASYNC_IRQ ? 1 : 0)
88  
89 + // Enable interrupt routine safety checks?
90 + #define SAFE_INTERRUPT_PPC 1
91 +
92   // Enable Execute68k() safety checks?
93   #define SAFE_EXEC_68K 1
94  
# Line 412 | Line 415 | void sheepshaver_cpu::interrupt(uint32 e
415          const clock_t interrupt_start = clock();
416   #endif
417  
418 + #if SAFE_INTERRUPT_PPC
419 +        static int depth = 0;
420 +        if (depth != 0)
421 +                printf("FATAL: sheepshaver_cpu::interrupt() called more than once: %d\n", depth);
422 +        depth++;
423 + #endif
424 + #if SAFE_INTERRUPT_PPC >= 2
425 +        uint32 saved_regs[32];
426 +        memcpy(&saved_regs[0], &gpr(0), sizeof(saved_regs));
427 + #endif
428 +
429   #if !MULTICORE_CPU
430          // Save program counters and branch registers
431          uint32 saved_pc = pc();
# Line 469 | Line 483 | void sheepshaver_cpu::interrupt(uint32 e
483   #if EMUL_TIME_STATS
484          interrupt_time += (clock() - interrupt_start);
485   #endif
486 +
487 + #if SAFE_INTERRUPT_PPC >= 2
488 +        if (memcmp(&saved_regs[0], &gpr(0), sizeof(saved_regs)) != 0)
489 +                printf("FATAL: dirty PowerPC registers\n");
490 + #endif
491 + #if SAFE_INTERRUPT_PPC
492 +        depth--;
493 + #endif
494   }
495  
496   // Execute 68k routine

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines