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 * SPDX-License-Identifier: GPL-2.0+
10 #ifndef __SPARC_PTRACE_H__
11 #define __SPARC_PTRACE_H__
15 /* This struct defines the way the registers are stored on the
16 * stack during a system call and basically all traps.
26 unsigned long u_regs[16]; /* globals and ins */
45 #define UREG_WIM UREG_G0
46 #define UREG_FADDR UREG_G0
47 #define UREG_FP UREG_I6
48 #define UREG_RETPC UREG_I7
50 /* A register window */
52 unsigned long locals[8];
56 /* A Sparc stack frame */
58 unsigned long locals[8];
60 struct sparc_stackf *fp;
61 unsigned long callers_pc;
63 unsigned long xargs[6];
64 unsigned long xxargs[1];
67 #define TRACEREG_SZ sizeof(struct pt_regs)
68 #define STACKFRAME_SZ sizeof(struct sparc_stackf)
70 #else /* __ASSEMBLY__ */
71 /* For assembly code. */
72 #define TRACEREG_SZ 0x50
73 #define STACKFRAME_SZ 0x60
77 * The asm_offsets.h is a generated file, so we cannot include it.
78 * It may be OK for glibc headers, but it's utterly pointless for C code.
79 * The assembly code using those offsets has to include it explicitly.
81 /* #include <asm/asm_offsets.h> */
83 /* These are for pt_regs. */
107 /* Reg_window offsets */
125 /* Stack_frame offsets */
143 #define SF_XARG0 0x44
144 #define SF_XARG1 0x48
145 #define SF_XARG2 0x4c
146 #define SF_XARG3 0x50
147 #define SF_XARG4 0x54
148 #define SF_XARG5 0x58
149 #define SF_XXARG 0x5c
151 /* Stuff for the ptrace system call */
152 #define PTRACE_SUNATTACH 10
153 #define PTRACE_SUNDETACH 11
154 #define PTRACE_GETREGS 12
155 #define PTRACE_SETREGS 13
156 #define PTRACE_GETFPREGS 14
157 #define PTRACE_SETFPREGS 15
158 #define PTRACE_READDATA 16
159 #define PTRACE_WRITEDATA 17
160 #define PTRACE_READTEXT 18
161 #define PTRACE_WRITETEXT 19
162 #define PTRACE_GETFPAREGS 20
163 #define PTRACE_SETFPAREGS 21
165 #define PTRACE_GETUCODE 29 /* stupid bsd-ism */
167 #endif /* !(_SPARC_PTRACE_H) */