1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef __SPARC_PTRACE_H__
25#define __SPARC_PTRACE_H__
26
27#include <asm/psr.h>
28
29
30
31
32
33#ifndef __ASSEMBLY__
34
35struct pt_regs {
36 unsigned long psr;
37 unsigned long pc;
38 unsigned long npc;
39 unsigned long y;
40 unsigned long u_regs[16];
41};
42
43#define UREG_G0 0
44#define UREG_G1 1
45#define UREG_G2 2
46#define UREG_G3 3
47#define UREG_G4 4
48#define UREG_G5 5
49#define UREG_G6 6
50#define UREG_G7 7
51#define UREG_I0 8
52#define UREG_I1 9
53#define UREG_I2 10
54#define UREG_I3 11
55#define UREG_I4 12
56#define UREG_I5 13
57#define UREG_I6 14
58#define UREG_I7 15
59#define UREG_WIM UREG_G0
60#define UREG_FADDR UREG_G0
61#define UREG_FP UREG_I6
62#define UREG_RETPC UREG_I7
63
64
65struct reg_window {
66 unsigned long locals[8];
67 unsigned long ins[8];
68};
69
70
71struct sparc_stackf {
72 unsigned long locals[8];
73 unsigned long ins[6];
74 struct sparc_stackf *fp;
75 unsigned long callers_pc;
76 char *structptr;
77 unsigned long xargs[6];
78 unsigned long xxargs[1];
79};
80
81#define TRACEREG_SZ sizeof(struct pt_regs)
82#define STACKFRAME_SZ sizeof(struct sparc_stackf)
83
84#else
85
86#define TRACEREG_SZ 0x50
87#define STACKFRAME_SZ 0x60
88#endif
89
90
91
92
93
94
95
96
97
98#define PT_PSR 0x0
99#define PT_PC 0x4
100#define PT_NPC 0x8
101#define PT_Y 0xc
102#define PT_G0 0x10
103#define PT_WIM PT_G0
104#define PT_G1 0x14
105#define PT_G2 0x18
106#define PT_G3 0x1c
107#define PT_G4 0x20
108#define PT_G5 0x24
109#define PT_G6 0x28
110#define PT_G7 0x2c
111#define PT_I0 0x30
112#define PT_I1 0x34
113#define PT_I2 0x38
114#define PT_I3 0x3c
115#define PT_I4 0x40
116#define PT_I5 0x44
117#define PT_I6 0x48
118#define PT_FP PT_I6
119#define PT_I7 0x4c
120
121
122#define RW_L0 0x00
123#define RW_L1 0x04
124#define RW_L2 0x08
125#define RW_L3 0x0c
126#define RW_L4 0x10
127#define RW_L5 0x14
128#define RW_L6 0x18
129#define RW_L7 0x1c
130#define RW_I0 0x20
131#define RW_I1 0x24
132#define RW_I2 0x28
133#define RW_I3 0x2c
134#define RW_I4 0x30
135#define RW_I5 0x34
136#define RW_I6 0x38
137#define RW_I7 0x3c
138
139
140#define SF_L0 0x00
141#define SF_L1 0x04
142#define SF_L2 0x08
143#define SF_L3 0x0c
144#define SF_L4 0x10
145#define SF_L5 0x14
146#define SF_L6 0x18
147#define SF_L7 0x1c
148#define SF_I0 0x20
149#define SF_I1 0x24
150#define SF_I2 0x28
151#define SF_I3 0x2c
152#define SF_I4 0x30
153#define SF_I5 0x34
154#define SF_FP 0x38
155#define SF_PC 0x3c
156#define SF_RETP 0x40
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
164
165
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
178
179#define PTRACE_GETUCODE 29
180
181#endif
182