From 6b1d43ef29a23e5e0aba381f70e2f64e9cface30 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 31 Mar 2003 01:05:01 +0000 Subject: [PATCH] 2003-02-26 Stuart Menefy 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 | 7 ++++++- net.c | 4 ++-- syscall.c | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mem.c b/mem.c index 7f9c8d7a..f8cc09d9 100644 --- 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 08ca66f6..b136b42c 100644 --- 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 diff --git a/syscall.c b/syscall.c index 9814a437..c9c635ae 100644 --- a/syscall.c +++ b/syscall.c @@ -2297,6 +2297,9 @@ struct tcb *tcp; if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)®s,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 */ -- 2.40.0