1 /* Contain the Stack frame layout on interrupt. pt_regs.
2 * taken from the SPARC port of Linux (ptrace.h).
5 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifndef __SPARC_PTRACE_H__
25 #define __SPARC_PTRACE_H__
29 /* This struct defines the way the registers are stored on the
30 * stack during a system call and basically all traps.
40 unsigned long u_regs[16]; /* globals and ins */
59 #define UREG_WIM UREG_G0
60 #define UREG_FADDR UREG_G0
61 #define UREG_FP UREG_I6
62 #define UREG_RETPC UREG_I7
64 /* A register window */
66 unsigned long locals[8];
70 /* A Sparc stack frame */
72 unsigned long locals[8];
74 struct sparc_stackf *fp;
75 unsigned long callers_pc;
77 unsigned long xargs[6];
78 unsigned long xxargs[1];
81 #define TRACEREG_SZ sizeof(struct pt_regs)
82 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
84 #else /* __ASSEMBLY__ */
85 /* For assembly code. */
86 #define TRACEREG_SZ 0x50
87 #define STACKFRAME_SZ 0x60
91 * The asm_offsets.h is a generated file, so we cannot include it.
92 * It may be OK for glibc headers, but it's utterly pointless for C code.
93 * The assembly code using those offsets has to include it explicitly.
95 /* #include <asm/asm_offsets.h> */
97 /* These are for pt_regs. */
121 /* Reg_window offsets */
139 /* Stack_frame offsets */
157 #define SF_XARG0 0x44
158 #define SF_XARG1 0x48
159 #define SF_XARG2 0x4c
160 #define SF_XARG3 0x50
161 #define SF_XARG4 0x54
162 #define SF_XARG5 0x58
163 #define SF_XXARG 0x5c
165 /* Stuff for the ptrace system call */
166 #define PTRACE_SUNATTACH 10
167 #define PTRACE_SUNDETACH 11
168 #define PTRACE_GETREGS 12
169 #define PTRACE_SETREGS 13
170 #define PTRACE_GETFPREGS 14
171 #define PTRACE_SETFPREGS 15
172 #define PTRACE_READDATA 16
173 #define PTRACE_WRITEDATA 17
174 #define PTRACE_READTEXT 18
175 #define PTRACE_WRITETEXT 19
176 #define PTRACE_GETFPAREGS 20
177 #define PTRACE_SETFPAREGS 21
179 #define PTRACE_GETUCODE 29 /* stupid bsd-ism */
181 #endif /* !(_SPARC_PTRACE_H) */