22 #include <linux/ptrace.h>
23 #include <linux/reboot.h>
24 #include <linux/slab.h>
26 #include <linux/module.h>
28 #include <asm/syscalls.h>
29 #include <asm/uaccess.h>
30 #include <asm/pgtable.h>
31 #include <asm/mmu_context.h>
33 #include <asm/switch_to.h>
40 unsigned long long ah, al, bh,
bl, ch,
cl;
44 ah = (regs->
pc) >> 32;
45 al = (regs->
pc) & 0xffffffff;
46 bh = (regs->
regs[18]) >> 32;
47 bl = (regs->
regs[18]) & 0xffffffff;
48 ch = (regs->
regs[15]) >> 32;
49 cl = (regs->
regs[15]) & 0xffffffff;
50 printk(
"PC : %08Lx%08Lx LINK: %08Lx%08Lx SP : %08Lx%08Lx\n",
51 ah, al, bh, bl, ch, cl);
53 ah = (regs->
sr) >> 32;
54 al = (regs->
sr) & 0xffffffff;
55 asm volatile (
"getcon " __TEA ", %0" :
"=r" (bh));
56 asm volatile (
"getcon " __TEA ", %0" :
"=r" (
bl));
58 bl = (
bl) & 0xffffffff;
59 asm volatile (
"getcon " __KCR0 ", %0" :
"=r" (ch));
60 asm volatile (
"getcon " __KCR0 ", %0" :
"=r" (
cl));
62 cl = (
cl) & 0xffffffff;
63 printk(
"SR : %08Lx%08Lx TEA : %08Lx%08Lx KCR0: %08Lx%08Lx\n",
64 ah, al, bh, bl, ch, cl);
66 ah = (regs->
regs[0]) >> 32;
67 al = (regs->
regs[0]) & 0xffffffff;
68 bh = (regs->
regs[1]) >> 32;
69 bl = (regs->
regs[1]) & 0xffffffff;
70 ch = (regs->
regs[2]) >> 32;
71 cl = (regs->
regs[2]) & 0xffffffff;
72 printk(
"R0 : %08Lx%08Lx R1 : %08Lx%08Lx R2 : %08Lx%08Lx\n",
73 ah, al, bh, bl, ch, cl);
75 ah = (regs->
regs[3]) >> 32;
76 al = (regs->
regs[3]) & 0xffffffff;
77 bh = (regs->
regs[4]) >> 32;
78 bl = (regs->
regs[4]) & 0xffffffff;
79 ch = (regs->
regs[5]) >> 32;
80 cl = (regs->
regs[5]) & 0xffffffff;
81 printk(
"R3 : %08Lx%08Lx R4 : %08Lx%08Lx R5 : %08Lx%08Lx\n",
82 ah, al, bh, bl, ch, cl);
84 ah = (regs->
regs[6]) >> 32;
85 al = (regs->
regs[6]) & 0xffffffff;
86 bh = (regs->
regs[7]) >> 32;
87 bl = (regs->
regs[7]) & 0xffffffff;
88 ch = (regs->
regs[8]) >> 32;
89 cl = (regs->
regs[8]) & 0xffffffff;
90 printk(
"R6 : %08Lx%08Lx R7 : %08Lx%08Lx R8 : %08Lx%08Lx\n",
91 ah, al, bh, bl, ch, cl);
93 ah = (regs->
regs[9]) >> 32;
94 al = (regs->
regs[9]) & 0xffffffff;
95 bh = (regs->
regs[10]) >> 32;
96 bl = (regs->
regs[10]) & 0xffffffff;
97 ch = (regs->
regs[11]) >> 32;
98 cl = (regs->
regs[11]) & 0xffffffff;
99 printk(
"R9 : %08Lx%08Lx R10 : %08Lx%08Lx R11 : %08Lx%08Lx\n",
100 ah, al, bh, bl, ch, cl);
102 ah = (regs->
regs[12]) >> 32;
103 al = (regs->
regs[12]) & 0xffffffff;
104 bh = (regs->
regs[13]) >> 32;
105 bl = (regs->
regs[13]) & 0xffffffff;
106 ch = (regs->
regs[14]) >> 32;
107 cl = (regs->
regs[14]) & 0xffffffff;
108 printk(
"R12 : %08Lx%08Lx R13 : %08Lx%08Lx R14 : %08Lx%08Lx\n",
109 ah, al, bh, bl, ch, cl);
111 ah = (regs->
regs[16]) >> 32;
112 al = (regs->
regs[16]) & 0xffffffff;
113 bh = (regs->
regs[17]) >> 32;
114 bl = (regs->
regs[17]) & 0xffffffff;
115 ch = (regs->
regs[19]) >> 32;
116 cl = (regs->
regs[19]) & 0xffffffff;
117 printk(
"R16 : %08Lx%08Lx R17 : %08Lx%08Lx R19 : %08Lx%08Lx\n",
118 ah, al, bh, bl, ch, cl);
120 ah = (regs->
regs[20]) >> 32;
121 al = (regs->
regs[20]) & 0xffffffff;
122 bh = (regs->
regs[21]) >> 32;
123 bl = (regs->
regs[21]) & 0xffffffff;
124 ch = (regs->
regs[22]) >> 32;
125 cl = (regs->
regs[22]) & 0xffffffff;
126 printk(
"R20 : %08Lx%08Lx R21 : %08Lx%08Lx R22 : %08Lx%08Lx\n",
127 ah, al, bh, bl, ch, cl);
129 ah = (regs->
regs[23]) >> 32;
130 al = (regs->
regs[23]) & 0xffffffff;
131 bh = (regs->
regs[24]) >> 32;
132 bl = (regs->
regs[24]) & 0xffffffff;
133 ch = (regs->
regs[25]) >> 32;
134 cl = (regs->
regs[25]) & 0xffffffff;
135 printk(
"R23 : %08Lx%08Lx R24 : %08Lx%08Lx R25 : %08Lx%08Lx\n",
136 ah, al, bh, bl, ch, cl);
138 ah = (regs->
regs[26]) >> 32;
139 al = (regs->
regs[26]) & 0xffffffff;
140 bh = (regs->
regs[27]) >> 32;
141 bl = (regs->
regs[27]) & 0xffffffff;
142 ch = (regs->
regs[28]) >> 32;
143 cl = (regs->
regs[28]) & 0xffffffff;
144 printk(
"R26 : %08Lx%08Lx R27 : %08Lx%08Lx R28 : %08Lx%08Lx\n",
145 ah, al, bh, bl, ch, cl);
147 ah = (regs->
regs[29]) >> 32;
148 al = (regs->
regs[29]) & 0xffffffff;
149 bh = (regs->
regs[30]) >> 32;
150 bl = (regs->
regs[30]) & 0xffffffff;
151 ch = (regs->
regs[31]) >> 32;
152 cl = (regs->
regs[31]) & 0xffffffff;
153 printk(
"R29 : %08Lx%08Lx R30 : %08Lx%08Lx R31 : %08Lx%08Lx\n",
154 ah, al, bh, bl, ch, cl);
156 ah = (regs->
regs[32]) >> 32;
157 al = (regs->
regs[32]) & 0xffffffff;
158 bh = (regs->
regs[33]) >> 32;
159 bl = (regs->
regs[33]) & 0xffffffff;
160 ch = (regs->
regs[34]) >> 32;
161 cl = (regs->
regs[34]) & 0xffffffff;
162 printk(
"R32 : %08Lx%08Lx R33 : %08Lx%08Lx R34 : %08Lx%08Lx\n",
163 ah, al, bh, bl, ch, cl);
165 ah = (regs->
regs[35]) >> 32;
166 al = (regs->
regs[35]) & 0xffffffff;
167 bh = (regs->
regs[36]) >> 32;
168 bl = (regs->
regs[36]) & 0xffffffff;
169 ch = (regs->
regs[37]) >> 32;
170 cl = (regs->
regs[37]) & 0xffffffff;
171 printk(
"R35 : %08Lx%08Lx R36 : %08Lx%08Lx R37 : %08Lx%08Lx\n",
172 ah, al, bh, bl, ch, cl);
174 ah = (regs->
regs[38]) >> 32;
175 al = (regs->
regs[38]) & 0xffffffff;
176 bh = (regs->
regs[39]) >> 32;
177 bl = (regs->
regs[39]) & 0xffffffff;
178 ch = (regs->
regs[40]) >> 32;
179 cl = (regs->
regs[40]) & 0xffffffff;
180 printk(
"R38 : %08Lx%08Lx R39 : %08Lx%08Lx R40 : %08Lx%08Lx\n",
181 ah, al, bh, bl, ch, cl);
183 ah = (regs->
regs[41]) >> 32;
184 al = (regs->
regs[41]) & 0xffffffff;
185 bh = (regs->
regs[42]) >> 32;
186 bl = (regs->
regs[42]) & 0xffffffff;
187 ch = (regs->
regs[43]) >> 32;
188 cl = (regs->
regs[43]) & 0xffffffff;
189 printk(
"R41 : %08Lx%08Lx R42 : %08Lx%08Lx R43 : %08Lx%08Lx\n",
190 ah, al, bh, bl, ch, cl);
192 ah = (regs->
regs[44]) >> 32;
193 al = (regs->
regs[44]) & 0xffffffff;
194 bh = (regs->
regs[45]) >> 32;
195 bl = (regs->
regs[45]) & 0xffffffff;
196 ch = (regs->
regs[46]) >> 32;
197 cl = (regs->
regs[46]) & 0xffffffff;
198 printk(
"R44 : %08Lx%08Lx R45 : %08Lx%08Lx R46 : %08Lx%08Lx\n",
199 ah, al, bh, bl, ch, cl);
201 ah = (regs->
regs[47]) >> 32;
202 al = (regs->
regs[47]) & 0xffffffff;
203 bh = (regs->
regs[48]) >> 32;
204 bl = (regs->
regs[48]) & 0xffffffff;
205 ch = (regs->
regs[49]) >> 32;
206 cl = (regs->
regs[49]) & 0xffffffff;
207 printk(
"R47 : %08Lx%08Lx R48 : %08Lx%08Lx R49 : %08Lx%08Lx\n",
208 ah, al, bh, bl, ch, cl);
210 ah = (regs->
regs[50]) >> 32;
211 al = (regs->
regs[50]) & 0xffffffff;
212 bh = (regs->
regs[51]) >> 32;
213 bl = (regs->
regs[51]) & 0xffffffff;
214 ch = (regs->
regs[52]) >> 32;
215 cl = (regs->
regs[52]) & 0xffffffff;
216 printk(
"R50 : %08Lx%08Lx R51 : %08Lx%08Lx R52 : %08Lx%08Lx\n",
217 ah, al, bh, bl, ch, cl);
219 ah = (regs->
regs[53]) >> 32;
220 al = (regs->
regs[53]) & 0xffffffff;
221 bh = (regs->
regs[54]) >> 32;
222 bl = (regs->
regs[54]) & 0xffffffff;
223 ch = (regs->
regs[55]) >> 32;
224 cl = (regs->
regs[55]) & 0xffffffff;
225 printk(
"R53 : %08Lx%08Lx R54 : %08Lx%08Lx R55 : %08Lx%08Lx\n",
226 ah, al, bh, bl, ch, cl);
228 ah = (regs->
regs[56]) >> 32;
229 al = (regs->
regs[56]) & 0xffffffff;
230 bh = (regs->
regs[57]) >> 32;
231 bl = (regs->
regs[57]) & 0xffffffff;
232 ch = (regs->
regs[58]) >> 32;
233 cl = (regs->
regs[58]) & 0xffffffff;
234 printk(
"R56 : %08Lx%08Lx R57 : %08Lx%08Lx R58 : %08Lx%08Lx\n",
235 ah, al, bh, bl, ch, cl);
237 ah = (regs->
regs[59]) >> 32;
238 al = (regs->
regs[59]) & 0xffffffff;
239 bh = (regs->
regs[60]) >> 32;
240 bl = (regs->
regs[60]) & 0xffffffff;
241 ch = (regs->
regs[61]) >> 32;
242 cl = (regs->
regs[61]) & 0xffffffff;
243 printk(
"R59 : %08Lx%08Lx R60 : %08Lx%08Lx R61 : %08Lx%08Lx\n",
244 ah, al, bh, bl, ch, cl);
246 ah = (regs->
regs[62]) >> 32;
247 al = (regs->
regs[62]) & 0xffffffff;
248 bh = (regs->
tregs[0]) >> 32;
249 bl = (regs->
tregs[0]) & 0xffffffff;
250 ch = (regs->
tregs[1]) >> 32;
251 cl = (regs->
tregs[1]) & 0xffffffff;
252 printk(
"R62 : %08Lx%08Lx T0 : %08Lx%08Lx T1 : %08Lx%08Lx\n",
253 ah, al, bh, bl, ch, cl);
255 ah = (regs->
tregs[2]) >> 32;
256 al = (regs->
tregs[2]) & 0xffffffff;
257 bh = (regs->
tregs[3]) >> 32;
258 bl = (regs->
tregs[3]) & 0xffffffff;
259 ch = (regs->
tregs[4]) >> 32;
260 cl = (regs->
tregs[4]) & 0xffffffff;
261 printk(
"T2 : %08Lx%08Lx T3 : %08Lx%08Lx T4 : %08Lx%08Lx\n",
262 ah, al, bh, bl, ch, cl);
264 ah = (regs->
tregs[5]) >> 32;
265 al = (regs->
tregs[5]) & 0xffffffff;
266 bh = (regs->
tregs[6]) >> 32;
267 bl = (regs->
tregs[6]) & 0xffffffff;
268 ch = (regs->
tregs[7]) >> 32;
269 cl = (regs->
tregs[7]) & 0xffffffff;
270 printk(
"T5 : %08Lx%08Lx T6 : %08Lx%08Lx T7 : %08Lx%08Lx\n",
271 ah, al, bh, bl, ch, cl);
278 unsigned long sp = regs->
regs[15] & 0xffffffff;
307 memset(®s, 0,
sizeof(regs));
342 if (last_task_used_math ==
current) {
343 last_task_used_math =
NULL;
354 if (last_task_used_math ==
current) {
355 last_task_used_math =
NULL;
364 if(
current->thread.kregs==&fake_swapper_regs) {
385 if (
current == last_task_used_math) {
389 last_task_used_math = 0;
393 memcpy(fpu, &tsk->
thread.xstate->hardfpu,
sizeof(*fpu));
412 if(last_task_used_math ==
current) {
416 last_task_used_math =
NULL;
432 childregs->
regs[15] = neff_sign_extend(usp);
433 p->
thread.uregs = childregs;
435 childregs->
regs[15] =
440 childregs->
regs[9] = 0;
450 unsigned long r4,
unsigned long r5,
451 unsigned long r6,
unsigned long r7,
458 unsigned long r4,
unsigned long r5,
459 unsigned long r6,
unsigned long r7,
463 newsp = pregs->
regs[15];
464 return do_fork(clone_flags, newsp, pregs, 0, 0, 0);
478 unsigned long r4,
unsigned long r5,
479 unsigned long r6,
unsigned long r7,
489 char **uenvp,
unsigned long r5,
490 unsigned long r6,
unsigned long r7,
497 error = PTR_ERR(filename);
498 if (IS_ERR(filename))
510 #ifdef CONFIG_FRAME_POINTER
511 static int in_sh64_switch_to(
unsigned long pc)
513 extern char __sh64_switch_to_end;
517 (pc < (
unsigned long) &__sh64_switch_to_end);
533 #ifdef CONFIG_FRAME_POINTER
534 if (in_sh64_switch_to(pc)) {
535 unsigned long schedule_fp;
536 unsigned long sh64_switch_to_fp;
537 unsigned long schedule_caller_pc;
541 schedule_fp = *(
unsigned long *) (
long)(sh64_switch_to_fp + 4);
545 schedule_caller_pc = *(
unsigned long *) (
long)(schedule_fp + 24);
546 return schedule_caller_pc;