diff options
author | Nathan Binkert <nate@binkert.org> | 2007-07-23 21:51:38 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2007-07-23 21:51:38 -0700 |
commit | abc76f20cb98c90e8dab416dd16dfd4a954013ba (patch) | |
tree | f3131e68a09c1b4537e17df5b14df21df53746e4 /src/sim/process.cc | |
parent | 552097b92e37fb4c0fd27960afe0a03c02894f11 (diff) | |
download | gem5-abc76f20cb98c90e8dab416dd16dfd4a954013ba.tar.xz |
Major changes to how SimObjects are created and initialized. Almost all
creation and initialization now happens in python. Parameter objects
are generated and initialized by python. The .ini file is now solely for
debugging purposes and is not used in construction of the objects in any
way.
--HG--
extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed
Diffstat (limited to 'src/sim/process.cc')
-rw-r--r-- | src/sim/process.cc | 57 |
1 files changed, 4 insertions, 53 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc index 8b273d591..c556ade12 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -45,7 +45,7 @@ #include "mem/page_table.hh" #include "mem/physical.hh" #include "mem/translating_port.hh" -#include "sim/builder.hh" +#include "params/LiveProcess.hh" #include "sim/process.hh" #include "sim/process_impl.hh" #include "sim/stats.hh" @@ -312,14 +312,6 @@ Process::unserialize(Checkpoint *cp, const std::string §ion) } -// -// need to declare these here since there is no concrete Process type -// that can be constructed (i.e., no REGISTER_SIM_OBJECT() macro call, -// which is where these get declared for concrete types). -// -DEFINE_SIM_OBJECT_CLASS_NAME("Process", Process) - - //////////////////////////////////////////////////////////////////////// // // LiveProcess member definitions @@ -551,46 +543,8 @@ LiveProcess::create(const std::string &nm, System *system, int stdin_fd, return process; } - -BEGIN_DECLARE_SIM_OBJECT_PARAMS(LiveProcess) - - VectorParam<string> cmd; - Param<string> executable; - Param<string> input; - Param<string> output; - VectorParam<string> env; - Param<string> cwd; - SimObjectParam<System *> system; - Param<uint64_t> uid; - Param<uint64_t> euid; - Param<uint64_t> gid; - Param<uint64_t> egid; - Param<uint64_t> pid; - Param<uint64_t> ppid; - -END_DECLARE_SIM_OBJECT_PARAMS(LiveProcess) - - -BEGIN_INIT_SIM_OBJECT_PARAMS(LiveProcess) - - INIT_PARAM(cmd, "command line (executable plus arguments)"), - INIT_PARAM(executable, "executable (overrides cmd[0] if set)"), - INIT_PARAM(input, "filename for stdin (dflt: use sim stdin)"), - INIT_PARAM(output, "filename for stdout/stderr (dflt: use sim stdout)"), - INIT_PARAM(env, "environment settings"), - INIT_PARAM(cwd, "current working directory"), - INIT_PARAM(system, "system"), - INIT_PARAM(uid, "user id"), - INIT_PARAM(euid, "effective user id"), - INIT_PARAM(gid, "group id"), - INIT_PARAM(egid, "effective group id"), - INIT_PARAM(pid, "process id"), - INIT_PARAM(ppid, "parent process id") - -END_INIT_SIM_OBJECT_PARAMS(LiveProcess) - - -CREATE_SIM_OBJECT(LiveProcess) +LiveProcess * +LiveProcessParams::create() { string in = input; string out = output; @@ -612,12 +566,9 @@ CREATE_SIM_OBJECT(LiveProcess) stderr_fd = (stdout_fd != STDOUT_FILENO) ? stdout_fd : STDERR_FILENO; - return LiveProcess::create(getInstanceName(), system, + return LiveProcess::create(name, system, stdin_fd, stdout_fd, stderr_fd, (string)executable == "" ? cmd[0] : executable, cmd, env, cwd, uid, euid, gid, egid, pid, ppid); } - - -REGISTER_SIM_OBJECT("LiveProcess", LiveProcess) |