From: Gabe Black Date: Mon, 25 Nov 2019 07:17:58 +0000 (-0800) Subject: arch: Stop using setSyscallArg to set argc and argv. X-Git-Tag: v19.0.0.0~203 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e295bada66326a2d1a8e04bd4b21fea7c5b9c69;p=gem5.git arch: Stop using setSyscallArg to set argc and argv. In Alpha and MIPS, the argc and argv values should be in what happens to be the first and second syscall argument registers, but that's not by definition. The process objects of both those ISAs know what registers to use intrinsically, so there's also no reason to call out to a helper method which acts as a part of the Process's interface to the rest of gem5. Jira Issue: https://gem5.atlassian.net/browse/GEM5-187 Change-Id: Id8fa38ab1fc2ac6436e94ad41303439973fded10 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23173 Tested-by: kokoro Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index 314769535..b8fb7a99b 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -170,8 +170,8 @@ AlphaProcess::argsInit(int intSize, int pageSize) ThreadContext *tc = system->getThreadContext(contextIds[0]); - setSyscallArg(tc, 0, argc); - setSyscallArg(tc, 1, argv_array_base); + tc->setIntReg(FirstArgumentReg, argc); + tc->setIntReg(FirstArgumentReg + 1, argv_array_base); tc->setIntReg(StackPointerReg, memState->getStackMin()); tc->pcState(getStartPC()); diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index ca4f79afd..2e66cac82 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -185,8 +185,8 @@ MipsProcess::argsInit(int pageSize) ThreadContext *tc = system->getThreadContext(contextIds[0]); - setSyscallArg(tc, 0, argc); - setSyscallArg(tc, 1, argv_array_base); + tc->setIntReg(FirstArgumentReg, argc); + tc->setIntReg(FirstArgumentReg + 1, argv_array_base); tc->setIntReg(StackPointerReg, memState->getStackMin()); tc->pcState(getStartPC());