sim: Convert ftruncate64 to GuestABI.
authorGabe Black <gabeblack@google.com>
Sat, 7 Dec 2019 11:23:18 +0000 (03:23 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 12 Mar 2020 01:35:34 +0000 (01:35 +0000)
This function was specifying a particular width to getSyscallArg. The
new ISA specific ABIs now handle that automatically.

Change-Id: I141655d3bcb78f56c2a9278d140dfbc0d69e1ff4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23454
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/syscall_emul.cc
src/sim/syscall_emul.hh

index 4ab472aaf0bbc607ef1c379cdb6eb0d5fad918bf..731cf247e45b337f3a888d31d36cc997ccc350c3 100644 (file)
@@ -613,12 +613,10 @@ truncate64Func(SyscallDesc *desc, int num, ThreadContext *tc,
 }
 
 SyscallReturn
-ftruncate64Func(SyscallDesc *desc, int num, ThreadContext *tc)
+ftruncate64Func(SyscallDesc *desc, int num, ThreadContext *tc,
+                int tgt_fd, int64_t length)
 {
-    int index = 0;
     auto p = tc->getProcessPtr();
-    int tgt_fd = p->getSyscallArg(tc, index);
-    int64_t length = p->getSyscallArg(tc, index, 64);
 
     auto ffdp = std::dynamic_pointer_cast<FileFDEntry>((*p->fds)[tgt_fd]);
     if (!ffdp)
index 6be574ac887ffdd3bff7e405d73edad816f55071..74ffd761fcdbe54ef0844d8fd1c7b1cf390693d0 100644 (file)
@@ -235,8 +235,8 @@ SyscallReturn truncate64Func(SyscallDesc *desc, int num, ThreadContext *tc,
                              Addr pathname, int64_t length);
 
 /// Target ftruncate64() handler.
-SyscallReturn ftruncate64Func(SyscallDesc *desc, int num, ThreadContext *tc);
-
+SyscallReturn ftruncate64Func(SyscallDesc *desc, int num, ThreadContext *tc,
+                              int tgt_fd, int64_t length);
 
 /// Target umask() handler.
 SyscallReturn umaskFunc(SyscallDesc *desc, int num, ThreadContext *tc);