diff options
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r-- | src/sim/system.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc index d16524c41..f10167bba 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -211,6 +211,17 @@ System::registerThreadContext(ThreadContext *tc, int assigned) return id; } +int +System::numRunningContexts() +{ + int running = 0; + for (int i = 0; i < _numContexts; ++i) { + if (threadContexts[i]->status() != ThreadContext::Halted) + ++running; + } + return running; +} + void System::startup() { |