1 #ifndef _SPARC_PTRACE_H
2 #define _SPARC_PTRACE_H
6 /* This struct defines the way the registers are stored on the
7 * stack during a system call and basically all traps.
12 #include <linux/types.h>
19 unsigned long u_regs[16]; /* globals and ins */
38 #define UREG_WIM UREG_G0
39 #define UREG_FADDR UREG_G0
40 #define UREG_FP UREG_I6
41 #define UREG_RETPC UREG_I7
43 static inline bool pt_regs_is_syscall(struct pt_regs *regs)
45 return (regs->psr & PSR_SYSCALL);
48 static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
50 return (regs->psr &= ~PSR_SYSCALL);
53 /* A register window */
55 unsigned long locals[8];
59 /* A Sparc stack frame */
61 unsigned long locals[8];
63 struct sparc_stackf *fp;
64 unsigned long callers_pc;
66 unsigned long xargs[6];
67 unsigned long xxargs[1];
70 #define TRACEREG_SZ sizeof(struct pt_regs)
71 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
75 #define user_mode(regs) (!((regs)->psr & PSR_PS))
76 #define instruction_pointer(regs) ((regs)->pc)
77 unsigned long profile_pc(struct pt_regs *);
78 extern void show_regs(struct pt_regs *);
81 #else /* __ASSEMBLY__ */
82 /* For assembly code. */
83 #define TRACEREG_SZ 0x50
84 #define STACKFRAME_SZ 0x60
88 * The asm-offsets.h is a generated file, so we cannot include it.
89 * It may be OK for glibc headers, but it's utterly pointless for C code.
90 * The assembly code using those offsets has to include it explicitly.
92 /* #include <asm/asm-offsets.h> */
94 /* These are for pt_regs. */
118 /* Reg_window offsets */
136 /* Stack_frame offsets */
154 #define SF_XARG0 0x44
155 #define SF_XARG1 0x48
156 #define SF_XARG2 0x4c
157 #define SF_XARG3 0x50
158 #define SF_XARG4 0x54
159 #define SF_XARG5 0x58
160 #define SF_XXARG 0x5c
162 /* Stuff for the ptrace system call */
163 #define PTRACE_SPARC_DETACH 11
164 #define PTRACE_GETREGS 12
165 #define PTRACE_SETREGS 13
166 #define PTRACE_GETFPREGS 14
167 #define PTRACE_SETFPREGS 15
168 #define PTRACE_READDATA 16
169 #define PTRACE_WRITEDATA 17
170 #define PTRACE_READTEXT 18
171 #define PTRACE_WRITETEXT 19
172 #define PTRACE_GETFPAREGS 20
173 #define PTRACE_SETFPAREGS 21
175 #endif /* !(_SPARC_PTRACE_H) */