summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-10-12 11:05:14 -0400
committerDmitry V. Levin <ldv@altlinux.org>2009-10-12 19:54:21 +0000
commit8566c500253f3bef38ace7d6031f76fe5d21f7e0 (patch)
tree7f416fef98bf4dcdc97d94f30be05fdebf814b02 /process.c
parent150759b7bffc6c1aa8095484e1694e008c643c9e (diff)
downloadstrace-8566c500253f3bef38ace7d6031f76fe5d21f7e0.tar.gz
strace-8566c500253f3bef38ace7d6031f76fe5d21f7e0.tar.bz2
strace-8566c500253f3bef38ace7d6031f76fe5d21f7e0.tar.xz
sparc/linux: Rewrite to use asm/ptrace.h
The current sparc/linux code uses asm/reg.h, but recent Linux kernels dropped that header completely. So switch over to the ptrace headers as those should stick around indefinitely as part of the ABI. * defs.h [LINUXSPARC] (U_REG_G1, U_REG_O0, U_REG_O1): Define. * process.c: Drop asm/regs.h include. [SPARC || SPARC64] (change_syscall): Change struct regs to struct pt_regs. * signal.c: Drop asm/regs.h include. (m_siginfo_t): Unify [SPARC || SPARC64] and [MIPS]. [SPARC || SPARC64] (sys_sigreturn): Change struct regs to struct pt_regs. * syscall.c: Drop asm/regs.h include. [SPARC || SPARC64] (internal_syscall, get_scno, get_error, force_result, syscall_enter): Change struct regs to struct pt_regs. * util.c: Drop asm/regs.h include. (_hack_syscall5, _ptrace): Delete. [SPARC || SPARC64] (getpc, printcall, arg_setup_state): Change struct regs to struct pt_regs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'process.c')
-rw-r--r--process.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/process.c b/process.c
index 5d956b0..551e1bb 100644
--- a/process.c
+++ b/process.c
@@ -56,20 +56,6 @@
#include <sys/ptrace.h>
#endif
-#if HAVE_ASM_REG_H
-#if defined (SPARC) || defined (SPARC64)
-# define fpq kernel_fpq
-# define fq kernel_fq
-# define fpu kernel_fpu
-#endif /* SPARC || SPARC64 */
-#include <asm/reg.h>
-#if defined (SPARC) || defined (SPARC64)
-# undef fpq
-# undef fq
-# undef fpu
-#endif /* SPARC || SPARC64 */
-#endif /* HAVE_ASM_REG_H */
-
#ifdef HAVE_SYS_REG_H
# include <sys/reg.h>
#ifndef PTRACE_PEEKUSR
@@ -726,10 +712,10 @@ change_syscall(struct tcb *tcp, int new)
return -1;
return 0;
#elif defined(SPARC) || defined(SPARC64)
- struct regs regs;
+ struct pt_regs regs;
if (ptrace(PTRACE_GETREGS, tcp->pid, (char*)&regs, 0)<0)
return -1;
- regs.r_g1=new;
+ regs.u_regs[U_REG_G1] = new;
if (ptrace(PTRACE_SETREGS, tcp->pid, (char*)&regs, 0)<0)
return -1;
return 0;