summaryrefslogtreecommitdiff
path: root/sim/process.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-01-28 00:08:22 -0500
committerSteve Reinhardt <stever@eecs.umich.edu>2006-01-28 00:08:22 -0500
commit03a2aca9a9fc6afa8d7e6f92cc9acc1e9b37a7cd (patch)
tree3f7061edd21acae37fc6208a3895f7b37f76512a /sim/process.hh
parent9df80550d43dd875e3449bd2287b0bccde36dcad (diff)
downloadgem5-03a2aca9a9fc6afa8d7e6f92cc9acc1e9b37a7cd.tar.xz
Changes for Process object initialization in merged-memory environment.
System object now exists for both fullsys and syscall emulation, as the latter needs it so that Process objects can find the shared PhysicalMemory for initialization. Changes are incomplete: still need to fix up Process (& EioProcess) memory initialization and syscall emulation code for new mem interface. arch/alpha/alpha_linux_process.cc: arch/alpha/alpha_linux_process.hh: arch/alpha/alpha_tru64_process.cc: arch/alpha/alpha_tru64_process.hh: cpu/base.cc: cpu/base.hh: Take System argument in constructor. cpu/exec_context.cc: Take System argument in constructor. Merge two constructors into a single one. cpu/exec_context.hh: Take System argument in constructor. Merge two constructors into a single one. Replace dummy translation with lookup in Process object's page table. python/m5/objects/Process.py: Add System parameter to Process object (& subobjects). python/m5/objects/System.py: Segregate full-system only Process parameters (most of them!). sim/process.cc: Take System argument in constructor. Move initialization to startup() callback to occur after system & cpus are initialized. Generate ProxyMemory object to pass to loader for transparent virtual page allocation. sim/process.hh: Take System argument in constructor. Move initialization to startup() callback to occur after system & cpus are initialized. sim/system.cc: sim/system.hh: Enable System object for non-full-system too. Basically involved putting most of the existing code inside '#ifdef FULL_SYSTEM'. Key thing needed for syscall emulation at this point is the PhysicalMemory object (for Process initialization). --HG-- extra : convert_revision : f0f34b47bd4f77b502191affd3d03b4d6d9bcdd8
Diffstat (limited to 'sim/process.hh')
-rw-r--r--sim/process.hh38
1 files changed, 27 insertions, 11 deletions
diff --git a/sim/process.hh b/sim/process.hh
index 2116ef632..e7e0b8a9b 100644
--- a/sim/process.hh
+++ b/sim/process.hh
@@ -40,18 +40,27 @@
#include <vector>
-#include "targetarch/isa_traits.hh"
-#include "sim/sim_object.hh"
-#include "sim/stats.hh"
#include "base/statistics.hh"
#include "base/trace.hh"
+#include "mem/base_mem.hh"
+#include "mem/mem_interface.hh"
+#include "mem/page_table.hh"
+#include "sim/sim_object.hh"
+#include "sim/stats.hh"
+#include "targetarch/isa_traits.hh"
class ExecContext;
class FunctionalMemory;
+class System;
+
class Process : public SimObject
{
public:
+ /// Pointer to object representing the system this process is
+ /// running on.
+ System *system;
+
// have we initialized an execution context from this process? If
// yes, subsequent contexts are assumed to be for dynamically
// created threads and are not initialized.
@@ -71,15 +80,12 @@ class Process : public SimObject
WaitRec(Addr chan, ExecContext *ctx)
: waitChan(chan), waitingContext(ctx)
- {
- }
+ { }
};
// list of all blocked contexts
std::list<WaitRec> waitList;
- RegFile *init_regs; // initial register contents
-
Addr text_base; // text (code) segment base
unsigned text_size; // text (code) size in bytes
@@ -112,6 +118,7 @@ class Process : public SimObject
protected:
// constructor
Process(const std::string &nm,
+ System *_system,
int stdin_fd, // initial I/O descriptors
int stdout_fd,
int stderr_fd);
@@ -120,7 +127,11 @@ class Process : public SimObject
virtual void startup();
protected:
- FunctionalMemory *memory;
+ /// Memory object for initialization (image loading)
+ FunctionalMemory *initVirtMem;
+
+ public:
+ PageTable *pTable;
private:
// file descriptor remapping support
@@ -175,8 +186,6 @@ class Process : public SimObject
}
virtual void syscall(ExecContext *xc) = 0;
-
- virtual FunctionalMemory *getMemory() { return memory; }
};
//
@@ -186,16 +195,23 @@ class ObjectFile;
class LiveProcess : public Process
{
protected:
+ ObjectFile *objFile;
+ std::vector<std::string> argv;
+ std::vector<std::string> envp;
+
LiveProcess(const std::string &nm, ObjectFile *objFile,
- int stdin_fd, int stdout_fd, int stderr_fd,
+ System *_system, int stdin_fd, int stdout_fd, int stderr_fd,
std::vector<std::string> &argv,
std::vector<std::string> &envp);
+ void startup();
+
public:
// 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 &nm,
+ System *_system,
int stdin_fd, int stdout_fd, int stderr_fd,
std::string executable,
std::vector<std::string> &argv,