]> granicus.if.org Git - strace/commitdiff
2003-02-26 Stuart Menefy <stuart.menefy@st.com>
authorRoland McGrath <roland@redhat.com>
Mon, 31 Mar 2003 01:05:01 +0000 (01:05 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 31 Mar 2003 01:05:01 +0000 (01:05 +0000)
Various fixes for SuperH [SH]:
* mem.c (sys_old_mmap): mmap() parameters passed in registers
* net.c (sys_pipe), syscall.c (getrval2): pipe() results returned
in registers
* process.c (change_syscall): Fixed register which holds system
call number
* util.c (arg0_offset, arg1_offset): provide definition
* Makefile.am: Added new files in linux/sh
* linux/sh/syscallent.h: New file.
* linux/sh/errnoent.h: New file.
* linux/sh/ioctlent.h: New file.
* linux/sh/signalent.h: New file.

mem.c
net.c
syscall.c

diff --git a/mem.c b/mem.c
index 7f9c8d7ad125134eac38ef391b2c824caf7fce34..f8cc09d95744509c4b4825adac50fb0057e42857 100644 (file)
--- a/mem.c
+++ b/mem.c
@@ -222,7 +222,12 @@ struct tcb *tcp;
                return 0;
        else
                u_arg[i] = v;
-#else  // defined(IA64)
+#elif defined(SH)
+    /* SH has always passed the args in registers */
+    int i;
+    for (i=0; i<6; i++)
+        u_arg[i] = tcp->u_arg[i];
+#else
     if (umoven(tcp, tcp->u_arg[0], sizeof u_arg, (char *) u_arg) == -1)
            return 0;
 #endif // defined(IA64)
diff --git a/net.c b/net.c
index 08ca66f6b92060c923c3d7a300decab2503a10e6..b136b42cf1c9efa92b8dbe287611ddb707db2ffa 100644 (file)
--- a/net.c
+++ b/net.c
@@ -1163,7 +1163,7 @@ sys_pipe(tcp)
 struct tcb *tcp;
 {
 
-#if defined(LINUX) && !defined(SPARC)
+#if defined(LINUX) && !defined(SPARC) && !defined(SH)
        int fds[2];
 
        if (exiting(tcp)) {
@@ -1176,7 +1176,7 @@ struct tcb *tcp;
                else
                        tprintf("[%u, %u]", fds[0], fds[1]);
        }
-#elif defined(SPARC) || defined(SVR4) || defined(FREEBSD)
+#elif defined(SPARC) || defined(SH) || defined(SVR4) || defined(FREEBSD)
        if (exiting(tcp))
                tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
 #endif
index 9814a4378f366fd6c6975f59acc44e52f4aa9227..c9c635aeea40796590d180b6048dd559bcc7db38 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2297,6 +2297,9 @@ struct tcb *tcp;
        if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0)
                return -1;
        val = regs.r_o1;
+#elif defined(SH)
+       if (upeek(tcp->pid, 4*(REG_REG0+1), &val) < 0)
+               return -1;
 #endif /* SPARC */
 #endif /* LINUX */