summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2008-09-26 07:44:06 -0700
committerKevin Lim <ktlim@umich.edu>2008-09-26 07:44:06 -0700
commit712a8ee70090abc8c8c0fdb4a907e3ec419ae56e (patch)
tree2dd75ac1af357c90dfbfa0aeefdf4196409cc7b8 /src
parent70ec46de1736ef218ee0f554358c0558d56169ac (diff)
downloadgem5-712a8ee70090abc8c8c0fdb4a907e3ec419ae56e.tar.xz
O3CPU: Add a hack to ensure that nextPC is set correctly after syscalls.
Just check CPU's nextPC before and after syscall and if it changes, update this instruction's nextPC because the syscall must have changed the nextPC.
Diffstat (limited to 'src')
-rw-r--r--src/cpu/o3/alpha/dyn_inst_impl.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cpu/o3/alpha/dyn_inst_impl.hh b/src/cpu/o3/alpha/dyn_inst_impl.hh
index 6dfe0ccdd..610a313cf 100644
--- a/src/cpu/o3/alpha/dyn_inst_impl.hh
+++ b/src/cpu/o3/alpha/dyn_inst_impl.hh
@@ -161,7 +161,15 @@ template <class Impl>
void
AlphaDynInst<Impl>::syscall(int64_t callnum)
{
+ // HACK: check CPU's nextPC before and after syscall. If it
+ // changes, update this instruction's nextPC because the syscall
+ // must have changed the nextPC.
+ Addr cpu_next_pc = this->cpu->readNextPC(this->threadNumber);
this->cpu->syscall(callnum, this->threadNumber);
+ Addr new_next_pc = this->cpu->readNextPC(this->threadNumber);
+ if (cpu_next_pc != new_next_pc) {
+ this->setNextPC(new_next_pc);
+ }
}
#endif