X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=sim%2Fprocess.cc;h=3541fd04031871103a86b9d463b0f118d79bf999;hb=8031cd93b53cd3fe17a5a5f21e8e8bd833398e97;hp=acc6762f8598b6239914c33e3183e0f2d08721d3;hpb=b5c788bf8a2eeec591490191a253575a2828b9cb;p=gem5.git diff --git a/sim/process.cc b/sim/process.cc index acc6762f8..3541fd040 100644 --- a/sim/process.cc +++ b/sim/process.cc @@ -65,14 +65,14 @@ using namespace std; // current number of allocated processes int num_processes = 0; -Process::Process(const string &name, +Process::Process(const string &nm, int stdin_fd, // initial I/O descriptors int stdout_fd, int stderr_fd) - : SimObject(name) + : SimObject(nm) { // allocate memory space - memory = new MainMemory(name + ".MainMem"); + memory = new MainMemory(nm + ".MainMem"); // allocate initial register file init_regs = new RegFile; @@ -88,6 +88,8 @@ Process::Process(const string &name, fd_map[i] = -1; } + mmap_start = mmap_end = 0; + nxm_start = nxm_end = 0; // other parameters will be initialized when the program is loaded } @@ -160,9 +162,7 @@ Process::startup() // 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 + // mark this context as active so it will start ticking. xc->activate(0); } @@ -252,10 +252,10 @@ copyStringArray(vector &strings, Addr array_ptr, Addr data_ptr, memory->access(Write, array_ptr, &data_ptr, sizeof(Addr)); } -LiveProcess::LiveProcess(const string &name, ObjectFile *objFile, +LiveProcess::LiveProcess(const string &nm, ObjectFile *objFile, int stdin_fd, int stdout_fd, int stderr_fd, vector &argv, vector &envp) - : Process(name, stdin_fd, stdout_fd, stderr_fd) + : Process(nm, stdin_fd, stdout_fd, stderr_fd) { prog_fname = argv[0]; @@ -339,7 +339,7 @@ LiveProcess::LiveProcess(const string &name, ObjectFile *objFile, LiveProcess * -LiveProcess::create(const string &name, +LiveProcess::create(const string &nm, int stdin_fd, int stdout_fd, int stderr_fd, vector &argv, vector &envp) { @@ -353,13 +353,13 @@ LiveProcess::create(const string &name, if (objFile->getArch() == ObjectFile::Alpha) { switch (objFile->getOpSys()) { case ObjectFile::Tru64: - process = new AlphaTru64Process(name, objFile, + process = new AlphaTru64Process(nm, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp); break; case ObjectFile::Linux: - process = new AlphaLinuxProcess(name, objFile, + process = new AlphaLinuxProcess(nm, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp); break;