Roger Chang has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/65531?usp=email )
Change subject: sim-se: change sizeof output pid buffer to 4
......................................................................
sim-se: change sizeof output pid buffer to 4
The sizeof pid should be 4 and should not overwrite the other fields
Change-Id: Ic9b25701e2b9968e29c14afe4c04bf64f705136a
---
M src/sim/syscall_emul.cc
M src/sim/syscall_emul.hh
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index c212d24..e98ec1b 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -94,8 +94,8 @@
exitFutexWake(ThreadContext *tc, VPtr<> addr, uint64_t tgid)
{
// Clear value at address pointed to by thread's childClearTID field.
- BufferArg ctidBuf(addr, sizeof(long));
- long *ctid = (long *)ctidBuf.bufferPtr();
+ BufferArg ctidBuf(addr, sizeof(int));
+ int *ctid = (int *)ctidBuf.bufferPtr();
*ctid = 0;
ctidBuf.copyOut(SETranslatingPortProxy(tc));
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index b4550dd..efd490d 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1668,9 +1668,9 @@
owner->revokeThreadContext(ctc->contextId());
if (flags & OS::TGT_CLONE_PARENT_SETTID) {
- BufferArg ptidBuf(ptidPtr, sizeof(long));
- long *ptid = (long *)ptidBuf.bufferPtr();
- *ptid = cp->pid();
+ BufferArg ptidBuf(ptidPtr, sizeof(int));
+ int *ptid = (int *)ptidBuf.bufferPtr();
+ *ptid = (int)cp->pid();
ptidBuf.copyOut(SETranslatingPortProxy(tc));
}
@@ -1692,9 +1692,9 @@
}
if (flags & OS::TGT_CLONE_CHILD_SETTID) {
- BufferArg ctidBuf(ctidPtr, sizeof(long));
- long *ctid = (long *)ctidBuf.bufferPtr();
- *ctid = cp->pid();
+ BufferArg ctidBuf(ctidPtr, sizeof(int));
+ int *ctid = (int *)ctidBuf.bufferPtr();
+ *ctid = (int)cp->pid();
ctidBuf.copyOut(SETranslatingPortProxy(ctc));
}
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/65531?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ic9b25701e2b9968e29c14afe4c04bf64f705136a
Gerrit-Change-Number: 65531
Gerrit-PatchSet: 1
Gerrit-Owner: Roger Chang <rogerycch...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org