From a33d20ccafdca5338dbdad0659c754ea065e2bfc Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 22 Nov 2019 15:40:58 -0800 Subject: [PATCH] sim: Make the syscalls use the SyscallReturn suppression mechanism. This, among other things, prevents them from needing to toggle global flags in the syscall desc table to control local behavior. Jira Issue: https://gem5.atlassian.net/browse/GEM5-187 Change-Id: Idcef23766084f10d5205721b54a6768a850f7eb9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23167 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Brandon Potter --- src/sim/syscall_desc.cc | 2 +- src/sim/syscall_emul.hh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sim/syscall_desc.cc b/src/sim/syscall_desc.cc index 345bfa114..bf378fe20 100644 --- a/src/sim/syscall_desc.cc +++ b/src/sim/syscall_desc.cc @@ -81,7 +81,7 @@ SyscallDesc::doSyscall(int callnum, ThreadContext *tc, Fault *fault) } else DPRINTF_SYSCALL(Base, "%s returns %d\n", _name, retval.encodedValue()); - if (!(_flags & SyscallDesc::SuppressReturnValue) && !retval.needsRetry()) + if (!retval.suppressed() && !retval.needsRetry()) process->setSyscallReturn(tc, retval); } diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index fc6ed62d1..e467b0bff 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -2131,7 +2131,6 @@ template SyscallReturn execveFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { - desc->setFlags(0); auto p = tc->getProcessPtr(); int index = 0; @@ -2215,8 +2214,7 @@ execveFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) TheISA::PCState pcState = tc->pcState(); tc->setNPC(pcState.instAddr()); - desc->setFlags(SyscallDesc::SuppressReturnValue); - return 0; + return SyscallReturn(); } /// Target getrusage() function. -- 2.30.2