sim: Use the Guest ABI mechanism in writeFunc.
authorGabe Black <gabeblack@google.com>
Tue, 26 Nov 2019 07:30:26 +0000 (23:30 -0800)
committerGabe Black <gabeblack@google.com>
Sat, 8 Feb 2020 12:58:35 +0000 (12:58 +0000)
This change only modifies the writeFunc since it's easy to test using
the hello world test programs.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: Ia4a7bacdb9938d9fbe4093fc6958904d6c423360
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23192
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/syscall_emul.hh

index 62020397f48af139def4cdd7c05d5b8f2008d585..a0c3cf5c6b9e784af7c0e858fe97f0f2c427f2f9 100644 (file)
@@ -2645,13 +2645,10 @@ readFunc(SyscallDesc *desc, int num, ThreadContext *tc)
 
 template <class OS>
 SyscallReturn
-writeFunc(SyscallDesc *desc, int num, ThreadContext *tc)
+writeFunc(SyscallDesc *desc, int num, ThreadContext *tc,
+        int tgt_fd, Addr buf_ptr, int nbytes)
 {
-    int index = 0;
     auto p = tc->getProcessPtr();
-    int tgt_fd = p->getSyscallArg(tc, index);
-    Addr buf_ptr = p->getSyscallArg(tc, index);
-    int nbytes = p->getSyscallArg(tc, index);
 
     auto hbfdp = std::dynamic_pointer_cast<HBFDEntry>((*p->fds)[tgt_fd]);
     if (!hbfdp)