From: Kevin Lim Date: Fri, 26 Sep 2008 14:44:06 +0000 (-0700) Subject: O3CPU: Add a hack to ensure that nextPC is set correctly after syscalls. X-Git-Tag: m5_2.0_beta6~32 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=712a8ee70090abc8c8c0fdb4a907e3ec419ae56e;p=gem5.git 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. --- 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