From 8882dc1283771463a20194c083f4b8940a2d574b Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 15 Apr 2009 13:13:47 -0700 Subject: 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. --- src/sim/system.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/sim/system.cc') 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() { -- cgit v1.2.3