SCons: centralize the Dir() workaround for newer versions of scons.
[gem5.git] / src / cpu / thread_context.hh
index 0d09492eee96ece4746b353501f8850dc5a21e75..9ee5250a3cc88f3f5f38c8704c28e078f29c4cbb 100644 (file)
@@ -115,9 +115,15 @@ class ThreadContext
 
     virtual BaseCPU *getCpuPtr() = 0;
 
-    virtual void setCpuId(int id) = 0;
+    virtual int cpuId() = 0;
 
-    virtual int readCpuId() = 0;
+    virtual int threadId() = 0;
+
+    virtual void setThreadId(int id) = 0;
+
+    virtual int contextId() = 0;
+
+    virtual void setContextId(int id) = 0;
 
     virtual TheISA::ITB *getITBPtr() = 0;
 
@@ -130,11 +136,9 @@ class ThreadContext
 
     virtual FunctionalPort *getPhysPort() = 0;
 
-    virtual VirtualPort *getVirtPort(ThreadContext *tc = NULL) = 0;
-
-    virtual void delVirtPort(VirtualPort *vp) = 0;
+    virtual VirtualPort *getVirtPort() = 0;
 
-    virtual void connectMemPorts() = 0;
+    virtual void connectMemPorts(ThreadContext *tc) = 0;
 #else
     virtual TranslatingPort *getMemPort() = 0;
 
@@ -150,13 +154,13 @@ class ThreadContext
     virtual void activate(int delay = 1) = 0;
 
     /// Set the status to Suspended.
-    virtual void suspend() = 0;
+    virtual void suspend(int delay = 0) = 0;
 
     /// Set the status to Unallocated.
     virtual void deallocate(int delay = 0) = 0;
 
     /// Set the status to Halted.
-    virtual void halt() = 0;
+    virtual void halt(int delay = 0) = 0;
 
 #if FULL_SYSTEM
     virtual void dumpFuncProfile() = 0;
@@ -181,8 +185,6 @@ class ThreadContext
     virtual void profileSample() = 0;
 #endif
 
-    virtual int getThreadNum() = 0;
-
     // Also somewhat obnoxious.  Really only used for the TLB fault.
     // However, may be quite useful in SPARC.
     virtual TheISA::MachInst getInst() = 0;
@@ -274,9 +276,6 @@ class ThreadContext
     virtual int exit() { return 1; };
 #endif
 
-    virtual void changeRegFileContext(TheISA::RegContextParam param,
-            TheISA::RegContextVal val) = 0;
-
     /** function to compare two thread contexts (for debugging) */
     static void compare(ThreadContext *one, ThreadContext *two);
 };
@@ -305,9 +304,15 @@ class ProxyThreadContext : public ThreadContext
 
     BaseCPU *getCpuPtr() { return actualTC->getCpuPtr(); }
 
-    void setCpuId(int id) { actualTC->setCpuId(id); }
+    int cpuId() { return actualTC->cpuId(); }
+
+    int threadId() { return actualTC->threadId(); }
 
-    int readCpuId() { return actualTC->readCpuId(); }
+    void setThreadId(int id) { return actualTC->setThreadId(id); }
+
+    int contextId() { return actualTC->contextId(); }
+
+    void setContextId(int id) { actualTC->setContextId(id); }
 
     TheISA::ITB *getITBPtr() { return actualTC->getITBPtr(); }
 
@@ -321,11 +326,9 @@ class ProxyThreadContext : public ThreadContext
 
     FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
 
-    VirtualPort *getVirtPort(ThreadContext *tc = NULL) { return actualTC->getVirtPort(tc); }
+    VirtualPort *getVirtPort() { return actualTC->getVirtPort(); }
 
-    void delVirtPort(VirtualPort *vp) { return actualTC->delVirtPort(vp); }
-
-    void connectMemPorts() { actualTC->connectMemPorts(); }
+    void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); }
 #else
     TranslatingPort *getMemPort() { return actualTC->getMemPort(); }
 
@@ -341,13 +344,13 @@ class ProxyThreadContext : public ThreadContext
     void activate(int delay = 1) { actualTC->activate(delay); }
 
     /// Set the status to Suspended.
-    void suspend() { actualTC->suspend(); }
+    void suspend(int delay = 0) { actualTC->suspend(); }
 
     /// Set the status to Unallocated.
     void deallocate(int delay = 0) { actualTC->deallocate(); }
 
     /// Set the status to Halted.
-    void halt() { actualTC->halt(); }
+    void halt(int delay = 0) { actualTC->halt(); }
 
 #if FULL_SYSTEM
     void dumpFuncProfile() { actualTC->dumpFuncProfile(); }
@@ -371,9 +374,6 @@ class ProxyThreadContext : public ThreadContext
     void profileClear() { return actualTC->profileClear(); }
     void profileSample() { return actualTC->profileSample(); }
 #endif
-
-    int getThreadNum() { return actualTC->getThreadNum(); }
-
     // @todo: Do I need this?
     MachInst getInst() { return actualTC->getInst(); }
 
@@ -433,7 +433,7 @@ class ProxyThreadContext : public ThreadContext
 
     uint64_t readNextMicroPC() { return actualTC->readMicroPC(); }
 
-    void setNextMicroPC(uint64_t val) { actualTC->setMicroPC(val); }
+    void setNextMicroPC(uint64_t val) { actualTC->setNextMicroPC(val); }
 
     MiscReg readMiscRegNoEffect(int misc_reg)
     { return actualTC->readMiscRegNoEffect(misc_reg); }
@@ -471,12 +471,6 @@ class ProxyThreadContext : public ThreadContext
 
     Counter readFuncExeInst() { return actualTC->readFuncExeInst(); }
 #endif
-
-    void changeRegFileContext(TheISA::RegContextParam param,
-            TheISA::RegContextVal val)
-    {
-        actualTC->changeRegFileContext(param, val);
-    }
 };
 
 #endif