diff options
author | Lisa Hsu <hsul@eecs.umich.edu> | 2008-11-02 21:57:06 -0500 |
---|---|---|
committer | Lisa Hsu <hsul@eecs.umich.edu> | 2008-11-02 21:57:06 -0500 |
commit | 67fda02dda290d614de233846fee434b3713b1dc (patch) | |
tree | c45cf35179244586ff9b3b3b9f87a520cae7ae5d /src/kern/tru64 | |
parent | c55a467a06eaa59c47c52a2adddc266b8e545589 (diff) | |
download | gem5-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')
-rw-r--r-- | src/kern/tru64/tru64.hh | 27 |
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 |