mips: Convert MIPS specific syscalls to Guest ABI.
authorGabe Black <gabeblack@google.com>
Thu, 28 Nov 2019 08:05:34 +0000 (00:05 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 12 Mar 2020 01:35:34 +0000 (01:35 +0000)
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: I7e7c49e885a8c3395f2e6ca361c228bce3691dbe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23205
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/mips/linux/process.cc

index ea362629a583afbb66f2533a75ea39e471f98805..03fcc87ab0516d5875f2dfeaf1a6c2d62f56d32b 100644 (file)
@@ -77,11 +77,10 @@ MipsLinuxObjectFileLoader loader;
 
 /// Target uname() handler.
 static SyscallReturn
-unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
+unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, Addr utsname)
 {
-    int index = 0;
     auto process = tc->getProcessPtr();
-    TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
+    TypedBufferArg<Linux::utsname> name(utsname);
 
     strcpy(name->sysname, "Linux");
     strcpy(name->nodename,"sim.gem5.org");
@@ -97,14 +96,9 @@ unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
 /// 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, ThreadContext *tc)
+sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc,
+                   unsigned op, unsigned bufPtr, unsigned nbytes)
 {
-    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);
-
     switch (op) {
       case 45:
         {
@@ -126,14 +120,9 @@ sys_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
 
 /// Target sys_setsysinfo() handler.
 static SyscallReturn
-sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
+sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc,
+                   unsigned op, Addr bufPtr, unsigned nbytes)
 {
-    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);
-
     switch (op) {
 
       case 14:
@@ -156,11 +145,8 @@ sys_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
 }
 
 static SyscallReturn
-setThreadAreaFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
+setThreadAreaFunc(SyscallDesc *desc, int callnum, ThreadContext *tc, Addr addr)
 {
-    int index = 0;
-    auto process = tc->getProcessPtr();
-    Addr addr = process->getSyscallArg(tc, index);
     tc->setMiscRegNoEffect(MISCREG_TP_VALUE, addr);
     return 0;
 }