From 712a8ee70090abc8c8c0fdb4a907e3ec419ae56e Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Fri, 26 Sep 2008 07:44:06 -0700 Subject: [PATCH] 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. --- src/cpu/o3/alpha/dyn_inst_impl.hh | 8 ++++++++ 1 file changed, 8 insertions(+) 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 void AlphaDynInst::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 -- 2.30.2