diff options
author | Lisa Hsu <hsul@eecs.umich.edu> | 2008-11-02 21:57:06 -0500 |
---|---|---|
committer | Lisa Hsu <hsul@eecs.umich.edu> | 2008-11-02 21:57:06 -0500 |
commit | 67fda02dda290d614de233846fee434b3713b1dc (patch) | |
tree | c45cf35179244586ff9b3b3b9f87a520cae7ae5d /src/sim/process.hh | |
parent | c55a467a06eaa59c47c52a2adddc266b8e545589 (diff) | |
download | gem5-67fda02dda290d614de233846fee434b3713b1dc.tar.xz |
Make it so that all thread contexts are registered with the System, even in
SE. Process still keeps track of the tc's it owns, but registration occurs
with the System, this eases the way for system-wide context Ids based on
registration.
Diffstat (limited to 'src/sim/process.hh')
-rw-r--r-- | src/sim/process.hh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/sim/process.hh b/src/sim/process.hh index cb59fed64..d6ed59ced 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -77,7 +77,7 @@ class Process : public SimObject bool checkpointRestored; // thread contexts associated with this process - std::vector<ThreadContext *> threadContexts; + std::vector<int> contextIds; // remote gdb objects std::vector<TheISA::RemoteGDB *> remoteGDB; @@ -85,7 +85,7 @@ class Process : public SimObject bool breakpoint(); // number of CPUs (esxec contexts, really) assigned to this process. - unsigned int numCpus() { return threadContexts.size(); } + unsigned int numCpus() { return contextIds.size(); } // record of blocked context struct WaitRec @@ -187,12 +187,15 @@ class Process : public SimObject // override of virtual SimObject method: register statistics virtual void regStats(); - // register a thread context for this process. - // returns tc's cpu number (index into threadContexts[]) - int registerThreadContext(ThreadContext *tc); - + // After getting registered with system object, tell process which + // system-wide context id it is assigned. + void assignThreadContext(int context_id) + { + contextIds.push_back(context_id); + } - void replaceThreadContext(ThreadContext *tc, int tcIndex); + // Find a free context to use + ThreadContext * findFreeContext(); // map simulator fd sim_fd to target fd tgt_fd void dup_fd(int sim_fd, int tgt_fd); |