public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: callback: extend syscall interface to handle 7 args
@ 2021-06-24  4:20 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-06-24  4:20 UTC (permalink / raw)
  To: gdb-patches

The Linux syscall interface, depending on architecture, handles up to
7 arguments.  Extend the callback API to handle those.
---
 include/sim/callback.h | 2 +-
 sim/bfin/interp.c      | 8 ++++----
 sim/m32r/traps-linux.c | 4 ++++
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/sim/callback.h b/include/sim/callback.h
index 8d61ebb879e8..be72f4503e1a 100644
--- a/include/sim/callback.h
+++ b/include/sim/callback.h
@@ -241,7 +241,7 @@ typedef struct cb_syscall {
   /* The target's value of what system call to perform.  */
   int func;
   /* The arguments to the syscall.  */
-  long arg1, arg2, arg3, arg4;
+  long arg1, arg2, arg3, arg4, arg5, arg6, arg7;
 
   /* The result.  */
   long result;
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index 216cefe2c21c..ddd0e7a372e8 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -120,8 +120,8 @@ bfin_syscall (SIM_CPU *cpu)
       sc.arg2 = args[1] = DREG (1);
       sc.arg3 = args[2] = DREG (2);
       sc.arg4 = args[3] = DREG (3);
-      /*sc.arg5 =*/ args[4] = DREG (4);
-      /*sc.arg6 =*/ args[5] = DREG (5);
+      sc.arg5 = args[4] = DREG (4);
+      sc.arg6 = args[5] = DREG (5);
     }
   else
     {
@@ -131,8 +131,8 @@ bfin_syscall (SIM_CPU *cpu)
       sc.arg2 = args[1] = GET_LONG (DREG (0) + 4);
       sc.arg3 = args[2] = GET_LONG (DREG (0) + 8);
       sc.arg4 = args[3] = GET_LONG (DREG (0) + 12);
-      /*sc.arg5 =*/ args[4] = GET_LONG (DREG (0) + 16);
-      /*sc.arg6 =*/ args[5] = GET_LONG (DREG (0) + 20);
+      sc.arg5 = args[4] = GET_LONG (DREG (0) + 16);
+      sc.arg6 = args[5] = GET_LONG (DREG (0) + 20);
     }
   sc.p1 = (PTR) sd;
   sc.p2 = (PTR) cpu;
diff --git a/sim/m32r/traps-linux.c b/sim/m32r/traps-linux.c
index 8ff046590d40..c218582e431e 100644
--- a/sim/m32r/traps-linux.c
+++ b/sim/m32r/traps-linux.c
@@ -252,6 +252,10 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
         s.arg1 = arg1;
         s.arg2 = arg2;
         s.arg3 = arg3;
+        s.arg4 = arg4;
+        s.arg5 = arg5;
+        s.arg6 = arg6;
+        s.arg7 = arg7;
 
         s.p1 = (PTR) sd;
         s.p2 = (PTR) current_cpu;
-- 
2.31.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-24  4:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24  4:20 [PATCH] sim: callback: extend syscall interface to handle 7 args Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).