# HG changeset patch
# User Timothy M. Jones <[email protected]>
# Date 1255701144 -3600
# Node ID b597490ff2d78ba56e4ffe7464b369474b9a174b
# Parent  223f58dbdc54f2ea227d1e796c1d66fe8f2e6b50
Fix compiler errors relating to PowerPC miscregs.

There are no miscregs currently defined in PowerPC, so the compiler was
generating errors when accessing arrays using a miscreg index. This is
fixed by removing such accesses and failing simulation, since these
functions should never be called.

diff --git a/src/arch/powerpc/isa.hh b/src/arch/powerpc/isa.hh
--- a/src/arch/powerpc/isa.hh
+++ b/src/arch/powerpc/isa.hh
@@ -35,6 +35,7 @@
 
 #include "arch/powerpc/registers.hh"
 #include "arch/powerpc/types.hh"
+#include "base/misc.hh"
 
 class ThreadContext;
 class Checkpoint;
@@ -46,41 +47,39 @@
 class ISA
 {
   protected:
+    MiscReg dummy;
     MiscReg miscRegs[NumMiscRegs];
 
   public:
     void
     clear()
     {
-        memset(miscRegs, 0, sizeof(miscRegs));
     }
 
     MiscReg
     readMiscRegNoEffect(int misc_reg)
     {
-        assert(misc_reg < NumMiscRegs);
-        return miscRegs[misc_reg];
+        fatal("PowerPC does not currently have any misc regs defined\n");
+        return dummy;
     }
 
     MiscReg
     readMiscReg(int misc_reg, ThreadContext *tc)
     {
-        assert(misc_reg < NumMiscRegs);
-        return miscRegs[misc_reg];
+        fatal("PowerPC does not currently have any misc regs defined\n");
+        return dummy;
     }
 
     void
     setMiscRegNoEffect(int misc_reg, const MiscReg &val)
     {
-        assert(misc_reg < NumMiscRegs);
-        miscRegs[misc_reg] = val;
+        fatal("PowerPC does not currently have any misc regs defined\n");
     }
 
     void
     setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc)
     {
-        assert(misc_reg < NumMiscRegs);
-        miscRegs[misc_reg] = val;
+        fatal("PowerPC does not currently have any misc regs defined\n");
     }
 
     int

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to