sim: Add an option to forward work items to Python
[gem5.git] / src / sim / system.cc
index c5e2e0b96316f784ca84411751f48fbaf987c8b1..2e74d01c8b1fdcabd40e2a742af1e26a2242712b 100644 (file)
@@ -80,6 +80,7 @@ int System::numSystemsRunning = 0;
 System::System(Params *p)
     : MemObject(p), _systemPort("system_port", this),
       _numContexts(0),
+      multiThread(p->multi_thread),
       pagePtr(0),
       init_param(p->init_param),
       physProxy(_systemPort, p->cache_line_size),
@@ -209,11 +210,11 @@ bool System::breakpoint()
  */
 int rgdb_wait = -1;
 
-int
-System::registerThreadContext(ThreadContext *tc, int assigned)
+ContextID
+System::registerThreadContext(ThreadContext *tc, ContextID assigned)
 {
     int id;
-    if (assigned == -1) {
+    if (assigned == InvalidContextID) {
         for (id = 0; id < threadContexts.size(); id++) {
             if (!threadContexts[id])
                 break;
@@ -305,7 +306,7 @@ System::initState()
 }
 
 void
-System::replaceThreadContext(ThreadContext *tc, int context_id)
+System::replaceThreadContext(ThreadContext *tc, ContextID context_id)
 {
     if (context_id >= threadContexts.size()) {
         panic("replaceThreadContext: bad id, %d >= %d\n",