diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2009-04-15 13:13:47 -0700 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2009-04-15 13:13:47 -0700 |
commit | 8882dc1283771463a20194c083f4b8940a2d574b (patch) | |
tree | d33aa3b7b59a4a466d43643e0b8bc64acc66e951 /src/sim/system.hh | |
parent | 9b66e8289781025bbc4d0e152737fa7c5d024ec8 (diff) | |
download | gem5-8882dc1283771463a20194c083f4b8940a2d574b.tar.xz |
Get rid of the Unallocated thread context state.
Basically merge it in with Halted.
Also had to get rid of a few other functions that
called ThreadContext::deallocate(), including:
- InOrderCPU's setThreadRescheduleCondition.
- ThreadContext::exit(). This function was there to avoid terminating
simulation when one thread out of a multi-thread workload exits, but we
need to find a better (non-cpu-centric) way.
Diffstat (limited to 'src/sim/system.hh')
-rw-r--r-- | src/sim/system.hh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sim/system.hh b/src/sim/system.hh index bfa5ea8bb..e1c30490b 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -89,19 +89,21 @@ class System : public SimObject std::vector<ThreadContext *> threadContexts; int _numContexts; - ThreadContext * getThreadContext(int tid) + ThreadContext *getThreadContext(int tid) { return threadContexts[tid]; } int numContexts() { - if (_numContexts != threadContexts.size()) - panic("cpu array not fully populated!"); - + assert(_numContexts == threadContexts.size()); return _numContexts; } + /** Return number of running (non-halted) thread contexts in + * system. These threads could be Active or Suspended. */ + int numRunningContexts(); + #if FULL_SYSTEM Platform *platform; uint64_t init_param; |