diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-01-22 00:10:10 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-01-22 00:10:10 -0600 |
commit | fc57ae640130c2d7610f4ff20a3d8816b88042bf (patch) | |
tree | 80da33f0f19a5e21cfeed4e94d8ea45d6db27076 /src/cpu/o3 | |
parent | 62544f938a8a7387bd22b397d36c637a2656f34a (diff) | |
download | gem5-fc57ae640130c2d7610f4ff20a3d8816b88042bf.tar.xz |
x86, cpu: corrects 270c9a75e91f, take over decoder on cpu switch
The changes made by the changeset 270c9a75e91f do not work well with switching
of cpus. The problem is that decoder for the old thread context holds state
that is not taken over by the new decoder.
This patch adds a takeOverFrom() function to Decoder class in each ISA. Except
for x86, functions in other ISAs are blank. For x86, the function copies state
from the old decoder to the new decoder.
Diffstat (limited to 'src/cpu/o3')
-rwxr-xr-x | src/cpu/o3/thread_context_impl.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index 6de5c5731..f818cc3dc 100755 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -67,6 +67,9 @@ void O3ThreadContext<Impl>::takeOverFrom(ThreadContext *old_context) { ::takeOverFrom(*this, *old_context); + TheISA::Decoder *newDecoder = getDecoderPtr(); + TheISA::Decoder *oldDecoder = old_context->getDecoderPtr(); + newDecoder->takeOverFrom(oldDecoder); thread->kernelStats = old_context->getKernelStats(); thread->funcExeInst = old_context->readFuncExeInst(); |