1#ifndef _ASM_IA64_PTRACE_H
2#define _ASM_IA64_PTRACE_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51#include <linux/config.h>
52
53#include <asm/fpu.h>
54#include <asm/offsets.h>
55
56
57
58
59
60#if defined(CONFIG_IA64_PAGE_SIZE_4KB)
61# define IA64_TASK_STRUCT_LOG_NUM_PAGES 3
62#elif defined(CONFIG_IA64_PAGE_SIZE_8KB)
63# define IA64_TASK_STRUCT_LOG_NUM_PAGES 2
64#elif defined(CONFIG_IA64_PAGE_SIZE_16KB)
65# define IA64_TASK_STRUCT_LOG_NUM_PAGES 1
66#else
67# define IA64_TASK_STRUCT_LOG_NUM_PAGES 0
68#endif
69
70#define IA64_RBS_OFFSET ((IA64_TASK_SIZE + 15) & ~15)
71#define IA64_STK_OFFSET ((1 << IA64_TASK_STRUCT_LOG_NUM_PAGES)*PAGE_SIZE)
72
73#define INIT_TASK_SIZE IA64_STK_OFFSET
74
75#ifndef __ASSEMBLY__
76
77#include <asm/current.h>
78#include <asm/page.h>
79
80
81
82
83
84
85
86
87
88
89
90
91
92struct pt_regs {
93
94
95 unsigned long cr_ipsr;
96 unsigned long cr_iip;
97 unsigned long cr_ifs;
98
99 unsigned long ar_unat;
100 unsigned long ar_pfs;
101 unsigned long ar_rsc;
102
103 unsigned long ar_rnat;
104 unsigned long ar_bspstore;
105
106 unsigned long pr;
107 unsigned long b6;
108 unsigned long loadrs;
109
110 unsigned long r1;
111 unsigned long r2;
112 unsigned long r3;
113 unsigned long r12;
114 unsigned long r13;
115 unsigned long r14;
116 unsigned long r15;
117
118 unsigned long r8;
119 unsigned long r9;
120 unsigned long r10;
121 unsigned long r11;
122
123
124
125 unsigned long r16;
126 unsigned long r17;
127 unsigned long r18;
128 unsigned long r19;
129 unsigned long r20;
130 unsigned long r21;
131 unsigned long r22;
132 unsigned long r23;
133 unsigned long r24;
134 unsigned long r25;
135 unsigned long r26;
136 unsigned long r27;
137 unsigned long r28;
138 unsigned long r29;
139 unsigned long r30;
140 unsigned long r31;
141
142 unsigned long ar_ccv;
143 unsigned long ar_fpsr;
144
145 unsigned long b0;
146 unsigned long b7;
147
148
149
150
151 struct ia64_fpreg f6;
152 struct ia64_fpreg f7;
153 struct ia64_fpreg f8;
154 struct ia64_fpreg f9;
155};
156
157
158
159
160
161
162struct switch_stack {
163 unsigned long caller_unat;
164 unsigned long ar_fpsr;
165
166 struct ia64_fpreg f2;
167 struct ia64_fpreg f3;
168 struct ia64_fpreg f4;
169 struct ia64_fpreg f5;
170
171 struct ia64_fpreg f10;
172 struct ia64_fpreg f11;
173 struct ia64_fpreg f12;
174 struct ia64_fpreg f13;
175 struct ia64_fpreg f14;
176 struct ia64_fpreg f15;
177 struct ia64_fpreg f16;
178 struct ia64_fpreg f17;
179 struct ia64_fpreg f18;
180 struct ia64_fpreg f19;
181 struct ia64_fpreg f20;
182 struct ia64_fpreg f21;
183 struct ia64_fpreg f22;
184 struct ia64_fpreg f23;
185 struct ia64_fpreg f24;
186 struct ia64_fpreg f25;
187 struct ia64_fpreg f26;
188 struct ia64_fpreg f27;
189 struct ia64_fpreg f28;
190 struct ia64_fpreg f29;
191 struct ia64_fpreg f30;
192 struct ia64_fpreg f31;
193
194 unsigned long r4;
195 unsigned long r5;
196 unsigned long r6;
197 unsigned long r7;
198
199 unsigned long b0;
200 unsigned long b1;
201 unsigned long b2;
202 unsigned long b3;
203 unsigned long b4;
204 unsigned long b5;
205
206 unsigned long ar_pfs;
207 unsigned long ar_lc;
208 unsigned long ar_unat;
209 unsigned long ar_rnat;
210 unsigned long ar_bspstore;
211 unsigned long pr;
212};
213
214#ifdef __KERNEL__
215
216# define ia64_task_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
217# define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr)
218# define user_mode(regs) (((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0)
219
220 struct task_struct;
221
222 extern void show_regs (struct pt_regs *);
223 extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *,
224 unsigned long *);
225 extern long ia64_peek (struct task_struct *, struct switch_stack *, unsigned long,
226 unsigned long, long *);
227 extern long ia64_poke (struct task_struct *, struct switch_stack *, unsigned long,
228 unsigned long, long);
229 extern void ia64_flush_fph (struct task_struct *);
230 extern void ia64_sync_fph (struct task_struct *);
231 extern long ia64_sync_user_rbs (struct task_struct *, struct switch_stack *,
232 unsigned long, unsigned long);
233
234
235 extern unsigned long ia64_get_scratch_nat_bits (struct pt_regs *pt, unsigned long scratch_unat);
236
237 extern unsigned long ia64_put_scratch_nat_bits (struct pt_regs *pt, unsigned long nat);
238
239 extern void ia64_increment_ip (struct pt_regs *pt);
240 extern void ia64_decrement_ip (struct pt_regs *pt);
241
242static inline void
243force_successful_syscall_return (void)
244{
245 ia64_task_regs(current)->r8 = 0;
246}
247
248#endif
249
250#endif
251
252
253
254
255
256#define PTRACE_SINGLEBLOCK 12
257#define PTRACE_GETSIGINFO 13
258#define PTRACE_SETSIGINFO 14
259
260#endif
261