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>
This commit is contained in:
committed by
Brandon Potter
parent
20428d69da
commit
598f704d51
@@ -373,7 +373,7 @@ static SyscallDesc syscallDescs64[] = {
|
||||
/* 108 */ SyscallDesc("getegid", getegidFunc),
|
||||
/* 109 */ SyscallDesc("setpgid", setpgidFunc),
|
||||
/* 110 */ SyscallDesc("getppid", getppidFunc),
|
||||
/* 111 */ SyscallDesc("getpgrp", unimplementedFunc),
|
||||
/* 111 */ SyscallDesc("getpgrp", getpgrpFunc),
|
||||
/* 112 */ SyscallDesc("setsid", unimplementedFunc),
|
||||
/* 113 */ SyscallDesc("setreuid", unimplementedFunc),
|
||||
/* 114 */ SyscallDesc("setregid", unimplementedFunc),
|
||||
|
||||
@@ -982,6 +982,13 @@ pipe2Func(SyscallDesc *desc, int callnum, ThreadContext *tc)
|
||||
return pipeImpl(desc, callnum, tc, false, true);
|
||||
}
|
||||
|
||||
SyscallReturn
|
||||
getpgrpFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
|
||||
{
|
||||
auto process = tc->getProcessPtr();
|
||||
return process->pgid();
|
||||
}
|
||||
|
||||
SyscallReturn
|
||||
setpgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user