Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/m5
[gem5.git] / sim / process.hh
index bb48298759a89bcf2342f6bc49fb3c91fb2dc583..ef54ced787b99ce8fdc3d0f4acf7bdafdf9e2bf8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001-2004 The Regents of The University of Michigan
+ * Copyright (c) 2001-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,9 @@
 // when there's no OS: thus there's no reason to use it in FULL_SYSTEM
 // mode when we do have an OS.
 //
-#ifndef FULL_SYSTEM
+#include "config/full_system.hh"
+
+#if !FULL_SYSTEM
 
 #include <vector>
 
@@ -42,6 +44,7 @@
 #include "sim/sim_object.hh"
 #include "sim/stats.hh"
 #include "base/statistics.hh"
+#include "base/trace.hh"
 
 class ExecContext;
 class FunctionalMemory;
@@ -93,7 +96,12 @@ class Process : public SimObject
     Addr next_thread_stack_base;
 
     // Base of region for mmaps (when user doesn't specify an address).
-    Addr mmap_base;
+    Addr mmap_start;
+    Addr mmap_end;
+
+    // Base of region for nxm data
+    Addr nxm_start;
+    Addr nxm_end;
 
     std::string prog_fname;    // file name
     Addr prog_entry;           // entry point (initial PC)
@@ -103,11 +111,13 @@ class Process : public SimObject
 
   protected:
     // constructor
-    Process(const std::string &name,
+    Process(const std::string &nm,
             int stdin_fd,      // initial I/O descriptors
             int stdout_fd,
             int stderr_fd);
 
+    // post initialization startup
+    virtual void startup();
 
   protected:
     FunctionalMemory *memory;
@@ -155,8 +165,10 @@ class Process : public SimObject
     bool validDataAddr(Addr addr)
     {
         return ((data_base <= addr && addr < brk_point) ||
-                ((stack_base - 16*1024*1024) <= addr && addr < stack_base) ||
-                (text_base <= addr && addr < (text_base + text_size)));
+                (next_thread_stack_base <= addr && addr < stack_base) ||
+                (text_base <= addr && addr < (text_base + text_size)) ||
+                (mmap_start <= addr && addr < mmap_end) ||
+                (nxm_start <= addr && addr < nxm_end));
     }
 
     virtual void syscall(ExecContext *xc) = 0;
@@ -171,7 +183,7 @@ class ObjectFile;
 class LiveProcess : public Process
 {
   protected:
-    LiveProcess(const std::string &name, ObjectFile *objFile,
+    LiveProcess(const std::string &nm, ObjectFile *objFile,
                 int stdin_fd, int stdout_fd, int stderr_fd,
                 std::vector<std::string> &argv,
                 std::vector<std::string> &envp);
@@ -180,7 +192,7 @@ class LiveProcess : public Process
     // this function is used to create the LiveProcess object, since
     // we can't tell which subclass of LiveProcess to use until we
     // open and look at the object file.
-    static LiveProcess *create(const std::string &name,
+    static LiveProcess *create(const std::string &nm,
                                int stdin_fd, int stdout_fd, int stderr_fd,
                                std::vector<std::string> &argv,
                                std::vector<std::string> &envp);