Commit | Line | Data |
---|---|---|
1394f032 BW |
1 | /* |
2 | * File: arch/blackfin/mach-common/entry.S | |
3 | * Based on: | |
4 | * Author: Linus Torvalds | |
5 | * | |
6 | * Created: ? | |
7 | * Description: contains the system-call and fault low-level handling routines. | |
8 | * This also contains the timer-interrupt handler, as well as all | |
9 | * interrupts and faults that can result in a task-switch. | |
10 | * | |
11 | * Modified: | |
12 | * Copyright 2004-2006 Analog Devices Inc. | |
13 | * | |
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | |
15 | * | |
16 | * This program is free software; you can redistribute it and/or modify | |
17 | * it under the terms of the GNU General Public License as published by | |
18 | * the Free Software Foundation; either version 2 of the License, or | |
19 | * (at your option) any later version. | |
20 | * | |
21 | * This program is distributed in the hope that it will be useful, | |
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
24 | * GNU General Public License for more details. | |
25 | * | |
26 | * You should have received a copy of the GNU General Public License | |
27 | * along with this program; if not, see the file COPYING, or write | |
28 | * to the Free Software Foundation, Inc., | |
29 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
30 | */ | |
31 | ||
32 | /* | |
33 | * 25-Dec-2004 - LG Soft India | |
34 | * 1. Fix in return_from_int, to make sure any pending | |
35 | * system call in ILAT for this process to get | |
36 | * executed, otherwise in case context switch happens, | |
37 | * system call of first process (i.e in ILAT) will be | |
38 | * carried forward to the switched process. | |
39 | * 2. Removed Constant references for the following | |
40 | * a. IPEND | |
41 | * b. EXCAUSE mask | |
42 | * c. PAGE Mask | |
43 | */ | |
44 | ||
45 | /* | |
46 | * NOTE: This code handles signal-recognition, which happens every time | |
47 | * after a timer-interrupt and after each system call. | |
48 | */ | |
49 | ||
50 | ||
51 | #include <linux/linkage.h> | |
52 | #include <asm/blackfin.h> | |
53 | #include <asm/unistd.h> | |
54 | #include <asm/errno.h> | |
55 | #include <asm/thread_info.h> /* TIF_NEED_RESCHED */ | |
56 | #include <asm/asm-offsets.h> | |
57 | ||
58 | #include <asm/mach-common/context.S> | |
59 | ||
60 | #ifdef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE | |
61 | /* | |
62 | * TODO: this should be proper save/restore, but for now | |
63 | * we'll just cheat and use 0x1/0x13 | |
64 | */ | |
65 | # define DEBUG_START_HWTRACE \ | |
66 | P5.l = LO(TBUFCTL); \ | |
67 | P5.h = HI(TBUFCTL); \ | |
68 | R7 = 0x13; \ | |
69 | [P5] = R7; | |
70 | # define DEBUG_STOP_HWTRACE \ | |
71 | P5.l = LO(TBUFCTL); \ | |
72 | P5.h = HI(TBUFCTL); \ | |
73 | R7 = 0x01; \ | |
74 | [P5] = R7; | |
75 | #else | |
76 | # define DEBUG_START_HWTRACE | |
77 | # define DEBUG_STOP_HWTRACE | |
78 | #endif | |
79 | ||
80 | #ifdef CONFIG_EXCPT_IRQ_SYSC_L1 | |
81 | .section .l1.text | |
82 | #else | |
83 | .text | |
84 | #endif | |
85 | ||
86 | /* Slightly simplified and streamlined entry point for CPLB misses. | |
87 | * This one does not lower the level to IRQ5, and thus can be used to | |
88 | * patch up CPLB misses on the kernel stack. | |
89 | */ | |
90 | ENTRY(_ex_dcplb) | |
91 | #if defined(ANOMALY_05000261) | |
92 | /* | |
93 | * Work around an anomaly: if we see a new DCPLB fault, return | |
94 | * without doing anything. Then, if we get the same fault again, | |
95 | * handle it. | |
96 | */ | |
97 | p5.l = _last_cplb_fault_retx; | |
98 | p5.h = _last_cplb_fault_retx; | |
99 | r7 = [p5]; | |
100 | r6 = retx; | |
101 | [p5] = r6; | |
102 | cc = r6 == r7; | |
103 | if !cc jump _return_from_exception; | |
104 | /* fall through */ | |
105 | #endif | |
51be24c3 | 106 | ENDPROC(_ex_dcplb) |
1394f032 BW |
107 | |
108 | ENTRY(_ex_icplb) | |
109 | (R7:6,P5:4) = [sp++]; | |
110 | ASTAT = [sp++]; | |
111 | SAVE_ALL_SYS | |
112 | call __cplb_hdr; | |
113 | DEBUG_START_HWTRACE | |
114 | RESTORE_ALL_SYS | |
115 | SP = RETN; | |
116 | rtx; | |
51be24c3 | 117 | ENDPROC(_ex_icplb) |
1394f032 BW |
118 | |
119 | ENTRY(_ex_spinlock) | |
120 | /* Transform this into a syscall - twiddle the syscall vector. */ | |
121 | p5.l = lo(EVT15); | |
122 | p5.h = hi(EVT15); | |
123 | r7.l = _spinlock_bh; | |
124 | r7.h = _spinlock_bh; | |
125 | [p5] = r7; | |
126 | csync; | |
127 | /* Fall through. */ | |
51be24c3 | 128 | ENDPROC(_ex_spinlock) |
1394f032 BW |
129 | |
130 | ENTRY(_ex_syscall) | |
131 | DEBUG_START_HWTRACE | |
132 | (R7:6,P5:4) = [sp++]; | |
133 | ASTAT = [sp++]; | |
134 | raise 15; /* invoked by TRAP #0, for sys call */ | |
135 | sp = retn; | |
136 | rtx | |
51be24c3 | 137 | ENDPROC(_ex_syscall) |
1394f032 BW |
138 | |
139 | ENTRY(_spinlock_bh) | |
140 | SAVE_ALL_SYS | |
141 | /* To end up here, vector 15 was changed - so we have to change it | |
142 | * back. | |
143 | */ | |
144 | p0.l = lo(EVT15); | |
145 | p0.h = hi(EVT15); | |
146 | p1.l = _evt_system_call; | |
147 | p1.h = _evt_system_call; | |
148 | [p0] = p1; | |
149 | csync; | |
150 | r0 = [sp + PT_R0]; | |
151 | sp += -12; | |
152 | call _sys_bfin_spinlock; | |
153 | sp += 12; | |
154 | [SP + PT_R0] = R0; | |
155 | RESTORE_ALL_SYS | |
156 | rti; | |
51be24c3 | 157 | ENDPROC(_spinlock_bh) |
1394f032 BW |
158 | |
159 | ENTRY(_ex_soft_bp) | |
160 | r7 = retx; | |
161 | r7 += -2; | |
162 | retx = r7; | |
163 | jump.s _ex_trap_c; | |
51be24c3 | 164 | ENDPROC(_ex_soft_bp) |
1394f032 BW |
165 | |
166 | ENTRY(_ex_single_step) | |
167 | r7 = retx; | |
168 | r6 = reti; | |
169 | cc = r7 == r6; | |
170 | if cc jump _return_from_exception | |
171 | r7 = syscfg; | |
172 | bitclr (r7, 0); | |
173 | syscfg = R7; | |
174 | ||
175 | p5.l = lo(IPEND); | |
176 | p5.h = hi(IPEND); | |
177 | r6 = [p5]; | |
178 | cc = bittst(r6, 5); | |
179 | if !cc jump _ex_trap_c; | |
180 | p4.l = lo(EVT5); | |
181 | p4.h = hi(EVT5); | |
182 | r6.h = _exception_to_level5; | |
183 | r6.l = _exception_to_level5; | |
184 | r7 = [p4]; | |
185 | cc = r6 == r7; | |
186 | if !cc jump _ex_trap_c; | |
187 | ||
188 | _return_from_exception: | |
189 | DEBUG_START_HWTRACE | |
8af10b79 MH |
190 | #ifdef ANOMALY_05000257 |
191 | R7=LC0; | |
192 | LC0=R7; | |
193 | R7=LC1; | |
194 | LC1=R7; | |
195 | #endif | |
1394f032 BW |
196 | (R7:6,P5:4) = [sp++]; |
197 | ASTAT = [sp++]; | |
198 | sp = retn; | |
199 | rtx; | |
51be24c3 | 200 | ENDPROC(_ex_soft_bp) |
1394f032 BW |
201 | |
202 | ENTRY(_handle_bad_cplb) | |
203 | /* To get here, we just tried and failed to change a CPLB | |
204 | * so, handle things in trap_c (C code), by lowering to | |
205 | * IRQ5, just like we normally do. Since this is not a | |
206 | * "normal" return path, we have a do alot of stuff to | |
207 | * the stack to get ready so, we can fall through - we | |
208 | * need to make a CPLB exception look like a normal exception | |
209 | */ | |
210 | ||
211 | DEBUG_START_HWTRACE | |
212 | RESTORE_ALL_SYS | |
213 | [--sp] = ASTAT; | |
214 | [--sp] = (R7:6, P5:4); | |
215 | ||
216 | ENTRY(_ex_trap_c) | |
217 | /* Call C code (trap_c) to handle the exception, which most | |
218 | * likely involves sending a signal to the current process. | |
219 | * To avoid double faults, lower our priority to IRQ5 first. | |
220 | */ | |
221 | P5.h = _exception_to_level5; | |
222 | P5.l = _exception_to_level5; | |
223 | p4.l = lo(EVT5); | |
224 | p4.h = hi(EVT5); | |
225 | [p4] = p5; | |
226 | csync; | |
227 | ||
228 | /* Disable all interrupts, but make sure level 5 is enabled so | |
229 | * we can switch to that level. Save the old mask. */ | |
230 | cli r6; | |
231 | p4.l = _excpt_saved_imask; | |
232 | p4.h = _excpt_saved_imask; | |
233 | [p4] = r6; | |
234 | r6 = 0x3f; | |
235 | sti r6; | |
236 | ||
237 | /* Save the excause into a circular buffer, in case the instruction | |
238 | * which caused this excecptions causes others. | |
239 | */ | |
240 | P5.l = _in_ptr_excause; | |
241 | P5.h = _in_ptr_excause; | |
242 | R7 = [P5]; | |
243 | R7 += 4; | |
244 | R6 = 0xF; | |
245 | R7 = R7 & R6; | |
246 | [P5] = R7; | |
247 | R6.l = _excause_circ_buf; | |
248 | R6.h = _excause_circ_buf; | |
249 | R7 = R7 + R6; | |
250 | p5 = R7; | |
251 | R6 = SEQSTAT; | |
252 | [P5] = R6; | |
253 | ||
254 | DEBUG_START_HWTRACE | |
255 | (R7:6,P5:4) = [sp++]; | |
256 | ASTAT = [sp++]; | |
257 | SP = RETN; | |
258 | raise 5; | |
259 | rtx; | |
51be24c3 | 260 | ENDPROC(_ex_trap_c) |
1394f032 BW |
261 | |
262 | ENTRY(_exception_to_level5) | |
263 | SAVE_ALL_SYS | |
264 | ||
265 | /* Restore interrupt mask. We haven't pushed RETI, so this | |
266 | * doesn't enable interrupts until we return from this handler. */ | |
267 | p4.l = _excpt_saved_imask; | |
268 | p4.h = _excpt_saved_imask; | |
269 | r6 = [p4]; | |
270 | sti r6; | |
271 | ||
272 | /* Restore the hardware error vector. */ | |
273 | P5.h = _evt_ivhw; | |
274 | P5.l = _evt_ivhw; | |
275 | p4.l = lo(EVT5); | |
276 | p4.h = hi(EVT5); | |
277 | [p4] = p5; | |
278 | csync; | |
279 | ||
280 | p2.l = lo(IPEND); | |
281 | p2.h = hi(IPEND); | |
282 | csync; | |
283 | r0 = [p2]; /* Read current IPEND */ | |
284 | [sp + PT_IPEND] = r0; /* Store IPEND */ | |
285 | ||
286 | /* Pop the excause from the circular buffer and push it on the stack | |
287 | * (in the right place - if you change the location of SEQSTAT, you | |
288 | * must change this offset. | |
289 | */ | |
290 | .L_excep_to_5_again: | |
291 | P5.l = _out_ptr_excause; | |
292 | P5.h = _out_ptr_excause; | |
293 | R7 = [P5]; | |
294 | R7 += 4; | |
295 | R6 = 0xF; | |
296 | R7 = R7 & R6; | |
297 | [P5] = R7; | |
298 | R6.l = _excause_circ_buf; | |
299 | R6.h = _excause_circ_buf; | |
300 | R7 = R7 + R6; | |
301 | P5 = R7; | |
302 | R1 = [P5]; | |
303 | [SP + 8] = r1; | |
304 | ||
305 | r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */ | |
306 | SP += -12; | |
307 | call _trap_c; | |
308 | SP += 12; | |
309 | ||
310 | /* See if anything else is in the exception buffer | |
311 | * if there is, process it | |
312 | */ | |
313 | P5.l = _out_ptr_excause; | |
314 | P5.h = _out_ptr_excause; | |
315 | P4.l = _in_ptr_excause; | |
316 | P4.h = _in_ptr_excause; | |
317 | R6 = [P5]; | |
318 | R7 = [P4]; | |
319 | CC = R6 == R7; | |
320 | if ! CC JUMP .L_excep_to_5_again | |
321 | ||
322 | call _ret_from_exception; | |
323 | RESTORE_ALL_SYS | |
324 | rti; | |
51be24c3 | 325 | ENDPROC(_exception_to_level5) |
1394f032 BW |
326 | |
327 | ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/ | |
328 | /* Since the kernel stack can be anywhere, it's not guaranteed to be | |
329 | * covered by a CPLB. Switch to an exception stack; use RETN as a | |
330 | * scratch register (for want of a better option). | |
331 | */ | |
332 | retn = sp; | |
333 | sp.l = _exception_stack_top; | |
334 | sp.h = _exception_stack_top; | |
335 | /* Try to deal with syscalls quickly. */ | |
336 | [--sp] = ASTAT; | |
337 | [--sp] = (R7:6, P5:4); | |
338 | DEBUG_STOP_HWTRACE | |
339 | r7 = SEQSTAT; /* reason code is in bit 5:0 */ | |
340 | r6.l = lo(SEQSTAT_EXCAUSE); | |
341 | r6.h = hi(SEQSTAT_EXCAUSE); | |
342 | r7 = r7 & r6; | |
343 | p5.h = _extable; | |
344 | p5.l = _extable; | |
345 | p4 = r7; | |
346 | p5 = p5 + (p4 << 2); | |
347 | p4 = [p5]; | |
348 | jump (p4); | |
349 | ||
350 | .Lbadsys: | |
351 | r7 = -ENOSYS; /* signextending enough */ | |
352 | [sp + PT_R0] = r7; /* return value from system call */ | |
353 | jump .Lsyscall_really_exit; | |
51be24c3 | 354 | ENDPROC(_trap) |
1394f032 BW |
355 | |
356 | ENTRY(_kernel_execve) | |
357 | link SIZEOF_PTREGS; | |
358 | p0 = sp; | |
359 | r3 = SIZEOF_PTREGS / 4; | |
360 | r4 = 0(x); | |
361 | 0: | |
362 | [p0++] = r4; | |
363 | r3 += -1; | |
364 | cc = r3 == 0; | |
365 | if !cc jump 0b (bp); | |
366 | ||
367 | p0 = sp; | |
368 | sp += -16; | |
369 | [sp + 12] = p0; | |
370 | call _do_execve; | |
371 | SP += 16; | |
372 | cc = r0 == 0; | |
373 | if ! cc jump 1f; | |
374 | /* Success. Copy our temporary pt_regs to the top of the kernel | |
375 | * stack and do a normal exception return. | |
376 | */ | |
377 | r1 = sp; | |
378 | r0 = (-KERNEL_STACK_SIZE) (x); | |
379 | r1 = r1 & r0; | |
380 | p2 = r1; | |
381 | p3 = [p2]; | |
382 | r0 = KERNEL_STACK_SIZE - 4 (z); | |
383 | p1 = r0; | |
384 | p1 = p1 + p2; | |
385 | ||
386 | p0 = fp; | |
387 | r4 = [p0--]; | |
388 | r3 = SIZEOF_PTREGS / 4; | |
389 | 0: | |
390 | r4 = [p0--]; | |
391 | [p1--] = r4; | |
392 | r3 += -1; | |
393 | cc = r3 == 0; | |
394 | if ! cc jump 0b (bp); | |
395 | ||
396 | r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z); | |
397 | p1 = r0; | |
398 | p1 = p1 + p2; | |
399 | sp = p1; | |
400 | r0 = syscfg; | |
401 | [SP + PT_SYSCFG] = r0; | |
402 | [p3 + (TASK_THREAD + THREAD_KSP)] = sp; | |
403 | ||
404 | RESTORE_CONTEXT; | |
405 | rti; | |
406 | 1: | |
407 | unlink; | |
408 | rts; | |
51be24c3 | 409 | ENDPROC(_kernel_execve) |
1394f032 BW |
410 | |
411 | ENTRY(_system_call) | |
412 | /* Store IPEND */ | |
413 | p2.l = lo(IPEND); | |
414 | p2.h = hi(IPEND); | |
415 | csync; | |
416 | r0 = [p2]; | |
417 | [sp + PT_IPEND] = r0; | |
418 | ||
419 | /* Store RETS for now */ | |
420 | r0 = rets; | |
421 | [sp + PT_RESERVED] = r0; | |
422 | /* Set the stack for the current process */ | |
423 | r7 = sp; | |
424 | r6.l = lo(ALIGN_PAGE_MASK); | |
425 | r6.h = hi(ALIGN_PAGE_MASK); | |
426 | r7 = r7 & r6; /* thread_info */ | |
427 | p2 = r7; | |
428 | p2 = [p2]; | |
429 | ||
430 | [p2+(TASK_THREAD+THREAD_KSP)] = sp; | |
431 | ||
432 | /* Check the System Call */ | |
433 | r7 = __NR_syscall; | |
434 | /* System call number is passed in P0 */ | |
435 | r6 = p0; | |
436 | cc = r6 < r7; | |
437 | if ! cc jump .Lbadsys; | |
438 | ||
439 | /* are we tracing syscalls?*/ | |
440 | r7 = sp; | |
441 | r6.l = lo(ALIGN_PAGE_MASK); | |
442 | r6.h = hi(ALIGN_PAGE_MASK); | |
443 | r7 = r7 & r6; | |
444 | p2 = r7; | |
445 | r7 = [p2+TI_FLAGS]; | |
446 | CC = BITTST(r7,TIF_SYSCALL_TRACE); | |
447 | if CC JUMP _sys_trace; | |
448 | ||
449 | /* Execute the appropriate system call */ | |
450 | ||
451 | p4 = p0; | |
452 | p5.l = _sys_call_table; | |
453 | p5.h = _sys_call_table; | |
454 | p5 = p5 + (p4 << 2); | |
455 | r0 = [sp + PT_R0]; | |
456 | r1 = [sp + PT_R1]; | |
457 | r2 = [sp + PT_R2]; | |
458 | p5 = [p5]; | |
459 | ||
460 | [--sp] = r5; | |
461 | [--sp] = r4; | |
462 | [--sp] = r3; | |
463 | SP += -12; | |
464 | call (p5); | |
465 | SP += 24; | |
466 | [sp + PT_R0] = r0; | |
467 | ||
468 | .Lresume_userspace: | |
469 | r7 = sp; | |
470 | r4.l = lo(ALIGN_PAGE_MASK); | |
471 | r4.h = hi(ALIGN_PAGE_MASK); | |
472 | r7 = r7 & r4; /* thread_info->flags */ | |
473 | p5 = r7; | |
474 | .Lresume_userspace_1: | |
475 | /* Disable interrupts. */ | |
476 | [--sp] = reti; | |
477 | reti = [sp++]; | |
478 | ||
479 | r7 = [p5 + TI_FLAGS]; | |
480 | r4.l = lo(_TIF_WORK_MASK); | |
481 | r4.h = hi(_TIF_WORK_MASK); | |
482 | r7 = r7 & r4; | |
483 | ||
484 | .Lsyscall_resched: | |
485 | cc = BITTST(r7, TIF_NEED_RESCHED); | |
486 | if !cc jump .Lsyscall_sigpending; | |
487 | ||
488 | /* Reenable interrupts. */ | |
489 | [--sp] = reti; | |
490 | r0 = [sp++]; | |
491 | ||
492 | SP += -12; | |
493 | call _schedule; | |
494 | SP += 12; | |
495 | ||
496 | jump .Lresume_userspace_1; | |
497 | ||
498 | .Lsyscall_sigpending: | |
499 | cc = BITTST(r7, TIF_RESTORE_SIGMASK); | |
500 | if cc jump .Lsyscall_do_signals; | |
501 | cc = BITTST(r7, TIF_SIGPENDING); | |
502 | if !cc jump .Lsyscall_really_exit; | |
503 | .Lsyscall_do_signals: | |
504 | /* Reenable interrupts. */ | |
505 | [--sp] = reti; | |
506 | r0 = [sp++]; | |
507 | ||
508 | r0 = sp; | |
509 | SP += -12; | |
510 | call _do_signal; | |
511 | SP += 12; | |
512 | ||
513 | .Lsyscall_really_exit: | |
514 | r5 = [sp + PT_RESERVED]; | |
515 | rets = r5; | |
516 | rts; | |
51be24c3 | 517 | ENDPROC(_system_call) |
1394f032 BW |
518 | |
519 | _sys_trace: | |
520 | call _syscall_trace; | |
521 | ||
522 | /* Execute the appropriate system call */ | |
523 | ||
524 | p4 = [SP + PT_P0]; | |
525 | p5.l = _sys_call_table; | |
526 | p5.h = _sys_call_table; | |
527 | p5 = p5 + (p4 << 2); | |
528 | r0 = [sp + PT_R0]; | |
529 | r1 = [sp + PT_R1]; | |
530 | r2 = [sp + PT_R2]; | |
531 | r3 = [sp + PT_R3]; | |
532 | r4 = [sp + PT_R4]; | |
533 | r5 = [sp + PT_R5]; | |
534 | p5 = [p5]; | |
535 | ||
536 | [--sp] = r5; | |
537 | [--sp] = r4; | |
538 | [--sp] = r3; | |
539 | SP += -12; | |
540 | call (p5); | |
541 | SP += 24; | |
542 | [sp + PT_R0] = r0; | |
543 | ||
544 | call _syscall_trace; | |
545 | jump .Lresume_userspace; | |
51be24c3 | 546 | ENDPROC(_sys_trace) |
1394f032 BW |
547 | |
548 | ENTRY(_resume) | |
549 | /* | |
550 | * Beware - when entering resume, prev (the current task) is | |
551 | * in r0, next (the new task) is in r1. | |
552 | */ | |
553 | p0 = r0; | |
554 | p1 = r1; | |
555 | [--sp] = rets; | |
556 | [--sp] = fp; | |
557 | [--sp] = (r7:4, p5:3); | |
558 | ||
559 | /* save usp */ | |
560 | p2 = usp; | |
561 | [p0+(TASK_THREAD+THREAD_USP)] = p2; | |
562 | ||
563 | /* save current kernel stack pointer */ | |
564 | [p0+(TASK_THREAD+THREAD_KSP)] = sp; | |
565 | ||
566 | /* save program counter */ | |
567 | r1.l = _new_old_task; | |
568 | r1.h = _new_old_task; | |
569 | [p0+(TASK_THREAD+THREAD_PC)] = r1; | |
570 | ||
571 | /* restore the kernel stack pointer */ | |
572 | sp = [p1+(TASK_THREAD+THREAD_KSP)]; | |
573 | ||
574 | /* restore user stack pointer */ | |
575 | p0 = [p1+(TASK_THREAD+THREAD_USP)]; | |
576 | usp = p0; | |
577 | ||
578 | /* restore pc */ | |
579 | p0 = [p1+(TASK_THREAD+THREAD_PC)]; | |
580 | jump (p0); | |
581 | ||
582 | /* | |
583 | * Following code actually lands up in a new (old) task. | |
584 | */ | |
585 | ||
586 | _new_old_task: | |
587 | (r7:4, p5:3) = [sp++]; | |
588 | fp = [sp++]; | |
589 | rets = [sp++]; | |
590 | ||
591 | /* | |
592 | * When we come out of resume, r0 carries "old" task, becuase we are | |
593 | * in "new" task. | |
594 | */ | |
595 | rts; | |
51be24c3 | 596 | ENDPROC(_resume) |
1394f032 BW |
597 | |
598 | ENTRY(_ret_from_exception) | |
599 | p2.l = lo(IPEND); | |
600 | p2.h = hi(IPEND); | |
601 | ||
602 | csync; | |
603 | r0 = [p2]; | |
604 | [sp + PT_IPEND] = r0; | |
605 | ||
606 | 1: | |
607 | r1 = 0x37(Z); | |
608 | r2 = ~r1; | |
609 | r2.h = 0; | |
610 | r0 = r2 & r0; | |
611 | cc = r0 == 0; | |
612 | if !cc jump 4f; /* if not return to user mode, get out */ | |
613 | ||
614 | /* Make sure any pending system call or deferred exception | |
615 | * return in ILAT for this process to get executed, otherwise | |
616 | * in case context switch happens, system call of | |
617 | * first process (i.e in ILAT) will be carried | |
618 | * forward to the switched process | |
619 | */ | |
620 | ||
621 | p2.l = lo(ILAT); | |
622 | p2.h = hi(ILAT); | |
623 | r0 = [p2]; | |
624 | r1 = (EVT_IVG14 | EVT_IVG15) (z); | |
625 | r0 = r0 & r1; | |
626 | cc = r0 == 0; | |
627 | if !cc jump 5f; | |
628 | ||
629 | /* Set the stack for the current process */ | |
630 | r7 = sp; | |
631 | r4.l = lo(ALIGN_PAGE_MASK); | |
632 | r4.h = hi(ALIGN_PAGE_MASK); | |
633 | r7 = r7 & r4; /* thread_info->flags */ | |
634 | p5 = r7; | |
635 | r7 = [p5 + TI_FLAGS]; | |
636 | r4.l = lo(_TIF_WORK_MASK); | |
637 | r4.h = hi(_TIF_WORK_MASK); | |
638 | r7 = r7 & r4; | |
639 | cc = r7 == 0; | |
640 | if cc jump 4f; | |
641 | ||
642 | p0.l = lo(EVT15); | |
643 | p0.h = hi(EVT15); | |
644 | p1.l = _schedule_and_signal; | |
645 | p1.h = _schedule_and_signal; | |
646 | [p0] = p1; | |
647 | csync; | |
648 | raise 15; /* raise evt14 to do signal or reschedule */ | |
649 | 4: | |
650 | r0 = syscfg; | |
651 | bitclr(r0, 0); | |
652 | syscfg = r0; | |
653 | 5: | |
654 | rts; | |
51be24c3 | 655 | ENDPROC(_ret_from_exception) |
1394f032 BW |
656 | |
657 | ENTRY(_return_from_int) | |
658 | /* If someone else already raised IRQ 15, do nothing. */ | |
659 | csync; | |
660 | p2.l = lo(ILAT); | |
661 | p2.h = hi(ILAT); | |
662 | r0 = [p2]; | |
663 | cc = bittst (r0, EVT_IVG15_P); | |
664 | if cc jump 2f; | |
665 | ||
666 | /* if not return to user mode, get out */ | |
667 | p2.l = lo(IPEND); | |
668 | p2.h = hi(IPEND); | |
669 | r0 = [p2]; | |
670 | r1 = 0x17(Z); | |
671 | r2 = ~r1; | |
672 | r2.h = 0; | |
673 | r0 = r2 & r0; | |
674 | r1 = 1; | |
675 | r1 = r0 - r1; | |
676 | r2 = r0 & r1; | |
677 | cc = r2 == 0; | |
678 | if !cc jump 2f; | |
679 | ||
680 | /* Lower the interrupt level to 15. */ | |
681 | p0.l = lo(EVT15); | |
682 | p0.h = hi(EVT15); | |
683 | p1.l = _schedule_and_signal_from_int; | |
684 | p1.h = _schedule_and_signal_from_int; | |
685 | [p0] = p1; | |
686 | csync; | |
687 | #if defined(ANOMALY_05000281) | |
688 | r0.l = lo(CONFIG_BOOT_LOAD); | |
689 | r0.h = hi(CONFIG_BOOT_LOAD); | |
690 | reti = r0; | |
691 | #endif | |
692 | r0 = 0x801f (z); | |
693 | STI r0; | |
694 | raise 15; /* raise evt15 to do signal or reschedule */ | |
695 | rti; | |
696 | 2: | |
697 | rts; | |
51be24c3 | 698 | ENDPROC(_return_from_int) |
1394f032 BW |
699 | |
700 | ENTRY(_lower_to_irq14) | |
701 | #if defined(ANOMALY_05000281) | |
702 | r0.l = lo(CONFIG_BOOT_LOAD); | |
703 | r0.h = hi(CONFIG_BOOT_LOAD); | |
704 | reti = r0; | |
705 | #endif | |
706 | r0 = 0x401f; | |
707 | sti r0; | |
708 | raise 14; | |
709 | rti; | |
710 | ENTRY(_evt14_softirq) | |
711 | #ifdef CONFIG_DEBUG_HWERR | |
712 | r0 = 0x3f; | |
713 | sti r0; | |
714 | #else | |
715 | cli r0; | |
716 | #endif | |
717 | [--sp] = RETI; | |
718 | SP += 4; | |
719 | rts; | |
720 | ||
721 | _schedule_and_signal_from_int: | |
722 | /* To end up here, vector 15 was changed - so we have to change it | |
723 | * back. | |
724 | */ | |
725 | p0.l = lo(EVT15); | |
726 | p0.h = hi(EVT15); | |
727 | p1.l = _evt_system_call; | |
728 | p1.h = _evt_system_call; | |
729 | [p0] = p1; | |
730 | csync; | |
c824498d BS |
731 | |
732 | /* Set orig_p0 to -1 to indicate this isn't the end of a syscall. */ | |
733 | r0 = -1 (x); | |
734 | [sp + PT_ORIG_P0] = r0; | |
735 | ||
1394f032 BW |
736 | p1 = rets; |
737 | [sp + PT_RESERVED] = p1; | |
738 | ||
739 | p0.l = _irq_flags; | |
740 | p0.h = _irq_flags; | |
741 | r0 = [p0]; | |
742 | sti r0; | |
743 | ||
744 | jump.s .Lresume_userspace; | |
745 | ||
746 | _schedule_and_signal: | |
747 | SAVE_CONTEXT_SYSCALL | |
748 | /* To end up here, vector 15 was changed - so we have to change it | |
749 | * back. | |
750 | */ | |
751 | p0.l = lo(EVT15); | |
752 | p0.h = hi(EVT15); | |
753 | p1.l = _evt_system_call; | |
754 | p1.h = _evt_system_call; | |
755 | [p0] = p1; | |
756 | csync; | |
757 | p0.l = 1f; | |
758 | p0.h = 1f; | |
759 | [sp + PT_RESERVED] = P0; | |
760 | call .Lresume_userspace; | |
761 | 1: | |
762 | RESTORE_CONTEXT | |
763 | rti; | |
51be24c3 | 764 | ENDPROC(_lower_to_irq14) |
1394f032 BW |
765 | |
766 | /* Make sure when we start, that the circular buffer is initialized properly | |
767 | * R0 and P0 are call clobbered, so we can use them here. | |
768 | */ | |
769 | ENTRY(_init_exception_buff) | |
770 | r0 = 0; | |
771 | p0.h = _in_ptr_excause; | |
772 | p0.l = _in_ptr_excause; | |
773 | [p0] = r0; | |
774 | p0.h = _out_ptr_excause; | |
775 | p0.l = _out_ptr_excause; | |
776 | [p0] = r0; | |
777 | rts; | |
51be24c3 | 778 | ENDPROC(_init_exception_buff) |
1394f032 BW |
779 | |
780 | /* | |
781 | * Put these in the kernel data section - that should always be covered by | |
782 | * a CPLB. This is needed to ensure we don't get double fault conditions | |
783 | */ | |
784 | ||
785 | #ifdef CONFIG_SYSCALL_TAB_L1 | |
786 | .section .l1.data | |
787 | #else | |
788 | .data | |
789 | #endif | |
790 | ALIGN | |
791 | _extable: | |
792 | /* entry for each EXCAUSE[5:0] | |
793 | * This table bmust be in sync with the table in ./kernel/traps.c | |
794 | * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined | |
795 | */ | |
796 | .long _ex_syscall; /* 0x00 - User Defined - Linux Syscall */ | |
797 | .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */ | |
798 | .long _ex_trap_c /* 0x02 - User Defined */ | |
799 | .long _ex_trap_c /* 0x03 - User Defined - Atomic test and set service */ | |
800 | .long _ex_spinlock /* 0x04 - User Defined */ | |
801 | .long _ex_trap_c /* 0x05 - User Defined */ | |
802 | .long _ex_trap_c /* 0x06 - User Defined */ | |
803 | .long _ex_trap_c /* 0x07 - User Defined */ | |
804 | .long _ex_trap_c /* 0x08 - User Defined */ | |
805 | .long _ex_trap_c /* 0x09 - User Defined */ | |
806 | .long _ex_trap_c /* 0x0A - User Defined */ | |
807 | .long _ex_trap_c /* 0x0B - User Defined */ | |
808 | .long _ex_trap_c /* 0x0C - User Defined */ | |
809 | .long _ex_trap_c /* 0x0D - User Defined */ | |
810 | .long _ex_trap_c /* 0x0E - User Defined */ | |
811 | .long _ex_trap_c /* 0x0F - User Defined */ | |
812 | .long _ex_single_step /* 0x10 - HW Single step */ | |
813 | .long _ex_trap_c /* 0x11 - Trace Buffer Full */ | |
814 | .long _ex_trap_c /* 0x12 - Reserved */ | |
815 | .long _ex_trap_c /* 0x13 - Reserved */ | |
816 | .long _ex_trap_c /* 0x14 - Reserved */ | |
817 | .long _ex_trap_c /* 0x15 - Reserved */ | |
818 | .long _ex_trap_c /* 0x16 - Reserved */ | |
819 | .long _ex_trap_c /* 0x17 - Reserved */ | |
820 | .long _ex_trap_c /* 0x18 - Reserved */ | |
821 | .long _ex_trap_c /* 0x19 - Reserved */ | |
822 | .long _ex_trap_c /* 0x1A - Reserved */ | |
823 | .long _ex_trap_c /* 0x1B - Reserved */ | |
824 | .long _ex_trap_c /* 0x1C - Reserved */ | |
825 | .long _ex_trap_c /* 0x1D - Reserved */ | |
826 | .long _ex_trap_c /* 0x1E - Reserved */ | |
827 | .long _ex_trap_c /* 0x1F - Reserved */ | |
828 | .long _ex_trap_c /* 0x20 - Reserved */ | |
829 | .long _ex_trap_c /* 0x21 - Undefined Instruction */ | |
830 | .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */ | |
831 | .long _ex_dcplb /* 0x23 - Data CPLB Protection Violation */ | |
832 | .long _ex_trap_c /* 0x24 - Data access misaligned */ | |
833 | .long _ex_trap_c /* 0x25 - Unrecoverable Event */ | |
834 | .long _ex_dcplb /* 0x26 - Data CPLB Miss */ | |
835 | .long _ex_trap_c /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */ | |
836 | .long _ex_trap_c /* 0x28 - Emulation Watchpoint */ | |
837 | .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */ | |
838 | .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */ | |
839 | .long _ex_icplb /* 0x2B - Instruction CPLB protection Violation */ | |
840 | .long _ex_icplb /* 0x2C - Instruction CPLB miss */ | |
841 | .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */ | |
842 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ | |
843 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ | |
844 | .long _ex_trap_c /* 0x2F - Reserved */ | |
845 | .long _ex_trap_c /* 0x30 - Reserved */ | |
846 | .long _ex_trap_c /* 0x31 - Reserved */ | |
847 | .long _ex_trap_c /* 0x32 - Reserved */ | |
848 | .long _ex_trap_c /* 0x33 - Reserved */ | |
849 | .long _ex_trap_c /* 0x34 - Reserved */ | |
850 | .long _ex_trap_c /* 0x35 - Reserved */ | |
851 | .long _ex_trap_c /* 0x36 - Reserved */ | |
852 | .long _ex_trap_c /* 0x37 - Reserved */ | |
853 | .long _ex_trap_c /* 0x38 - Reserved */ | |
854 | .long _ex_trap_c /* 0x39 - Reserved */ | |
855 | .long _ex_trap_c /* 0x3A - Reserved */ | |
856 | .long _ex_trap_c /* 0x3B - Reserved */ | |
857 | .long _ex_trap_c /* 0x3C - Reserved */ | |
858 | .long _ex_trap_c /* 0x3D - Reserved */ | |
859 | .long _ex_trap_c /* 0x3E - Reserved */ | |
860 | .long _ex_trap_c /* 0x3F - Reserved */ | |
861 | ||
862 | ALIGN | |
863 | ENTRY(_sys_call_table) | |
864 | .long _sys_ni_syscall /* 0 - old "setup()" system call*/ | |
865 | .long _sys_exit | |
866 | .long _sys_fork | |
867 | .long _sys_read | |
868 | .long _sys_write | |
869 | .long _sys_open /* 5 */ | |
870 | .long _sys_close | |
871 | .long _sys_ni_syscall /* old waitpid */ | |
872 | .long _sys_creat | |
873 | .long _sys_link | |
874 | .long _sys_unlink /* 10 */ | |
875 | .long _sys_execve | |
876 | .long _sys_chdir | |
877 | .long _sys_time | |
878 | .long _sys_mknod | |
879 | .long _sys_chmod /* 15 */ | |
880 | .long _sys_chown /* chown16 */ | |
881 | .long _sys_ni_syscall /* old break syscall holder */ | |
882 | .long _sys_ni_syscall /* old stat */ | |
883 | .long _sys_lseek | |
884 | .long _sys_getpid /* 20 */ | |
885 | .long _sys_mount | |
886 | .long _sys_ni_syscall /* old umount */ | |
887 | .long _sys_setuid | |
888 | .long _sys_getuid | |
889 | .long _sys_stime /* 25 */ | |
890 | .long _sys_ptrace | |
891 | .long _sys_alarm | |
892 | .long _sys_ni_syscall /* old fstat */ | |
893 | .long _sys_pause | |
894 | .long _sys_ni_syscall /* old utime */ /* 30 */ | |
895 | .long _sys_ni_syscall /* old stty syscall holder */ | |
896 | .long _sys_ni_syscall /* old gtty syscall holder */ | |
897 | .long _sys_access | |
898 | .long _sys_nice | |
899 | .long _sys_ni_syscall /* 35 */ /* old ftime syscall holder */ | |
900 | .long _sys_sync | |
901 | .long _sys_kill | |
902 | .long _sys_rename | |
903 | .long _sys_mkdir | |
904 | .long _sys_rmdir /* 40 */ | |
905 | .long _sys_dup | |
906 | .long _sys_pipe | |
907 | .long _sys_times | |
908 | .long _sys_ni_syscall /* old prof syscall holder */ | |
909 | .long _sys_brk /* 45 */ | |
910 | .long _sys_setgid | |
911 | .long _sys_getgid | |
912 | .long _sys_ni_syscall /* old sys_signal */ | |
913 | .long _sys_geteuid /* geteuid16 */ | |
914 | .long _sys_getegid /* getegid16 */ /* 50 */ | |
915 | .long _sys_acct | |
916 | .long _sys_umount /* recycled never used phys() */ | |
917 | .long _sys_ni_syscall /* old lock syscall holder */ | |
918 | .long _sys_ioctl | |
919 | .long _sys_fcntl /* 55 */ | |
920 | .long _sys_ni_syscall /* old mpx syscall holder */ | |
921 | .long _sys_setpgid | |
922 | .long _sys_ni_syscall /* old ulimit syscall holder */ | |
923 | .long _sys_ni_syscall /* old old uname */ | |
924 | .long _sys_umask /* 60 */ | |
925 | .long _sys_chroot | |
926 | .long _sys_ustat | |
927 | .long _sys_dup2 | |
928 | .long _sys_getppid | |
929 | .long _sys_getpgrp /* 65 */ | |
930 | .long _sys_setsid | |
931 | .long _sys_ni_syscall /* old sys_sigaction */ | |
932 | .long _sys_sgetmask | |
933 | .long _sys_ssetmask | |
934 | .long _sys_setreuid /* setreuid16 */ /* 70 */ | |
935 | .long _sys_setregid /* setregid16 */ | |
936 | .long _sys_ni_syscall /* old sys_sigsuspend */ | |
937 | .long _sys_ni_syscall /* old sys_sigpending */ | |
938 | .long _sys_sethostname | |
939 | .long _sys_setrlimit /* 75 */ | |
940 | .long _sys_ni_syscall /* old getrlimit */ | |
941 | .long _sys_getrusage | |
942 | .long _sys_gettimeofday | |
943 | .long _sys_settimeofday | |
944 | .long _sys_getgroups /* getgroups16 */ /* 80 */ | |
945 | .long _sys_setgroups /* setgroups16 */ | |
946 | .long _sys_ni_syscall /* old_select */ | |
947 | .long _sys_symlink | |
948 | .long _sys_ni_syscall /* old lstat */ | |
949 | .long _sys_readlink /* 85 */ | |
950 | .long _sys_uselib | |
951 | .long _sys_ni_syscall /* sys_swapon */ | |
952 | .long _sys_reboot | |
953 | .long _sys_ni_syscall /* old_readdir */ | |
954 | .long _sys_ni_syscall /* sys_mmap */ /* 90 */ | |
955 | .long _sys_munmap | |
956 | .long _sys_truncate | |
957 | .long _sys_ftruncate | |
958 | .long _sys_fchmod | |
959 | .long _sys_fchown /* fchown16 */ /* 95 */ | |
960 | .long _sys_getpriority | |
961 | .long _sys_setpriority | |
962 | .long _sys_ni_syscall /* old profil syscall holder */ | |
963 | .long _sys_statfs | |
964 | .long _sys_fstatfs /* 100 */ | |
965 | .long _sys_ni_syscall | |
966 | .long _sys_ni_syscall /* old sys_socketcall */ | |
967 | .long _sys_syslog | |
968 | .long _sys_setitimer | |
969 | .long _sys_getitimer /* 105 */ | |
970 | .long _sys_newstat | |
971 | .long _sys_newlstat | |
972 | .long _sys_newfstat | |
973 | .long _sys_ni_syscall /* old uname */ | |
974 | .long _sys_ni_syscall /* iopl for i386 */ /* 110 */ | |
975 | .long _sys_vhangup | |
976 | .long _sys_ni_syscall /* obsolete idle() syscall */ | |
977 | .long _sys_ni_syscall /* vm86old for i386 */ | |
978 | .long _sys_wait4 | |
979 | .long _sys_ni_syscall /* 115 */ /* sys_swapoff */ | |
980 | .long _sys_sysinfo | |
981 | .long _sys_ni_syscall /* old sys_ipc */ | |
982 | .long _sys_fsync | |
983 | .long _sys_ni_syscall /* old sys_sigreturn */ | |
984 | .long _sys_clone /* 120 */ | |
985 | .long _sys_setdomainname | |
986 | .long _sys_newuname | |
987 | .long _sys_ni_syscall /* old sys_modify_ldt */ | |
988 | .long _sys_adjtimex | |
989 | .long _sys_ni_syscall /* 125 */ /* sys_mprotect */ | |
990 | .long _sys_ni_syscall /* old sys_sigprocmask */ | |
991 | .long _sys_ni_syscall /* old "creat_module" */ | |
992 | .long _sys_init_module | |
993 | .long _sys_delete_module | |
994 | .long _sys_ni_syscall /* 130: old "get_kernel_syms" */ | |
995 | .long _sys_quotactl | |
996 | .long _sys_getpgid | |
997 | .long _sys_fchdir | |
998 | .long _sys_bdflush | |
999 | .long _sys_ni_syscall /* 135 */ /* sys_sysfs */ | |
1000 | .long _sys_personality | |
1001 | .long _sys_ni_syscall /* for afs_syscall */ | |
1002 | .long _sys_setfsuid /* setfsuid16 */ | |
1003 | .long _sys_setfsgid /* setfsgid16 */ | |
1004 | .long _sys_llseek /* 140 */ | |
1005 | .long _sys_getdents | |
1006 | .long _sys_ni_syscall /* sys_select */ | |
1007 | .long _sys_flock | |
1008 | .long _sys_ni_syscall /* sys_msync */ | |
1009 | .long _sys_readv /* 145 */ | |
1010 | .long _sys_writev | |
1011 | .long _sys_getsid | |
1012 | .long _sys_fdatasync | |
1013 | .long _sys_sysctl | |
1014 | .long _sys_ni_syscall /* 150 */ /* sys_mlock */ | |
1015 | .long _sys_ni_syscall /* sys_munlock */ | |
1016 | .long _sys_ni_syscall /* sys_mlockall */ | |
1017 | .long _sys_ni_syscall /* sys_munlockall */ | |
1018 | .long _sys_sched_setparam | |
1019 | .long _sys_sched_getparam /* 155 */ | |
1020 | .long _sys_sched_setscheduler | |
1021 | .long _sys_sched_getscheduler | |
1022 | .long _sys_sched_yield | |
1023 | .long _sys_sched_get_priority_max | |
1024 | .long _sys_sched_get_priority_min /* 160 */ | |
1025 | .long _sys_sched_rr_get_interval | |
1026 | .long _sys_nanosleep | |
1027 | .long _sys_ni_syscall /* sys_mremap */ | |
1028 | .long _sys_setresuid /* setresuid16 */ | |
1029 | .long _sys_getresuid /* getresuid16 */ /* 165 */ | |
1030 | .long _sys_ni_syscall /* for vm86 */ | |
1031 | .long _sys_ni_syscall /* old "query_module" */ | |
1032 | .long _sys_ni_syscall /* sys_poll */ | |
1033 | .long _sys_ni_syscall /* sys_nfsservctl */ | |
1034 | .long _sys_setresgid /* setresgid16 */ /* 170 */ | |
1035 | .long _sys_getresgid /* getresgid16 */ | |
1036 | .long _sys_prctl | |
1037 | .long _sys_rt_sigreturn | |
1038 | .long _sys_rt_sigaction | |
1039 | .long _sys_rt_sigprocmask /* 175 */ | |
1040 | .long _sys_rt_sigpending | |
1041 | .long _sys_rt_sigtimedwait | |
1042 | .long _sys_rt_sigqueueinfo | |
1043 | .long _sys_rt_sigsuspend | |
1044 | .long _sys_pread64 /* 180 */ | |
1045 | .long _sys_pwrite64 | |
1046 | .long _sys_lchown /* lchown16 */ | |
1047 | .long _sys_getcwd | |
1048 | .long _sys_capget | |
1049 | .long _sys_capset /* 185 */ | |
1050 | .long _sys_sigaltstack | |
1051 | .long _sys_sendfile | |
1052 | .long _sys_ni_syscall /* streams1 */ | |
1053 | .long _sys_ni_syscall /* streams2 */ | |
1054 | .long _sys_vfork /* 190 */ | |
1055 | .long _sys_getrlimit | |
1056 | .long _sys_mmap2 | |
1057 | .long _sys_truncate64 | |
1058 | .long _sys_ftruncate64 | |
1059 | .long _sys_stat64 /* 195 */ | |
1060 | .long _sys_lstat64 | |
1061 | .long _sys_fstat64 | |
1062 | .long _sys_chown | |
1063 | .long _sys_getuid | |
1064 | .long _sys_getgid /* 200 */ | |
1065 | .long _sys_geteuid | |
1066 | .long _sys_getegid | |
1067 | .long _sys_setreuid | |
1068 | .long _sys_setregid | |
1069 | .long _sys_getgroups /* 205 */ | |
1070 | .long _sys_setgroups | |
1071 | .long _sys_fchown | |
1072 | .long _sys_setresuid | |
1073 | .long _sys_getresuid | |
1074 | .long _sys_setresgid /* 210 */ | |
1075 | .long _sys_getresgid | |
1076 | .long _sys_lchown | |
1077 | .long _sys_setuid | |
1078 | .long _sys_setgid | |
1079 | .long _sys_setfsuid /* 215 */ | |
1080 | .long _sys_setfsgid | |
1081 | .long _sys_pivot_root | |
1082 | .long _sys_ni_syscall /* sys_mincore */ | |
1083 | .long _sys_ni_syscall /* sys_madvise */ | |
1084 | .long _sys_getdents64 /* 220 */ | |
1085 | .long _sys_fcntl64 | |
1086 | .long _sys_ni_syscall /* reserved for TUX */ | |
1087 | .long _sys_ni_syscall | |
1088 | .long _sys_gettid | |
1089 | .long _sys_ni_syscall /* 225 */ /* sys_readahead */ | |
1090 | .long _sys_setxattr | |
1091 | .long _sys_lsetxattr | |
1092 | .long _sys_fsetxattr | |
1093 | .long _sys_getxattr | |
1094 | .long _sys_lgetxattr /* 230 */ | |
1095 | .long _sys_fgetxattr | |
1096 | .long _sys_listxattr | |
1097 | .long _sys_llistxattr | |
1098 | .long _sys_flistxattr | |
1099 | .long _sys_removexattr /* 235 */ | |
1100 | .long _sys_lremovexattr | |
1101 | .long _sys_fremovexattr | |
1102 | .long _sys_tkill | |
1103 | .long _sys_sendfile64 | |
1104 | .long _sys_futex /* 240 */ | |
1105 | .long _sys_sched_setaffinity | |
1106 | .long _sys_sched_getaffinity | |
1107 | .long _sys_ni_syscall /* sys_set_thread_area */ | |
1108 | .long _sys_ni_syscall /* sys_get_thread_area */ | |
1109 | .long _sys_io_setup /* 245 */ | |
1110 | .long _sys_io_destroy | |
1111 | .long _sys_io_getevents | |
1112 | .long _sys_io_submit | |
1113 | .long _sys_io_cancel | |
1114 | .long _sys_ni_syscall /* 250 */ /* sys_alloc_hugepages */ | |
1115 | .long _sys_ni_syscall /* sys_freec_hugepages */ | |
1116 | .long _sys_exit_group | |
1117 | .long _sys_lookup_dcookie | |
1118 | .long _sys_bfin_spinlock | |
1119 | .long _sys_epoll_create /* 255 */ | |
1120 | .long _sys_epoll_ctl | |
1121 | .long _sys_epoll_wait | |
1122 | .long _sys_ni_syscall /* remap_file_pages */ | |
1123 | .long _sys_set_tid_address | |
1124 | .long _sys_timer_create /* 260 */ | |
1125 | .long _sys_timer_settime | |
1126 | .long _sys_timer_gettime | |
1127 | .long _sys_timer_getoverrun | |
1128 | .long _sys_timer_delete | |
1129 | .long _sys_clock_settime /* 265 */ | |
1130 | .long _sys_clock_gettime | |
1131 | .long _sys_clock_getres | |
1132 | .long _sys_clock_nanosleep | |
1133 | .long _sys_statfs64 | |
1134 | .long _sys_fstatfs64 /* 270 */ | |
1135 | .long _sys_tgkill | |
1136 | .long _sys_utimes | |
1137 | .long _sys_fadvise64_64 | |
1138 | .long _sys_ni_syscall /* vserver */ | |
1139 | .long _sys_ni_syscall /* 275, mbind */ | |
1140 | .long _sys_ni_syscall /* get_mempolicy */ | |
1141 | .long _sys_ni_syscall /* set_mempolicy */ | |
1142 | .long _sys_mq_open | |
1143 | .long _sys_mq_unlink | |
1144 | .long _sys_mq_timedsend /* 280 */ | |
1145 | .long _sys_mq_timedreceive | |
1146 | .long _sys_mq_notify | |
1147 | .long _sys_mq_getsetattr | |
1148 | .long _sys_ni_syscall /* kexec_load */ | |
1149 | .long _sys_waitid /* 285 */ | |
1150 | .long _sys_add_key | |
1151 | .long _sys_request_key | |
1152 | .long _sys_keyctl | |
1153 | .long _sys_ioprio_set | |
1154 | .long _sys_ioprio_get /* 290 */ | |
1155 | .long _sys_inotify_init | |
1156 | .long _sys_inotify_add_watch | |
1157 | .long _sys_inotify_rm_watch | |
1158 | .long _sys_ni_syscall /* migrate_pages */ | |
1159 | .long _sys_openat /* 295 */ | |
1160 | .long _sys_mkdirat | |
1161 | .long _sys_mknodat | |
1162 | .long _sys_fchownat | |
1163 | .long _sys_futimesat | |
1164 | .long _sys_fstatat64 /* 300 */ | |
1165 | .long _sys_unlinkat | |
1166 | .long _sys_renameat | |
1167 | .long _sys_linkat | |
1168 | .long _sys_symlinkat | |
1169 | .long _sys_readlinkat /* 305 */ | |
1170 | .long _sys_fchmodat | |
1171 | .long _sys_faccessat | |
1172 | .long _sys_pselect6 | |
1173 | .long _sys_ppoll | |
1174 | .long _sys_unshare /* 310 */ | |
1175 | .long _sys_sram_alloc | |
1176 | .long _sys_sram_free | |
1177 | .long _sys_dma_memcpy | |
1178 | .long _sys_accept | |
1179 | .long _sys_bind /* 315 */ | |
1180 | .long _sys_connect | |
1181 | .long _sys_getpeername | |
1182 | .long _sys_getsockname | |
1183 | .long _sys_getsockopt | |
1184 | .long _sys_listen /* 320 */ | |
1185 | .long _sys_recv | |
1186 | .long _sys_recvfrom | |
1187 | .long _sys_recvmsg | |
1188 | .long _sys_send | |
1189 | .long _sys_sendmsg /* 325 */ | |
1190 | .long _sys_sendto | |
1191 | .long _sys_setsockopt | |
1192 | .long _sys_shutdown | |
1193 | .long _sys_socket | |
1194 | .long _sys_socketpair /* 330 */ | |
1195 | .long _sys_semctl | |
1196 | .long _sys_semget | |
1197 | .long _sys_semop | |
1198 | .long _sys_msgctl | |
1199 | .long _sys_msgget /* 335 */ | |
1200 | .long _sys_msgrcv | |
1201 | .long _sys_msgsnd | |
1202 | .long _sys_shmat | |
1203 | .long _sys_shmctl | |
1204 | .long _sys_shmdt /* 340 */ | |
1205 | .long _sys_shmget | |
1206 | .rept NR_syscalls-(.-_sys_call_table)/4 | |
1207 | .long _sys_ni_syscall | |
1208 | .endr | |
1209 | _excpt_saved_imask: | |
1210 | .long 0; | |
1211 | ||
1212 | _exception_stack: | |
1213 | .rept 1024 | |
1214 | .long 0; | |
1215 | .endr | |
1216 | _exception_stack_top: | |
1217 | ||
1218 | #if defined(ANOMALY_05000261) | |
1219 | /* Used by the assembly entry point to work around an anomaly. */ | |
1220 | _last_cplb_fault_retx: | |
1221 | .long 0; | |
1222 | #endif | |
1223 | /* | |
1224 | * Single instructions can have multiple faults, which need to be | |
1225 | * handled by traps.c, in irq5. We store the exception cause to ensure | |
1226 | * we don't miss a double fault condition | |
1227 | */ | |
1228 | ENTRY(_in_ptr_excause) | |
1229 | .long 0; | |
1230 | ENTRY(_out_ptr_excause) | |
1231 | .long 0; | |
1232 | ALIGN | |
1233 | ENTRY(_excause_circ_buf) | |
1234 | .rept 4 | |
1235 | .long 0 | |
1236 | .endr |