changes regarding fs.py
[gem5.git] / src / cpu / thread_context.hh
index 48c8fa28dd315219993545d23358cee94de9ac05..73046097decd69949a0bf377b2580cb1afa36b0e 100644 (file)
@@ -31,6 +31,9 @@
 #ifndef __CPU_THREAD_CONTEXT_HH__
 #define __CPU_THREAD_CONTEXT_HH__
 
+#include "arch/types.hh"
+#include "arch/regfile.hh"
+#include "arch/syscallreturn.hh"
 #include "config/full_system.hh"
 #include "mem/request.hh"
 #include "sim/faults.hh"
@@ -143,7 +146,7 @@ class ThreadContext
     virtual void suspend() = 0;
 
     /// Set the status to Unallocated.
-    virtual void deallocate() = 0;
+    virtual void deallocate(int delay = 0) = 0;
 
     /// Set the status to Halted.
     virtual void halt() = 0;
@@ -245,14 +248,17 @@ class ThreadContext
 
     virtual void setSyscallReturn(SyscallReturn return_value) = 0;
 
-    virtual void syscall(int64_t callnum) = 0;
-
     // Same with st cond failures.
     virtual Counter readFuncExeInst() = 0;
+
+    // This function exits the thread context in the CPU and returns
+    // 1 if the CPU has no more active threads (meaning it's OK to exit);
+    // Used in syscall-emulation mode when a  thread calls the exit syscall.
+    virtual int exit() { return 1; };
 #endif
 
-    virtual void changeRegFileContext(RegFile::ContextParam param,
-            RegFile::ContextVal val) = 0;
+    virtual void changeRegFileContext(TheISA::RegContextParam param,
+            TheISA::RegContextVal val) = 0;
 };
 
 /**
@@ -315,7 +321,7 @@ class ProxyThreadContext : public ThreadContext
     void suspend() { actualTC->suspend(); }
 
     /// Set the status to Unallocated.
-    void deallocate() { actualTC->deallocate(); }
+    void deallocate(int delay = 0) { actualTC->deallocate(); }
 
     /// Set the status to Halted.
     void halt() { actualTC->halt(); }
@@ -432,13 +438,11 @@ class ProxyThreadContext : public ThreadContext
     void setSyscallReturn(SyscallReturn return_value)
     { actualTC->setSyscallReturn(return_value); }
 
-    void syscall(int64_t callnum) { actualTC->syscall(callnum); }
-
     Counter readFuncExeInst() { return actualTC->readFuncExeInst(); }
 #endif
 
-    void changeRegFileContext(RegFile::ContextParam param,
-            RegFile::ContextVal val)
+    void changeRegFileContext(TheISA::RegContextParam param,
+            TheISA::RegContextVal val)
     {
         actualTC->changeRegFileContext(param, val);
     }