X86: Compute PCI config addresses correctly.
[gem5.git] / src / arch / alpha / predecoder.hh
index 4e89f53a6fcdd5d6270fb38bf126ae86eddf9f26..5502342e17e20a028d35e3a91ae6d9f85c5f2433 100644 (file)
 
 #include "arch/alpha/types.hh"
 #include "base/misc.hh"
+#include "config/full_system.hh"
 #include "sim/host.hh"
 
 class ThreadContext;
 
-namespace AlphaISA
+namespace AlphaISA {
+
+class Predecoder
 {
-    class Predecoder
+  protected:
+    ThreadContext *tc;
+
+    // The extended machine instruction being generated
+    ExtMachInst ext_inst;
+
+  public:
+    Predecoder(ThreadContext * _tc)
+        : tc(_tc)
+    {}
+
+    ThreadContext *
+    getTC()
     {
-      protected:
-        ThreadContext * tc;
-        //The pc of the current instruction
-        Addr fetchPC;
-        //The extended machine instruction being generated
-        ExtMachInst ext_inst;
-
-      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 pc, Addr off, MachInst inst)
-        {
-            fetchPC = pc;
-            assert(off == 0);
-            ext_inst = inst;
+        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)
+    {
+        ext_inst = inst;
 #if FULL_SYSTEM
-            if (pc && 0x1)
-                ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
+        ext_inst |= (static_cast<ExtMachInst>(pc & 0x1) << 32);
 #endif
-        }
-
-        //Use this to give data to the predecoder. This should be used
-        //when instructions are executed in order.
-        void moreBytes(MachInst machInst)
-        {
-            moreBytes(fetchPC + sizeof(machInst), 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 ext_inst;
-        }
-    };
+    }
+
+    bool
+    needMoreBytes()
+    {
+        return true;
+    }
+
+    bool
+    extMachInstReady()
+    {
+        return true;
+    }
+
+    // This returns a constant reference to the ExtMachInst to avoid a copy
+    const ExtMachInst &
+    getExtMachInst()
+    {
+        return ext_inst;
+    }
 };
 
+} // namespace AlphaISA
+
 #endif // __ARCH_ALPHA_PREDECODER_HH__