diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2014-10-29 23:22:26 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2014-10-29 23:22:26 -0500 |
commit | 7a0bf814b6eb2db57f37977a0cca6c442f957d68 (patch) | |
tree | df8247c4215a69446660d6f76c5f35a3b51b12e0 /src/sim/process.cc | |
parent | 93c0307d418e08db609818f19f5d2b02d45e7465 (diff) | |
parent | 6ab4eddb9f5fbd30db0dccbef4a60c46b7053de3 (diff) | |
download | gem5-7a0bf814b6eb2db57f37977a0cca6c442f957d68.tar.xz |
automated merge
Diffstat (limited to 'src/sim/process.cc')
-rw-r--r-- | src/sim/process.cc | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc index 913e9298d..d1fb22029 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -278,7 +278,7 @@ Process::alloc_fd(int sim_fd, string filename, int flags, int mode, bool pipe) // find first free target fd for (int free_fd = 0; free_fd <= MAX_FD; ++free_fd) { Process::FdMap *fdo = &fd_map[free_fd]; - if (fdo->fd == -1) { + if (fdo->fd == -1 && fdo->driver == NULL) { fdo->fd = sim_fd; fdo->filename = filename; fdo->mode = mode; @@ -309,6 +309,7 @@ Process::free_fd(int tgt_fd) fdo->flags = 0; fdo->isPipe = false; fdo->readPipeSource = 0; + fdo->driver = NULL; } @@ -565,16 +566,14 @@ Process::map(Addr vaddr, Addr paddr, int size) //////////////////////////////////////////////////////////////////////// -LiveProcess::LiveProcess(LiveProcessParams * params, ObjectFile *_objFile) +LiveProcess::LiveProcess(LiveProcessParams *params, ObjectFile *_objFile) : Process(params), objFile(_objFile), - argv(params->cmd), envp(params->env), cwd(params->cwd) + argv(params->cmd), envp(params->env), cwd(params->cwd), + __uid(params->uid), __euid(params->euid), + __gid(params->gid), __egid(params->egid), + __pid(params->pid), __ppid(params->ppid), + drivers(params->drivers) { - __uid = params->uid; - __euid = params->euid; - __gid = params->gid; - __egid = params->egid; - __pid = params->pid; - __ppid = params->ppid; // load up symbols, if any... these may be used for debugging or // profiling. @@ -608,6 +607,19 @@ LiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width) return getSyscallArg(tc, i); } + +EmulatedDriver * +LiveProcess::findDriver(std::string filename) +{ + for (EmulatedDriver *d : drivers) { + if (d->match(filename)) + return d; + } + + return NULL; +} + + LiveProcess * LiveProcess::create(LiveProcessParams * params) { |