cpu: remove unnecessary data ptr from O3 internal read() funcs
[gem5.git] / src / sim / syscallreturn.hh
index 547d7661076cd5cb219cc4501d503b5648fb050a..fdd740775edb6144bd45839739002d907db834d0 100644 (file)
@@ -64,9 +64,17 @@ class SyscallReturn
     /// value is expected, e.g., as the return value from a system
     /// call emulation function ('return 0;' or 'return -EFAULT;').
     SyscallReturn(int64_t v)
-        : value(v)
+        : value(v), retryFlag(false)
     {}
 
+    /// Pseudo-constructor to create an instance with the retry flag set.
+    static SyscallReturn retry()
+    {
+        SyscallReturn s(0);
+        s.retryFlag = true;
+        return s;
+    }
+
     ~SyscallReturn() {}
 
     /// Was the system call successful?
@@ -75,6 +83,9 @@ class SyscallReturn
         return (value >= 0 || value <= -4096);
     }
 
+    /// Does the syscall need to be retried?
+    bool needsRetry() const { return retryFlag; }
+
     /// The return value
     int64_t returnValue() const
     {
@@ -98,6 +109,8 @@ class SyscallReturn
   private:
 
     int64_t value;
+
+    bool retryFlag;
 };
 
 #endif