summaryrefslogtreecommitdiff
path: root/src/arch/mips
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2018-08-28 10:13:04 -0400
committerBrandon Potter <Brandon.Potter@amd.com>2019-05-21 20:42:38 +0000
commitdd8a7694806e3f816ba688d2094106db68b46b53 (patch)
tree8fc6bcc3e474ae3843779f6d019b296e28a8848b /src/arch/mips
parentdd2d44547ddc08ccee9e1465104eff2f43efdec0 (diff)
downloadgem5-dd8a7694806e3f816ba688d2094106db68b46b53.tar.xz
sim-se: change syscall function signature
The system calls had four parameters. One of the parameters is ThreadContext and another is Process. The ThreadContext holds the value of the current process so the Process parameter is redundant since the system call functions already have indirect access. With the old API, it is possible to call into the functions with the wrong supplied Process which could end up being a confusing error. This patch removes the redundancy by forcing access through the ThreadContext field within each system call. Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12299 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Brandon Potter <Brandon.Potter@amd.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch/mips')
-rw-r--r--src/arch/mips/linux/process.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/arch/mips/linux/process.cc b/src/arch/mips/linux/process.cc
index 71d20eaae..8a4811a04 100644
--- a/src/arch/mips/linux/process.cc
+++ b/src/arch/mips/linux/process.cc
@@ -80,10 +80,10 @@ MipsLinuxObjectFileLoader loader;
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, Process *process,
- ThreadContext *tc)
+unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
int index = 0;
+ auto process = tc->getProcessPtr();
TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
strcpy(name->sysname, "Linux");
@@ -100,10 +100,10 @@ unameFunc(SyscallDesc *desc, int callnum, Process *process,
/// borrowed from Tru64, the subcases that get used appear to be
/// different in practice from those used by Tru64 processes.
static SyscallReturn
-sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
- ThreadContext *tc)
+sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
int index = 0;
+ auto process = tc->getProcessPtr();
unsigned op = process->getSyscallArg(tc, index);
unsigned bufPtr = process->getSyscallArg(tc, index);
// unsigned nbytes = process->getSyscallArg(tc, index);
@@ -129,10 +129,10 @@ sys_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
/// Target sys_setsysinfo() handler.
static SyscallReturn
-sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
- ThreadContext *tc)
+sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
int index = 0;
+ auto process = tc->getProcessPtr();
unsigned op = process->getSyscallArg(tc, index);
Addr bufPtr = process->getSyscallArg(tc, index);
// unsigned nbytes = process->getSyscallArg(tc, index);
@@ -159,10 +159,10 @@ sys_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
}
static SyscallReturn
-setThreadAreaFunc(SyscallDesc *desc, int callnum, Process *process,
- ThreadContext *tc)
+setThreadAreaFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
int index = 0;
+ auto process = tc->getProcessPtr();
Addr addr = process->getSyscallArg(tc, index);
tc->setMiscRegNoEffect(MISCREG_TP_VALUE, addr);
return 0;