arm: Convert ARM specific syscalls to GuestABI.
authorGabe Black <gabeblack@google.com>
Thu, 28 Nov 2019 07:53:28 +0000 (23:53 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 12 Mar 2020 00:43:28 +0000 (00:43 +0000)
Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

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

index 5a048c58277182339dc01828a7d5f135e5484e85..58edefc47e0271b9fb289c74af5289ba765ddcc0 100644 (file)
@@ -94,19 +94,12 @@ issetugidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
 
 #if !defined ( __GNU_LIBRARY__ )
 static SyscallReturn
-sysctlFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
+sysctlFunc(SyscallDesc *desc, int callnum, ThreadContext *tc,
+           Addr namep, size_t nameLen, Addr oldp, Addr oldlenp,
+           Addr newp, size_t newlen)
 {
-    int index = 0;
     uint64_t ret;
 
-    auto process = tc->getProcessPtr();
-    Addr namep = process->getSyscallArg(tc, index);
-    size_t namelen = process->getSyscallArg(tc, index);
-    Addr oldp = process->getSyscallArg(tc, index);
-    Addr oldlenp = process->getSyscallArg(tc, index);
-    Addr newp = process->getSyscallArg(tc, index);
-    size_t newlen = process->getSyscallArg(tc, index);
-
     BufferArg buf(namep, sizeof(size_t));
     BufferArg buf2(oldp, sizeof(size_t));
     BufferArg buf3(oldlenp, sizeof(size_t));
index 1f9feaeebd7a845ad70033443847dcd0c8b361ce..6ed37b0489fbfde832455da69d771ce89846c44f 100644 (file)
@@ -100,11 +100,10 @@ ArmLinuxObjectFileLoader loader;
 
 /// Target uname() handler.
 static SyscallReturn
-unameFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc)
+unameFunc32(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, "m5.eecs.umich.edu");
@@ -118,11 +117,10 @@ unameFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc)
 
 /// Target uname() handler.
 static SyscallReturn
-unameFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc)
+unameFunc64(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, "gem5");
@@ -136,25 +134,19 @@ unameFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc)
 
 /// Target set_tls() handler.
 static SyscallReturn
-setTLSFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc)
+setTLSFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc,
+             uint32_t tlsPtr)
 {
-    int index = 0;
-    auto process = tc->getProcessPtr();
-    uint32_t tlsPtr = process->getSyscallArg(tc, index);
-
     tc->getVirtProxy().writeBlob(ArmLinuxProcess32::commPage + 0x0ff0,
                                 &tlsPtr, sizeof(tlsPtr));
-    tc->setMiscReg(MISCREG_TPIDRURO,tlsPtr);
+    tc->setMiscReg(MISCREG_TPIDRURO, tlsPtr);
     return 0;
 }
 
 static SyscallReturn
-setTLSFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc)
+setTLSFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc,
+             uint32_t tlsPtr)
 {
-    int index = 0;
-    auto process = tc->getProcessPtr();
-    uint32_t tlsPtr = process->getSyscallArg(tc, index);
-
     tc->setMiscReg(MISCREG_TPIDRRO_EL0, tlsPtr);
     return 0;
 }