sim-se: Correctly calculate next PC in clone
The clone syscall doesn't propagate all state in the PCState object when calculating the return PC of a newly created process. Instead of creating a new PCState object from the next PC address, copy the old PC and advance it. Change-Id: Ice53831920bcb5d198865169ed2cca8d06e37cfe Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Cc: Giacomo Travaglini <giacomo.travaglini@arm.com> Cc: Javier Setoain <javier.setoain@arm.com> Cc: Brandon Potter <Brandon.Potter@amd.com> Reviewed-on: https://gem5-review.googlesource.com/c/15417 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Brandon Potter <Brandon.Potter@amd.com>
This commit is contained in:
@@ -1402,7 +1402,9 @@ cloneFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc)
|
||||
ctc->setIntReg(TheISA::SyscallPseudoReturnReg, 1);
|
||||
#endif
|
||||
|
||||
ctc->pcState(tc->nextInstAddr());
|
||||
TheISA::PCState cpc = tc->pcState();
|
||||
cpc.advance();
|
||||
ctc->pcState(cpc);
|
||||
ctc->activate();
|
||||
|
||||
return cp->pid();
|
||||
|
||||
Reference in New Issue
Block a user