summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2019-03-11 14:24:33 -0400
committerBrandon Potter <Brandon.Potter@amd.com>2019-08-06 20:47:28 +0000
commit598f704d51ddfc7c1abd0afdbb99e4cbafbe8813 (patch)
treebef0f217232fda275e0e468dba3e38d7c92895fc /src/sim
parent20428d69da186083a4fe9e97acb25e79c1857366 (diff)
downloadgem5-598f704d51ddfc7c1abd0afdbb99e4cbafbe8813.tar.xz
sim-se: add new getpgrp system call
This changeset adds new (relatively simple) system call support. The getpgrp call returns a thread context's pgid. Change-Id: I361bdbfb9c01b761ddd5a4923d23f86971f8d614 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17111 Maintainer: Brandon Potter <Brandon.Potter@amd.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/syscall_emul.cc7
-rw-r--r--src/sim/syscall_emul.hh3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 28e3e3ded..088dcbcce 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -983,6 +983,13 @@ pipe2Func(SyscallDesc *desc, int callnum, ThreadContext *tc)
}
SyscallReturn
+getpgrpFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
+{
+ auto process = tc->getProcessPtr();
+ return process->pgid();
+}
+
+SyscallReturn
setpgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
int index = 0;
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 875f565cd..130791d20 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -226,6 +226,9 @@ SyscallReturn gettidFunc(SyscallDesc *desc, int num, ThreadContext *tc);
/// Target chown() handler.
SyscallReturn chownFunc(SyscallDesc *desc, int num, ThreadContext *tc);
+/// Target getpgrpFunc() handler.
+SyscallReturn getpgrpFunc(SyscallDesc *desc, int num, ThreadContext *tc);
+
/// Target setpgid() handler.
SyscallReturn setpgidFunc(SyscallDesc *desc, int num, ThreadContext *tc);