summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 0cc328c22..739b42278 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -302,6 +302,16 @@ System::registerThreadContext(ThreadContext *tc, ContextID assigned)
return id;
}
+ThreadContext *
+System::findFreeContext()
+{
+ for (auto &it : threadContexts) {
+ if (ThreadContext::Halted == it->status())
+ return it;
+ }
+ return nullptr;
+}
+
bool
System::schedule(PCEvent *event)
{