summaryrefslogtreecommitdiff
path: root/src/kern/tru64/tru64.hh
diff options
context:
space:
mode:
authorLisa Hsu <hsul@eecs.umich.edu>2008-11-02 21:57:06 -0500
committerLisa Hsu <hsul@eecs.umich.edu>2008-11-02 21:57:06 -0500
commit67fda02dda290d614de233846fee434b3713b1dc (patch)
treec45cf35179244586ff9b3b3b9f87a520cae7ae5d /src/kern/tru64/tru64.hh
parentc55a467a06eaa59c47c52a2adddc266b8e545589 (diff)
downloadgem5-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/kern/tru64/tru64.hh')
-rw-r--r--src/kern/tru64/tru64.hh27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/kern/tru64/tru64.hh b/src/kern/tru64/tru64.hh
index dfdb8524d..5f8307cd2 100644
--- a/src/kern/tru64/tru64.hh
+++ b/src/kern/tru64/tru64.hh
@@ -789,21 +789,18 @@ class Tru64 : public OperatingSystem
slot_state.copyOut(tc->getMemPort());
// Find a free simulator thread context.
- for (int i = 0; i < process->numCpus(); ++i) {
- ThreadContext *tc = process->threadContexts[i];
-
- if (tc->status() == ThreadContext::Unallocated) {
- // inactive context... grab it
- init_thread_context(tc, attrp, uniq_val);
-
- // This is supposed to be a port number, but we'll try
- // and get away with just sticking the thread index
- // here.
- *kidp = htog(thread_index);
- kidp.copyOut(tc->getMemPort());
-
- return 0;
- }
+ ThreadContext *tc = process->findFreeContext();
+ if (tc) {
+ // inactive context... grab it
+ init_thread_context(tc, attrp, uniq_val);
+
+ // This is supposed to be a port number, but we'll try
+ // and get away with just sticking the thread index
+ // here.
+ *kidp = htog(thread_index);
+ kidp.copyOut(tc->getMemPort());
+
+ return 0;
}
// fell out of loop... no available inactive context