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>
diff --git a/defs.h b/defs.h
index 9fd6122..e5e920b 100644
--- a/defs.h
+++ b/defs.h
@@ -218,6 +218,11 @@
 #define DEFAULT_PERSONALITY 0
 
 #ifdef LINUXSPARC
+/* Indexes into the pt_regs.u_reg[] array -- UREG_XX from kernel are all off
+ * by 1 and use Ix instead of Ox.  These work for both 32 and 64 bit Linux. */
+#define U_REG_G1 0
+#define U_REG_O0 7
+#define U_REG_O1 8
 #define PERSONALITY0_WORDSIZE 4
 #define PERSONALITY1_WORDSIZE 4
 #undef  SUPPORTED_PERSONALITIES