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:
parent
70ec46de17
commit
712a8ee700
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue