1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#ifndef _BLACKFIN_PTRACE_H
26#define _BLACKFIN_PTRACE_H
27
28#define NEW_PT_REGS
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44#if defined(NEW_PT_REGS)
45
46#define PT_IPEND 0
47#define PT_SYSCFG (PT_IPEND+4)
48#define PT_SEQSTAT (PT_SYSCFG+4)
49#define PT_RETE (PT_SEQSTAT+4)
50#define PT_RETN (PT_RETE+4)
51#define PT_RETX (PT_RETN+4)
52#define PT_RETI (PT_RETX+4)
53#define PT_PC PT_RETI
54#define PT_RETS (PT_RETI+4)
55#define PT_RESERVED (PT_RETS+4)
56#define PT_ASTAT (PT_RESERVED+4)
57#define PT_LB1 (PT_ASTAT+4)
58#define PT_LB0 (PT_LB1+4)
59#define PT_LT1 (PT_LB0+4)
60#define PT_LT0 (PT_LT1+4)
61#define PT_LC1 (PT_LT0+4)
62#define PT_LC0 (PT_LC1+4)
63#define PT_A1W (PT_LC0+4)
64#define PT_A1X (PT_A1W+4)
65#define PT_A0W (PT_A1X+4)
66#define PT_A0X (PT_A0W+4)
67#define PT_B3 (PT_A0X+4)
68#define PT_B2 (PT_B3+4)
69#define PT_B1 (PT_B2+4)
70#define PT_B0 (PT_B1+4)
71#define PT_L3 (PT_B0+4)
72#define PT_L2 (PT_L3+4)
73#define PT_L1 (PT_L2+4)
74#define PT_L0 (PT_L1+4)
75#define PT_M3 (PT_L0+4)
76#define PT_M2 (PT_M3+4)
77#define PT_M1 (PT_M2+4)
78#define PT_M0 (PT_M1+4)
79#define PT_I3 (PT_M0+4)
80#define PT_I2 (PT_I3+4)
81#define PT_I1 (PT_I2+4)
82#define PT_I0 (PT_I1+4)
83#define PT_USP (PT_I0+4)
84#define PT_FP (PT_USP+4)
85#define PT_P5 (PT_FP+4)
86#define PT_P4 (PT_P5+4)
87#define PT_P3 (PT_P4+4)
88#define PT_P2 (PT_P3+4)
89#define PT_P1 (PT_P2+4)
90#define PT_P0 (PT_P1+4)
91#define PT_R7 (PT_P0+4)
92#define PT_R6 (PT_R7+4)
93#define PT_R5 (PT_R6+4)
94#define PT_R4 (PT_R5+4)
95#define PT_R3 (PT_R4+4)
96#define PT_R2 (PT_R3+4)
97#define PT_R1 (PT_R2+4)
98#define PT_R0 (PT_R1+4)
99#define PT_ORIG_R0 (PT_R0+4)
100#define PT_SR PT_SEQSTAT
101
102#else
103
104
105
106
107
108#define PT_R3 0
109#define PT_R4 4
110#define PT_R2 8
111#define PT_R1 12
112#define PT_P5 16
113#define PT_P4 20
114#define PT_P3 24
115#define PT_P2 28
116#define PT_P1 32
117#define PT_P0 36
118#define PT_R7 40
119#define PT_R6 44
120#define PT_R5 48
121#define PT_PC 52
122#define PT_SEQSTAT 56
123#define PT_SR PT_SEQSTAT
124#define PT_ASTAT 60
125#define PT_RETS 64
126#define PT_A1w 68
127#define PT_A0w 72
128#define PT_A1x 76
129#define PT_A0x 80
130#define PT_ORIG_R0 84
131#define PT_R0 88
132#define PT_USP 92
133#define PT_FP 96
134#define PT_SP 100
135
136
137#define PT_IPEND 100
138
139
140#define PT_SYSCFG 104
141
142#endif
143
144#ifndef __ASSEMBLY__
145
146#if defined(NEW_PT_REGS)
147
148
149
150struct pt_regs {
151 long ipend;
152 long syscfg;
153 long seqstat;
154 long rete;
155 long retn;
156 long retx;
157 long pc;
158 long rets;
159 long reserved;
160 long astat;
161 long lb1;
162 long lb0;
163 long lt1;
164 long lt0;
165 long lc1;
166 long lc0;
167 long a1w;
168 long a1x;
169 long a0w;
170 long a0x;
171 long b3;
172 long b2;
173 long b1;
174 long b0;
175 long l3;
176 long l2;
177 long l1;
178 long l0;
179 long m3;
180 long m2;
181 long m1;
182 long m0;
183 long i3;
184 long i2;
185 long i1;
186 long i0;
187 long usp;
188 long fp;
189 long p5;
190 long p4;
191 long p3;
192 long p2;
193 long p1;
194 long p0;
195 long r7;
196 long r6;
197 long r5;
198 long r4;
199 long r3;
200 long r2;
201 long r1;
202 long r0;
203 long orig_r0;
204};
205
206#else
207
208struct pt_regs {
209 long r3;
210 long r4;
211 long r2;
212 long r1;
213 long p5;
214 long p4;
215 long p3;
216 long p2;
217 long p1;
218 long p0;
219 long r7;
220 long r6;
221 long r5;
222 unsigned long pc;
223 unsigned long seqstat;
224 unsigned long astat;
225 unsigned long rets;
226 long a1w;
227 long a0w;
228 long a1x;
229 long a0x;
230 long orig_r0;
231 long r0;
232 long usp;
233 long fp;
234
235
236
237
238
239 long ipend;
240 long syscfg;
241};
242
243#endif
244
245
246#define PTRACE_GETREGS 12
247#define PTRACE_SETREGS 13
248
249#ifdef __KERNEL__
250
251#ifndef PS_S
252#define PS_S (0x0c00)
253
254
255
256
257
258
259
260#define PS_M (0x1000)
261#endif
262
263#define user_mode(regs) (!((regs)->seqstat & PS_S))
264#define instruction_pointer(regs) ((regs)->pc)
265extern void show_regs(struct pt_regs *);
266
267#endif
268#endif
269#endif
270