Brandon Potter has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/12308 )
Change subject: sim-se: small refactor on pipe syscall
......................................................................
sim-se: small refactor on pipe syscall
Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12308
Reviewed-by: Brandon Potter <[email protected]>
Maintainer: Brandon Potter <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/sim/syscall_emul.cc
1 file changed, 7 insertions(+), 4 deletions(-)
Approvals:
Brandon Potter: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index eaf90ec..142292d 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -868,8 +868,14 @@
SyscallReturn
pipeImpl(SyscallDesc *desc, int callnum, ThreadContext *tc, bool
pseudoPipe)
{
- int sim_fds[2], tgt_fds[2];
+ Addr tgt_addr = 0;
auto p = tc->getProcessPtr();
+ if (!pseudoPipe) {
+ int index = 0;
+ tgt_addr = p->getSyscallArg(tc, index);
+ }
+
+ int sim_fds[2], tgt_fds[2];
int pipe_retval = pipe(sim_fds);
if (pipe_retval == -1)
@@ -898,9 +904,6 @@
return tgt_fds[0];
}
- int index = 0;
- Addr tgt_addr = p->getSyscallArg(tc, index);
-
/**
* Copy the target file descriptors into buffer space and then copy
* the buffer space back into the target address space.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12308
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: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5
Gerrit-Change-Number: 12308
Gerrit-PatchSet: 23
Gerrit-Owner: Brandon Potter <[email protected]>
Gerrit-Reviewer: Alexandru Duțu <[email protected]>
Gerrit-Reviewer: Brandon Potter <[email protected]>
Gerrit-Reviewer: John Alsop <[email protected]>
Gerrit-Reviewer: Matt Sinclair <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev