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.
This commit is contained in:
Kevin Lim 2008-09-26 07:44:06 -07:00
parent 70ec46de17
commit 712a8ee700

View file

@ -161,7 +161,15 @@ template <class Impl>
void void
AlphaDynInst<Impl>::syscall(int64_t callnum) 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); 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 #endif