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.
18 unsigned long u_regs[16]; /* globals and ins */
37 #define UREG_WIM UREG_G0
38 #define UREG_FADDR UREG_G0
39 #define UREG_FP UREG_I6
40 #define UREG_RETPC UREG_I7
42 static inline bool pt_regs_is_syscall(struct pt_regs *regs)
44 return (regs->psr & PSR_SYSCALL);
47 static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
49 return (regs->psr &= ~PSR_SYSCALL);
52 /* A register window */
54 unsigned long locals[8];
58 /* A Sparc stack frame */
60 unsigned long locals[8];
62 struct sparc_stackf *fp;
63 unsigned long callers_pc;
65 unsigned long xargs[6];
66 unsigned long xxargs[1];
69 #define TRACEREG_SZ sizeof(struct pt_regs)
70 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
74 #define user_mode(regs) (!((regs)->psr & PSR_PS))
75 #define instruction_pointer(regs) ((regs)->pc)
76 unsigned long profile_pc(struct pt_regs *);
77 extern void show_regs(struct pt_regs *);
80 #else /* __ASSEMBLY__ */
81 /* For assembly code. */
82 #define TRACEREG_SZ 0x50
83 #define STACKFRAME_SZ 0x60
87 * The asm-offsets.h is a generated file, so we cannot include it.
88 * It may be OK for glibc headers, but it's utterly pointless for C code.
89 * The assembly code using those offsets has to include it explicitly.
91 /* #include <asm/asm-offsets.h> */
93 /* These are for pt_regs. */
117 /* Reg_window offsets */
135 /* Stack_frame offsets */
153 #define SF_XARG0 0x44
154 #define SF_XARG1 0x48
155 #define SF_XARG2 0x4c
156 #define SF_XARG3 0x50
157 #define SF_XARG4 0x54
158 #define SF_XARG5 0x58
159 #define SF_XXARG 0x5c
161 /* Stuff for the ptrace system call */
162 #define PTRACE_SPARC_DETACH 11
163 #define PTRACE_GETREGS 12
164 #define PTRACE_SETREGS 13
165 #define PTRACE_GETFPREGS 14
166 #define PTRACE_SETFPREGS 15
167 #define PTRACE_READDATA 16
168 #define PTRACE_WRITEDATA 17
169 #define PTRACE_READTEXT 18
170 #define PTRACE_WRITETEXT 19
171 #define PTRACE_GETFPAREGS 20
172 #define PTRACE_SETFPAREGS 21
174 #endif /* !(_SPARC_PTRACE_H) */