add some comments.
[gem5.git] / sim / process.cc
index c725d3b1c3cc0b44dd7c489001353fcce9912c08..acc6762f8598b6239914c33e3183e0f2d08721d3 100644 (file)
@@ -88,8 +88,6 @@ Process::Process(const string &name,
         fd_map[i] = -1;
     }
 
-    num_syscalls = 0;
-
     // other parameters will be initialized when the program is loaded
 }
 
@@ -145,21 +143,28 @@ Process::registerExecContext(ExecContext *xc)
     execContexts.push_back(xc);
 
     if (myIndex == 0) {
-        // first exec context for this process... initialize & enable
-
         // copy process's initial regs struct
         xc->regs = *init_regs;
-
-        // mark this context as active.
-        // activate with zero delay so that we start ticking right
-        // away on cycle 0
-        xc->activate(0);
     }
 
     // return CPU number to caller and increment available CPU count
     return myIndex;
 }
 
+void
+Process::startup()
+{
+    if (execContexts.empty())
+        return;
+
+    // first exec context for this process... initialize & enable
+    ExecContext *xc = execContexts[0];
+
+    // mark this context as active.
+    // activate with zero delay so that we start ticking right
+    // away on cycle 0
+    xc->activate(0);
+}
 
 void
 Process::replaceExecContext(ExecContext *xc, int xcIndex)
@@ -282,7 +287,7 @@ LiveProcess::LiveProcess(const string &name, ObjectFile *objFile,
 
     // Set up region for mmaps.  Tru64 seems to start just above 0 and
     // grow up from there.
-    mmap_base = 0x10000;
+    mmap_start = mmap_end = 0x10000;
 
     // Set pointer for next thread stack.  Reserve 8M for main stack.
     next_thread_stack_base = stack_base - (8 * 1024 * 1024);