Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/23166 )
Change subject: sim: Add a suppression mechanism to the SyscallReturn class.
......................................................................
sim: Add a suppression mechanism to the SyscallReturn class.
It makes more sense to specify whether something should be returned
based on the return, not intrinsically on the syscall. This is
especially true in cases like execve where the expected behavior
is not constant.
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187
Change-Id: I95b53b6d69445c7a04c0049fbb0f439238d971e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23166
Reviewed-by: Gabe Black <gabebl...@google.com>
Maintainer: Gabe Black <gabebl...@google.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/sim/syscall_return.hh
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/sim/syscall_return.hh b/src/sim/syscall_return.hh
index b2e3248..b60434e 100644
--- a/src/sim/syscall_return.hh
+++ b/src/sim/syscall_return.hh
@@ -63,9 +63,10 @@
/// conversion, so a bare integer is used where a SyscallReturn
/// value is expected, e.g., as the return value from a system
/// call emulation function ('return 0;' or 'return -EFAULT;').
- SyscallReturn(int64_t v)
- : value(v), retryFlag(false)
- {}
+ SyscallReturn(int64_t v) : value(v) {}
+
+ /// A SyscallReturn constructed with no value means don't return
anything.
+ SyscallReturn() : suppressedFlag(true) {}
/// Pseudo-constructor to create an instance with the retry flag set.
static SyscallReturn
@@ -88,6 +89,9 @@
/// Does the syscall need to be retried?
bool needsRetry() const { return retryFlag; }
+ /// Should returning this value be suppressed?
+ bool suppressed() const { return suppressedFlag; }
+
/// The return value
int64_t
returnValue() const
@@ -110,7 +114,8 @@
private:
int64_t value;
- bool retryFlag;
+ bool retryFlag = false;
+ bool suppressedFlag = false;
};
#endif
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23166
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I95b53b6d69445c7a04c0049fbb0f439238d971e8
Gerrit-Change-Number: 23166
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Brandon Potter <brandon.pot...@amd.com>
Gerrit-Reviewer: Brandon Potter <ambitiousc...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev