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 <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2131,7 +2131,6 @@ template <class OS>
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user