X86: Define a noop ExtMachInst.
[gem5.git] / src / arch / mips / predecoder.hh
index a25cce8a736fbfde002ee7650be2217a8d256219..c20fe1f5fc2c223961d526c8e47995c4c4e1bb89 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (c) 2006 The Regents of The University of Michigan
  * All rights reserved.
 
 #include "arch/mips/types.hh"
 #include "base/misc.hh"
-#include "sim/host.hh"
+#include "base/types.hh"
 
 class ThreadContext;
 
 namespace MipsISA
 {
-    class Predecoder
+
+class Predecoder
+{
+  protected:
+    ThreadContext * tc;
+    //The extended machine instruction being generated
+    ExtMachInst emi;
+
+  public:
+    Predecoder(ThreadContext * _tc) : tc(_tc)
+    {}
+
+    ThreadContext *getTC()
+    {
+        return tc;
+    }
+
+    void
+    setTC(ThreadContext *_tc)
+    {
+        tc = _tc;
+    }
+
+    void
+    process()
+    {
+    }
+
+    void
+    reset()
+    {}
+
+    //Use this to give data to the predecoder. This should be used
+    //when there is control flow.
+    void
+    moreBytes(Addr pc, Addr fetchPC, MachInst inst)
+    {
+        emi = inst;
+    }
+
+    bool
+    needMoreBytes()
+    {
+        return true;
+    }
+
+    bool
+    extMachInstReady()
+    {
+        return true;
+    }
+
+    //This returns a constant reference to the ExtMachInst to avoid a copy
+    const ExtMachInst &
+    getExtMachInst()
     {
-      protected:
-        ThreadContext * tc;
-        //The extended machine instruction being generated
-        ExtMachInst emi;
-
-      public:
-        Predecoder(ThreadContext * _tc) : tc(_tc)
-        {}
-
-        ThreadContext * getTC()
-        {
-            return tc;
-        }
-
-        void setTC(ThreadContext * _tc)
-        {
-            tc = _tc;
-        }
-
-        void process()
-        {
-        }
-
-        //Use this to give data to the predecoder. This should be used
-        //when there is control flow.
-        void moreBytes(Addr currPC, Addr off, MachInst inst)
-        {
-            assert(off == 0);
-            emi = inst;
-        }
-
-        //Use this to give data to the predecoder. This should be used
-        //when instructions are executed in order.
-        void moreBytes(MachInst machInst)
-        {
-            moreBytes(0, 0, machInst);
-        }
-
-        bool needMoreBytes()
-        {
-            return true;
-        }
-
-        bool extMachInstReady()
-        {
-            return true;
-        }
-
-        //This returns a constant reference to the ExtMachInst to avoid a copy
-        const ExtMachInst & getExtMachInst()
-        {
-            return emi;
-        }
-    };
+        return emi;
+    }
+};
+
 };
 
 #endif // __ARCH_MIPS_PREDECODER_HH__