O3: Track if the RAS has been pushed or not to pop the RAS if neccessary.
[gem5.git] / src / cpu / nativetrace.hh
index 6ad6b0242a897505aa30d97704352e3bc3979218..f6bf63d76f62ce9ecfea9c12e7a4fa8cb7f7bd3f 100644 (file)
 #ifndef __CPU_NATIVETRACE_HH__
 #define __CPU_NATIVETRACE_HH__
 
-#include <errno.h>
 #include <unistd.h>
 
+#include <cerrno>
+
 #include "base/socket.hh"
 #include "base/trace.hh"
 #include "base/types.hh"
@@ -54,10 +55,10 @@ class NativeTraceRecord : public ExeTracerRecord
   public:
     NativeTraceRecord(NativeTrace * _parent,
                Tick _when, ThreadContext *_thread,
-               const StaticInstPtr _staticInst, Addr _pc, bool spec,
-               const StaticInstPtr _macroStaticInst = NULL, MicroPC _upc = 0)
+               const StaticInstPtr _staticInst, TheISA::PCState _pc,
+               bool spec, const StaticInstPtr _macroStaticInst = NULL)
         : ExeTracerRecord(_when, _thread, _staticInst, _pc, spec,
-                _macroStaticInst, _upc),
+                _macroStaticInst),
         parent(_parent)
     {
     }
@@ -79,14 +80,14 @@ class NativeTrace : public ExeTracer
 
     NativeTraceRecord *
     getInstRecord(Tick when, ThreadContext *tc,
-            const StaticInstPtr staticInst, Addr pc,
-            const StaticInstPtr macroStaticInst = NULL, MicroPC upc = 0)
+            const StaticInstPtr staticInst, TheISA::PCState pc,
+            const StaticInstPtr macroStaticInst = NULL)
     {
         if (tc->misspeculating())
             return NULL;
 
         return new NativeTraceRecord(this, when, tc,
-                staticInst, pc, tc->misspeculating(), macroStaticInst, upc);
+                staticInst, pc, tc->misspeculating(), macroStaticInst);
     }
 
     template<class T>
@@ -107,7 +108,7 @@ class NativeTrace : public ExeTracer
     {
         size_t soFar = 0;
         while (soFar < size) {
-            size_t res = ::read(fd, (uint8_t *)ptr + soFar, size - soFar);
+            ssize_t res = ::read(fd, (uint8_t *)ptr + soFar, size - soFar);
             if (res < 0)
                 panic("Read call failed! %s\n", strerror(errno));
             else
@@ -119,6 +120,6 @@ class NativeTrace : public ExeTracer
     check(NativeTraceRecord *record) = 0;
 };
 
-} /* namespace Trace */
+} // namespace Trace
 
 #endif // __CPU_NATIVETRACE_HH__