scons: Group Source-s based on what SConscript included them.
[gem5.git] / src / cpu / thread_context.hh
index 850ff9468becdac6f86c8afc902d981406087db3..bb6b54c08d4ac55444e5c9b96cb8aabd5d180bb5 100644 (file)
@@ -161,6 +161,8 @@ class ThreadContext
 
     virtual Process *getProcessPtr() = 0;
 
+    virtual void setProcessPtr(Process *p) = 0;
+
     virtual Status status() const = 0;
 
     virtual void setStatus(Status new_status) = 0;
@@ -174,6 +176,12 @@ class ThreadContext
     /// Set the status to Halted.
     virtual void halt() = 0;
 
+    /// Quiesce thread context
+    void quiesce();
+
+    /// Quiesce, suspend, and schedule activate at resume
+    void quiesceTick(Tick resume);
+
     virtual void dumpFuncProfile() = 0;
 
     virtual void takeOverFrom(ThreadContext *old_context) = 0;
@@ -217,6 +225,14 @@ class ThreadContext
 
     virtual void pcState(const TheISA::PCState &val) = 0;
 
+    void
+    setNPC(Addr val)
+    {
+        TheISA::PCState pc_state = pcState();
+        pc_state.setNPC(val);
+        pcState(pc_state);
+    }
+
     virtual void pcStateNoRecord(const TheISA::PCState &val) = 0;
 
     virtual Addr instAddr() = 0;
@@ -225,7 +241,7 @@ class ThreadContext
 
     virtual MicroPC microPC() = 0;
 
-    virtual MiscReg readMiscRegNoEffect(int misc_reg) = 0;
+    virtual MiscReg readMiscRegNoEffect(int misc_reg) const = 0;
 
     virtual MiscReg readMiscReg(int misc_reg) = 0;
 
@@ -258,7 +274,7 @@ class ThreadContext
     // Same with st cond failures.
     virtual Counter readFuncExeInst() = 0;
 
-    virtual void syscall(int64_t callnum) = 0;
+    virtual void syscall(int64_t callnum, Fault *fault) = 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);
@@ -354,6 +370,8 @@ class ProxyThreadContext : public ThreadContext
 
     Process *getProcessPtr() { return actualTC->getProcessPtr(); }
 
+    void setProcessPtr(Process *p) { actualTC->setProcessPtr(p); }
+
     Status status() const { return actualTC->status(); }
 
     void setStatus(Status new_status) { actualTC->setStatus(new_status); }
@@ -367,6 +385,12 @@ class ProxyThreadContext : public ThreadContext
     /// Set the status to Halted.
     void halt() { actualTC->halt(); }
 
+    /// Quiesce thread context
+    void quiesce() { actualTC->quiesce(); }
+
+    /// Quiesce, suspend, and schedule activate at resume
+    void quiesceTick(Tick resume) { actualTC->quiesceTick(resume); }
+
     void dumpFuncProfile() { actualTC->dumpFuncProfile(); }
 
     void takeOverFrom(ThreadContext *oldContext)
@@ -429,7 +453,7 @@ class ProxyThreadContext : public ThreadContext
     void setPredicate(bool val)
     { actualTC->setPredicate(val); }
 
-    MiscReg readMiscRegNoEffect(int misc_reg)
+    MiscReg readMiscRegNoEffect(int misc_reg) const
     { return actualTC->readMiscRegNoEffect(misc_reg); }
 
     MiscReg readMiscReg(int misc_reg)
@@ -459,8 +483,8 @@ class ProxyThreadContext : public ThreadContext
     void setStCondFailures(unsigned sc_failures)
     { actualTC->setStCondFailures(sc_failures); }
 
-    void syscall(int64_t callnum)
-    { actualTC->syscall(callnum); }
+    void syscall(int64_t callnum, Fault *fault)
+    { actualTC->syscall(callnum, fault); }
 
     Counter readFuncExeInst() { return actualTC->readFuncExeInst(); }
 
@@ -499,8 +523,8 @@ class ProxyThreadContext : public ThreadContext
  * be confusing when the ThreadContext is exported via a proxy.
  */
 
-void serialize(ThreadContext &tc, std::ostream &os);
-void unserialize(ThreadContext &tc, Checkpoint *cp, const std::string &section);
+void serialize(ThreadContext &tc, CheckpointOut &cp);
+void unserialize(ThreadContext &tc, CheckpointIn &cp);
 
 /** @} */