1 /* $Id: ptrace.h,v 1.25 1997/03/04 16:27:25 jj Exp $ */
2 #ifndef _SPARC_PTRACE_H
3 #define _SPARC_PTRACE_H
7 /* This struct defines the way the registers are stored on the
8 * stack during a system call and basically all traps.
13 #include <linux/types.h>
20 unsigned long u_regs[16]; /* globals and ins */
39 #define UREG_WIM UREG_G0
40 #define UREG_FADDR UREG_G0
41 #define UREG_FP UREG_I6
42 #define UREG_RETPC UREG_I7
44 static inline bool pt_regs_is_syscall(struct pt_regs *regs)
46 return (regs->psr & PSR_SYSCALL);
49 static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
51 return (regs->psr &= ~PSR_SYSCALL);
54 /* A register window */
56 unsigned long locals[8];
60 /* A Sparc stack frame */
62 unsigned long locals[8];
64 struct sparc_stackf *fp;
65 unsigned long callers_pc;
67 unsigned long xargs[6];
68 unsigned long xxargs[1];
71 #define TRACEREG_SZ sizeof(struct pt_regs)
72 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
76 #define user_mode(regs) (!((regs)->psr & PSR_PS))
77 #define instruction_pointer(regs) ((regs)->pc)
78 unsigned long profile_pc(struct pt_regs *);
79 extern void show_regs(struct pt_regs *);
82 #else /* __ASSEMBLY__ */
83 /* For assembly code. */
84 #define TRACEREG_SZ 0x50
85 #define STACKFRAME_SZ 0x60
89 * The asm-offsets.h is a generated file, so we cannot include it.
90 * It may be OK for glibc headers, but it's utterly pointless for C code.
91 * The assembly code using those offsets has to include it explicitly.
93 /* #include <asm/asm-offsets.h> */
95 /* These are for pt_regs. */
119 /* Reg_window offsets */
137 /* Stack_frame offsets */
155 #define SF_XARG0 0x44
156 #define SF_XARG1 0x48
157 #define SF_XARG2 0x4c
158 #define SF_XARG3 0x50
159 #define SF_XARG4 0x54
160 #define SF_XARG5 0x58
161 #define SF_XXARG 0x5c
163 /* Stuff for the ptrace system call */
164 #define PTRACE_SPARC_DETACH 11
165 #define PTRACE_GETREGS 12
166 #define PTRACE_SETREGS 13
167 #define PTRACE_GETFPREGS 14
168 #define PTRACE_SETFPREGS 15
169 #define PTRACE_READDATA 16
170 #define PTRACE_WRITEDATA 17
171 #define PTRACE_READTEXT 18
172 #define PTRACE_WRITETEXT 19
173 #define PTRACE_GETFPAREGS 20
174 #define PTRACE_SETFPAREGS 21
176 #endif /* !(_SPARC_PTRACE_H) */