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.55 by gbeauche, 2004-12-18T18:40:04Z vs.
Revision 1.56 by gbeauche, 2005-01-30T21:12:07Z

# Line 145 | Line 145 | class sheepshaver_cpu
145          // CPU context to preserve on interrupt
146          class interrupt_context {
147                  uint32 gpr[32];
148 +                double fpr[32];
149                  uint32 pc;
150                  uint32 lr;
151                  uint32 ctr;
152                  uint32 cr;
153                  uint32 xer;
154 +                uint32 fpscr;
155                  sheepshaver_cpu *cpu;
156                  const char *where;
157          public:
# Line 486 | Line 488 | sheepshaver_cpu::interrupt_context::inte
488  
489          // Save interrupt context
490          memcpy(&gpr[0], &cpu->gpr(0), sizeof(gpr));
491 +        memcpy(&fpr[0], &cpu->fpr(0), sizeof(fpr));
492          pc = cpu->pc();
493          lr = cpu->lr();
494          ctr = cpu->ctr();
495          cr = cpu->get_cr();
496          xer = cpu->get_xer();
497 +        fpscr = cpu->fpscr();
498   #endif
499   }
500  
# Line 504 | Line 508 | sheepshaver_cpu::interrupt_context::~int
508                          if (gpr[i] != cpu->gpr(i))
509                                  printf(" r%d: %08x -> %08x\n", i, gpr[i], cpu->gpr(i));
510          }
511 +        if (memcmp(&fpr[0], &cpu->fpr(0), sizeof(fpr)) != 0) {
512 +                printf("FATAL: %s: interrupt clobbers registers\n", where);
513 +                for (int i = 0; i < 32; i++)
514 +                        if (fpr[i] != cpu->fpr(i))
515 +                                printf(" r%d: %f -> %f\n", i, fpr[i], cpu->fpr(i));
516 +        }
517          if (pc != cpu->pc())
518                  printf("FATAL: %s: interrupt clobbers PC\n", where);
519          if (lr != cpu->lr())
# Line 514 | Line 524 | sheepshaver_cpu::interrupt_context::~int
524                  printf("FATAL: %s: interrupt clobbers CR\n", where);
525          if (xer != cpu->get_xer())
526                  printf("FATAL: %s: interrupt clobbers XER\n", where);
527 +        if (fpscr != cpu->fpscr())
528 +                printf("FATAL: %s: interrupt clobbers FPSCR\n", where);
529   #endif
530   }
531  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines