From: Gabe Black Date: Mon, 7 Sep 2020 02:03:12 +0000 (-0700) Subject: sparc,sim: Remove special handling of SPARC in the clone system call. X-Git-Tag: develop-gem5-snapshot~762 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=007abdec6b5893d9e06789f61f31f2e67bda20aa;p=gem5.git sparc,sim: Remove special handling of SPARC in the clone system call. We can set the extra syscall return values in the ISA specific archClone function. We don't need a special #ifdef to handle them. Change-Id: I82904b3d4bdf211c89d271d7277a60151191cdfc Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34167 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Ciro Santilli --- diff --git a/src/arch/sparc/linux/linux.hh b/src/arch/sparc/linux/linux.hh index ed50a30c3..431ec0627 100644 --- a/src/arch/sparc/linux/linux.hh +++ b/src/arch/sparc/linux/linux.hh @@ -230,6 +230,11 @@ class SparcLinux : public Linux if (stack) ctc->setIntReg(SparcISA::StackPointerReg, stack); + + // Set these extra values. Since "clone" doesn't return two values, + // we can set these and they won't be clobbered by the syscall ABI. + ptc->setIntReg(SparcISA::SyscallPseudoReturnReg, 0); + ctc->setIntReg(SparcISA::SyscallPseudoReturnReg, 1); } }; diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 05a29f9fe..9d1f6e272 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1506,11 +1506,6 @@ cloneFunc(SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack, desc->returnInto(ctc, 0); -#if THE_ISA == SPARC_ISA - tc->setIntReg(TheISA::SyscallPseudoReturnReg, 0); - ctc->setIntReg(TheISA::SyscallPseudoReturnReg, 1); -#endif - TheISA::PCState cpc = tc->pcState(); if (!p->kvmInSE) cpc.advance();