riscv: Convert RISCV specific syscalls to Guest ABI.
authorGabe Black <gabeblack@google.com>
Thu, 28 Nov 2019 08:04:54 +0000 (00:04 -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: I1a7041ba890f5f69d5506583c658ae6a777b5daf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23202
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/riscv/linux/process.cc

index acf6989123e811a76ff18143e53bb5c97b04b32e..d5be09848b28ee552e1502e19fe93c1d9278d62d 100644 (file)
@@ -84,11 +84,10 @@ RiscvLinuxObjectFileLoader loader;
 
 /// 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,"sim.gem5.org");
@@ -102,11 +101,10 @@ unameFunc64(SyscallDesc *desc, int callnum, ThreadContext *tc)
 
 /// 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,"sim.gem5.org");