]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
51533b61 MS |
2 | /* |
3 | * Copyright (C) 2000-2003 Axis Communications AB | |
4 | * | |
5 | * Authors: Bjorn Wesen (bjornw@axis.com) | |
6 | * Tobias Anderberg (tobiasa@axis.com), CRISv32 port. | |
7 | * | |
8 | * Code for the system-call and fault low-level handling routines. | |
9 | * | |
10 | * NOTE: This code handles signal-recognition, which happens every time | |
11 | * after a timer-interrupt and after each system call. | |
12 | * | |
13 | * Stack layout in 'ret_from_system_call': | |
ffc8b00d | 14 | * ptrace needs to have all regs on the stack. |
51533b61 MS |
15 | * if the order here is changed, it needs to be |
16 | * updated in fork.c:copy_process, signal.c:do_signal, | |
17 | * ptrace.c and ptrace.h | |
18 | * | |
19 | */ | |
20 | ||
51533b61 MS |
21 | #include <linux/linkage.h> |
22 | #include <linux/sys.h> | |
23 | #include <asm/unistd.h> | |
24 | #include <asm/errno.h> | |
25 | #include <asm/thread_info.h> | |
5a077369 | 26 | #include <asm/asm-offsets.h> |
51533b61 | 27 | |
556dcee7 JN |
28 | #include <hwregs/asm/reg_map_asm.h> |
29 | #include <hwregs/asm/intr_vect_defs_asm.h> | |
51533b61 MS |
30 | |
31 | ;; Exported functions. | |
32 | .globl system_call | |
33 | .globl ret_from_intr | |
34 | .globl ret_from_fork | |
69b58a67 | 35 | .globl ret_from_kernel_thread |
51533b61 MS |
36 | .globl resume |
37 | .globl multiple_interrupt | |
38 | .globl nmi_interrupt | |
39 | .globl spurious_interrupt | |
40 | .globl do_sigtrap | |
41 | .globl gdb_handle_exception | |
42 | .globl sys_call_table | |
43 | ||
44 | ; Check if preemptive kernel scheduling should be done. | |
45 | #ifdef CONFIG_PREEMPT | |
46 | _resume_kernel: | |
47 | di | |
48 | ; Load current task struct. | |
49 | movs.w -8192, $r0 ; THREAD_SIZE = 8192 | |
50 | and.d $sp, $r0 | |
51 | ||
52 | addoq +TI_preempt_count, $r0, $acr | |
53 | move.d [$acr], $r10 ; Preemption disabled? | |
54 | bne _Rexit | |
55 | nop | |
56 | ||
57 | _need_resched: | |
58 | addoq +TI_flags, $r0, $acr | |
59 | move.d [$acr], $r10 | |
60 | btstq TIF_NEED_RESCHED, $r10 ; Check if need_resched is set. | |
61 | bpl _Rexit | |
62 | nop | |
63 | ||
64 | ; Do preemptive kernel scheduling. | |
65 | jsr preempt_schedule_irq | |
66 | nop | |
67 | ||
68 | ; Load new task struct. | |
69 | movs.w -8192, $r0 ; THREAD_SIZE = 8192. | |
70 | and.d $sp, $r0 | |
71 | ||
72 | ; One more time with new task. | |
73 | ba _need_resched | |
74 | nop | |
75 | #else | |
76 | #define _resume_kernel _Rexit | |
77 | #endif | |
78 | ||
79 | ; Called at exit from fork. schedule_tail must be called to drop | |
80 | ; spinlock if CONFIG_PREEMPT. | |
a80a635f | 81 | .type ret_from_fork,@function |
51533b61 MS |
82 | ret_from_fork: |
83 | jsr schedule_tail | |
84 | nop | |
85 | ba ret_from_sys_call | |
86 | nop | |
a80a635f | 87 | .size ret_from_fork, . - ret_from_fork |
51533b61 | 88 | |
69b58a67 AV |
89 | .type ret_from_kernel_thread,@function |
90 | ret_from_kernel_thread: | |
91 | jsr schedule_tail | |
92 | nop | |
93 | move.d $r2, $r10 | |
94 | jsr $r1 | |
95 | nop | |
1703a219 AV |
96 | moveq 0, $r9 ; no syscall restarts, TYVM... |
97 | ba ret_from_sys_call | |
69b58a67 AV |
98 | nop |
99 | .size ret_from_kernel_thread, . - ret_from_kernel_thread | |
100 | ||
a80a635f | 101 | .type ret_from_intr,@function |
51533b61 | 102 | ret_from_intr: |
db4a35c6 RV |
103 | moveq 0, $r9 ; not a syscall |
104 | ||
51533b61 MS |
105 | ;; Check for resched if preemptive kernel, or if we're going back to |
106 | ;; user-mode. This test matches the user_regs(regs) macro. Don't simply | |
107 | ;; test CCS since that doesn't necessarily reflect what mode we'll | |
108 | ;; return into. | |
109 | addoq +PT_ccs, $sp, $acr | |
110 | move.d [$acr], $r0 | |
111 | btstq 16, $r0 ; User-mode flag. | |
112 | bpl _resume_kernel | |
a80a635f | 113 | .size ret_from_intr, . - ret_from_intr + 2 ; +2 includes the dslot. |
51533b61 MS |
114 | |
115 | ; Note that di below is in delay slot. | |
a80a635f | 116 | .type _resume_userspace,@function |
51533b61 MS |
117 | _resume_userspace: |
118 | di ; So need_resched and sigpending don't change. | |
119 | ||
120 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | |
121 | and.d $sp, $r0 | |
122 | ||
123 | addoq +TI_flags, $r0, $acr ; current->work | |
124 | move.d [$acr], $r10 | |
125 | and.d _TIF_WORK_MASK, $r10 ; Work to be done on return? | |
126 | bne _work_pending | |
127 | nop | |
128 | ba _Rexit | |
129 | nop | |
a80a635f | 130 | .size _resume_userspace, . - _resume_userspace |
51533b61 MS |
131 | |
132 | ;; The system_call is called by a BREAK instruction, which looks pretty | |
133 | ;; much like any other exception. | |
134 | ;; | |
135 | ;; System calls can't be made from interrupts but we still stack ERP | |
136 | ;; to have a complete stack frame. | |
137 | ;; | |
138 | ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12, | |
139 | ;; r13,mof,srp | |
140 | ;; | |
141 | ;; This function looks on the _surface_ like spaghetti programming, but it's | |
142 | ;; really designed so that the fast-path does not force cache-loading of | |
143 | ;; non-used instructions. Only the non-common cases cause the outlined code | |
144 | ;; to run.. | |
145 | ||
a80a635f | 146 | .type system_call,@function |
51533b61 MS |
147 | system_call: |
148 | ;; Stack-frame similar to the irq heads, which is reversed in | |
149 | ;; ret_from_sys_call. | |
cd4f2011 | 150 | |
0f72e5c0 | 151 | sub.d 92, $sp ; Skip EDA. |
cd4f2011 JN |
152 | movem $r13, [$sp] |
153 | move.d $sp, $r8 | |
154 | addq 14*4, $r8 | |
155 | move.d $acr, $r0 | |
156 | move $srs, $r1 | |
157 | move $mof, $r2 | |
158 | move $spc, $r3 | |
159 | move $ccs, $r4 | |
160 | move $srp, $r5 | |
161 | move $erp, $r6 | |
0f72e5c0 | 162 | move.d $r9, $r7 ; Store syscall number in EXS |
51533b61 | 163 | subq 4, $sp |
0f72e5c0 | 164 | movem $r7, [$r8] |
cd4f2011 JN |
165 | ei ; Enable interrupts while processing syscalls. |
166 | move.d $r10, [$sp] | |
51533b61 | 167 | |
cd4f2011 | 168 | ; Set S-bit when kernel debugging to keep hardware breakpoints active. |
51533b61 MS |
169 | #ifdef CONFIG_ETRAX_KGDB |
170 | move $ccs, $r0 | |
171 | or.d (1<<9), $r0 | |
172 | move $r0, $ccs | |
173 | #endif | |
174 | ||
175 | movs.w -ENOSYS, $r0 | |
176 | addoq +PT_r10, $sp, $acr | |
177 | move.d $r0, [$acr] | |
178 | ||
179 | ;; Check if this process is syscall-traced. | |
180 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | |
181 | and.d $sp, $r0 | |
182 | ||
183 | addoq +TI_flags, $r0, $acr | |
184 | move.d [$acr], $r0 | |
185 | btstq TIF_SYSCALL_TRACE, $r0 | |
186 | bmi _syscall_trace_entry | |
187 | nop | |
188 | ||
189 | _syscall_traced: | |
190 | ;; Check for sanity in the requested syscall number. | |
191 | cmpu.w NR_syscalls, $r9 | |
192 | bhs ret_from_sys_call | |
193 | lslq 2, $r9 ; Multiply by 4, in the delay slot. | |
194 | ||
195 | ;; The location on the stack for the register structure is passed as a | |
196 | ;; seventh argument. Some system calls need this. | |
197 | move.d $sp, $r0 | |
198 | subq 4, $sp | |
199 | move.d $r0, [$sp] | |
200 | ||
201 | ;; The registers carrying parameters (R10-R13) are intact. The optional | |
25985edc | 202 | ;; fifth and sixth parameters is in MOF and SRP respectively. Put them |
51533b61 MS |
203 | ;; back on the stack. |
204 | subq 4, $sp | |
205 | move $srp, [$sp] | |
206 | subq 4, $sp | |
207 | move $mof, [$sp] | |
208 | ||
209 | ;; Actually to the system call. | |
210 | addo.d +sys_call_table, $r9, $acr | |
211 | move.d [$acr], $acr | |
212 | jsr $acr | |
213 | nop | |
214 | ||
215 | addq 3*4, $sp ; Pop the mof, srp and regs parameters. | |
216 | addoq +PT_r10, $sp, $acr | |
217 | move.d $r10, [$acr] ; Save the return value. | |
218 | ||
219 | moveq 1, $r9 ; "Parameter" to ret_from_sys_call to | |
220 | ; show it was a sys call. | |
221 | ||
222 | ;; Fall through into ret_from_sys_call to return. | |
223 | ||
224 | ret_from_sys_call: | |
225 | ;; R9 is a parameter: | |
226 | ;; >= 1 from syscall | |
227 | ;; 0 from irq | |
228 | ||
229 | ;; Get the current task-struct pointer. | |
230 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | |
231 | and.d $sp, $r0 | |
232 | ||
233 | di ; Make sure need_resched and sigpending don't change. | |
234 | ||
235 | addoq +TI_flags, $r0, $acr | |
236 | move.d [$acr], $r1 | |
237 | and.d _TIF_ALLWORK_MASK, $r1 | |
238 | bne _syscall_exit_work | |
239 | nop | |
a80a635f | 240 | .size system_call, . - system_call |
51533b61 | 241 | |
a80a635f | 242 | .type _Rexit,@function |
51533b61 | 243 | _Rexit: |
444e0c28 RV |
244 | #if defined(CONFIG_TRACE_IRQFLAGS) |
245 | addoq +PT_ccs, $sp, $acr | |
246 | move.d [$acr], $r0 | |
247 | btstq 15, $r0 ; I1 | |
248 | bpl 1f | |
249 | nop | |
250 | jsr trace_hardirqs_on | |
251 | nop | |
252 | 1: | |
253 | #endif | |
254 | ||
51533b61 MS |
255 | ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h |
256 | ;; and ptregs.h. | |
257 | addq 4, $sp ; Skip orig_r10. | |
258 | movem [$sp+], $r13 ; Registers R0-R13. | |
259 | move.d [$sp+], $acr | |
260 | move [$sp], $srs | |
261 | addq 4, $sp | |
262 | move [$sp+], $mof | |
263 | move [$sp+], $spc | |
264 | move [$sp+], $ccs | |
265 | move [$sp+], $srp | |
266 | move [$sp+], $erp | |
267 | addq 8, $sp ; Skip EXS, EDA. | |
268 | jump $erp | |
269 | rfe ; Restore condition code stack in delay-slot. | |
a80a635f | 270 | .size _Rexit, . - _Rexit |
51533b61 MS |
271 | |
272 | ;; We get here after doing a syscall if extra work might need to be done | |
273 | ;; perform syscall exit tracing if needed. | |
274 | ||
a80a635f | 275 | .type _syscall_exit_work,@function |
51533b61 MS |
276 | _syscall_exit_work: |
277 | ;; R0 contains current at this point and irq's are disabled. | |
278 | ||
279 | addoq +TI_flags, $r0, $acr | |
280 | move.d [$acr], $r1 | |
281 | btstq TIF_SYSCALL_TRACE, $r1 | |
282 | bpl _work_pending | |
283 | nop | |
284 | ei | |
285 | move.d $r9, $r1 ; Preserve R9. | |
286 | jsr do_syscall_trace | |
287 | nop | |
288 | move.d $r1, $r9 | |
289 | ba _resume_userspace | |
290 | nop | |
a80a635f | 291 | .size _syscall_exit_work, . - _syscall_exit_work |
51533b61 | 292 | |
a80a635f | 293 | .type _work_pending,@function |
51533b61 | 294 | _work_pending: |
51533b61 | 295 | addoq +TI_flags, $r0, $acr |
ffc8b00d JN |
296 | move.d [$acr], $r12 ; The thread_info_flags parameter. |
297 | move.d $sp, $r11 ; The regs param. | |
9a7449d3 RV |
298 | jsr do_work_pending |
299 | move.d $r9, $r10 ; The syscall/irq param. | |
51533b61 MS |
300 | |
301 | ba _Rexit | |
302 | nop | |
9a7449d3 | 303 | .size _work_pending, . - _work_pending |
51533b61 MS |
304 | |
305 | ;; We get here as a sidetrack when we've entered a syscall with the | |
306 | ;; trace-bit set. We need to call do_syscall_trace and then continue | |
307 | ;; with the call. | |
308 | ||
309 | _syscall_trace_entry: | |
310 | ;; PT_r10 in the frame contains -ENOSYS as required, at this point. | |
311 | ||
312 | jsr do_syscall_trace | |
313 | nop | |
314 | ||
315 | ;; Now re-enter the syscall code to do the syscall itself. We need to | |
316 | ;; restore R9 here to contain the wanted syscall, and the other | |
317 | ;; parameter-bearing registers. | |
318 | addoq +PT_r9, $sp, $acr | |
319 | move.d [$acr], $r9 | |
320 | addoq +PT_orig_r10, $sp, $acr | |
321 | move.d [$acr], $r10 ; PT_r10 is already -ENOSYS. | |
322 | addoq +PT_r11, $sp, $acr | |
323 | move.d [$acr], $r11 | |
324 | addoq +PT_r12, $sp, $acr | |
325 | move.d [$acr], $r12 | |
326 | addoq +PT_r13, $sp, $acr | |
327 | move.d [$acr], $r13 | |
328 | addoq +PT_mof, $sp, $acr | |
329 | move [$acr], $mof | |
330 | addoq +PT_srp, $sp, $acr | |
331 | move [$acr], $srp | |
332 | ||
333 | ba _syscall_traced | |
334 | nop | |
335 | ||
336 | ;; Resume performs the actual task-switching, by switching stack | |
337 | ;; pointers. Input arguments are: | |
338 | ;; | |
339 | ;; R10 = prev | |
340 | ;; R11 = next | |
341 | ;; R12 = thread offset in task struct. | |
342 | ;; | |
343 | ;; Returns old current in R10. | |
344 | ||
a80a635f | 345 | .type resume,@function |
51533b61 | 346 | resume: |
43f6cdd7 JN |
347 | subq 4, $sp ; Make space for srp. |
348 | ||
51533b61 MS |
349 | add.d $r12, $r10 ; R10 = current tasks tss. |
350 | addoq +THREAD_ccs, $r10, $acr | |
43f6cdd7 | 351 | move $srp, [$sp] ; Keep old/new PC on the stack. |
51533b61 MS |
352 | move $ccs, [$acr] ; Save IRQ enable state. |
353 | di | |
354 | ||
355 | addoq +THREAD_usp, $r10, $acr | |
43f6cdd7 | 356 | subq 10*4, $sp ; Make room for R9. |
51533b61 MS |
357 | move $usp, [$acr] ; Save user-mode stackpointer. |
358 | ||
359 | ;; See copy_thread for the reason why register R9 is saved. | |
51533b61 MS |
360 | movem $r9, [$sp] ; Save non-scratch registers and R9. |
361 | ||
362 | addoq +THREAD_ksp, $r10, $acr | |
43f6cdd7 | 363 | move.d $sp, $r10 ; Return last running task in R10. |
51533b61 MS |
364 | move.d $sp, [$acr] ; Save kernel SP for old task. |
365 | ||
51533b61 MS |
366 | and.d -8192, $r10 ; Get thread_info from stackpointer. |
367 | addoq +TI_task, $r10, $acr | |
51533b61 | 368 | add.d $r12, $r11 ; Find the new tasks tss. |
43f6cdd7 | 369 | move.d [$acr], $r10 ; Get task. |
51533b61 MS |
370 | addoq +THREAD_ksp, $r11, $acr |
371 | move.d [$acr], $sp ; Switch to new stackframe. | |
43f6cdd7 | 372 | addoq +THREAD_usp, $r11, $acr |
51533b61 MS |
373 | movem [$sp+], $r9 ; Restore non-scratch registers and R9. |
374 | ||
51533b61 MS |
375 | move [$acr], $usp ; Restore user-mode stackpointer. |
376 | ||
377 | addoq +THREAD_ccs, $r11, $acr | |
43f6cdd7 JN |
378 | move.d [$sp+], $r11 |
379 | jump $r11 ; Restore PC. | |
51533b61 | 380 | move [$acr], $ccs ; Restore IRQ enable status. |
a80a635f | 381 | .size resume, . - resume |
51533b61 MS |
382 | |
383 | nmi_interrupt: | |
384 | ||
385 | ;; If we receive a watchdog interrupt while it is not expected, then set | |
386 | ;; up a canonical frame and dump register contents before dying. | |
387 | ||
388 | ;; This prologue MUST match the one in irq.h and the struct in ptregs.h! | |
389 | subq 12, $sp ; Skip EXS, EDA. | |
390 | move $nrp, [$sp] | |
391 | subq 4, $sp | |
392 | move $srp, [$sp] | |
393 | subq 4, $sp | |
394 | move $ccs, [$sp] | |
395 | subq 4, $sp | |
396 | move $spc, [$sp] | |
397 | subq 4, $sp | |
398 | move $mof, [$sp] | |
399 | subq 4, $sp | |
400 | move $srs, [$sp] | |
401 | subq 4, $sp | |
402 | move.d $acr, [$sp] | |
403 | subq 14*4, $sp ; Make room for R0-R13. | |
404 | movem $r13, [$sp] ; Push R0-R13. | |
405 | subq 4, $sp | |
406 | move.d $r10, [$sp] ; Push orig_r10. | |
407 | move.d REG_ADDR(intr_vect, regi_irq, r_nmi), $r0 | |
408 | move.d [$r0], $r0 | |
409 | btstq REG_BIT(intr_vect, r_nmi, watchdog), $r0 | |
410 | bpl 1f | |
411 | nop | |
ffc8b00d | 412 | jsr handle_watchdog_bite ; In time.c. |
bb1d2a94 | 413 | move.d $sp, $r10 ; Pointer to registers |
51533b61 MS |
414 | 1: btstq REG_BIT(intr_vect, r_nmi, ext), $r0 |
415 | bpl 1f | |
416 | nop | |
417 | jsr handle_nmi | |
418 | move.d $sp, $r10 ; Pointer to registers | |
419 | 1: addq 4, $sp ; Skip orig_r10 | |
420 | movem [$sp+], $r13 | |
421 | move.d [$sp+], $acr | |
422 | move [$sp], $srs | |
423 | addq 4, $sp | |
424 | move [$sp+], $mof | |
425 | move [$sp+], $spc | |
426 | move [$sp+], $ccs | |
427 | move [$sp+], $srp | |
428 | move [$sp+], $nrp | |
429 | addq 8, $sp ; Skip EXS, EDA. | |
430 | jump $nrp | |
431 | rfn | |
432 | ||
433 | .comm cause_of_death, 4 ;; Don't declare this anywhere. | |
434 | ||
435 | spurious_interrupt: | |
436 | di | |
437 | jump hard_reset_now | |
438 | nop | |
439 | ||
440 | ;; This handles the case when multiple interrupts arrive at the same | |
bb1d2a94 | 441 | ;; time. Jump to the first set interrupt bit in a priority fashion. The |
51533b61 MS |
442 | ;; hardware will call the unserved interrupts after the handler |
443 | ;; finishes. | |
a80a635f | 444 | .type multiple_interrupt, @function |
51533b61 MS |
445 | multiple_interrupt: |
446 | ;; This prologue MUST match the one in irq.h and the struct in ptregs.h! | |
447 | subq 12, $sp ; Skip EXS, EDA. | |
448 | move $erp, [$sp] | |
449 | subq 4, $sp | |
450 | move $srp, [$sp] | |
451 | subq 4, $sp | |
452 | move $ccs, [$sp] | |
453 | subq 4, $sp | |
454 | move $spc, [$sp] | |
455 | subq 4, $sp | |
456 | move $mof, [$sp] | |
457 | subq 4, $sp | |
458 | move $srs, [$sp] | |
459 | subq 4, $sp | |
460 | move.d $acr, [$sp] | |
461 | subq 14*4, $sp ; Make room for R0-R13. | |
462 | movem $r13, [$sp] ; Push R0-R13. | |
463 | subq 4, $sp | |
464 | move.d $r10, [$sp] ; Push orig_r10. | |
465 | ||
466 | ; Set S-bit when kernel debugging to keep hardware breakpoints active. | |
467 | #ifdef CONFIG_ETRAX_KGDB | |
468 | move $ccs, $r0 | |
469 | or.d (1<<9), $r0 | |
470 | move $r0, $ccs | |
471 | #endif | |
472 | ||
473 | jsr crisv32_do_multiple | |
474 | move.d $sp, $r10 | |
475 | jump ret_from_intr | |
476 | nop | |
a80a635f | 477 | .size multiple_interrupt, . - multiple_interrupt |
51533b61 MS |
478 | |
479 | do_sigtrap: | |
480 | ;; Sigtraps the process that executed the BREAK instruction. Creates a | |
481 | ;; frame that Rexit expects. | |
482 | subq 4, $sp | |
483 | move $eda, [$sp] | |
484 | subq 4, $sp | |
485 | move $exs, [$sp] | |
486 | subq 4, $sp | |
487 | move $erp, [$sp] | |
488 | subq 4, $sp | |
489 | move $srp, [$sp] | |
490 | subq 4, $sp | |
491 | move $ccs, [$sp] | |
492 | subq 4, $sp | |
493 | move $spc, [$sp] | |
494 | subq 4, $sp | |
495 | move $mof, [$sp] | |
496 | subq 4, $sp | |
497 | move $srs, [$sp] | |
498 | subq 4, $sp | |
499 | move.d $acr, [$sp] | |
500 | di ; Need to disable irq's at this point. | |
501 | subq 14*4, $sp ; Make room for r0-r13. | |
502 | movem $r13, [$sp] ; Push the r0-r13 registers. | |
503 | subq 4, $sp | |
504 | move.d $r10, [$sp] ; Push orig_r10. | |
505 | ||
506 | movs.w -8192, $r9 ; THREAD_SIZE == 8192 | |
507 | and.d $sp, $r9 | |
508 | ||
509 | ;; thread_info as first parameter | |
510 | move.d $r9, $r10 | |
511 | moveq 5, $r11 ; SIGTRAP as second argument. | |
512 | jsr ugdb_trap_user | |
513 | nop | |
514 | jump ret_from_intr ; Use the return routine for interrupts. | |
515 | nop | |
516 | ||
517 | gdb_handle_exception: | |
518 | subq 4, $sp | |
519 | move.d $r0, [$sp] | |
520 | #ifdef CONFIG_ETRAX_KGDB | |
521 | move $ccs, $r0 ; U-flag not affected by previous insns. | |
522 | btstq 16, $r0 ; Test the U-flag. | |
523 | bmi _ugdb_handle_exception ; Go to user mode debugging. | |
524 | nop ; Empty delay-slot (cannot pop R0 here). | |
525 | ba kgdb_handle_exception ; Go to kernel debugging. | |
526 | move.d [$sp+], $r0 ; Restore R0 in delay slot. | |
527 | #endif | |
528 | ||
529 | _ugdb_handle_exception: | |
530 | ba do_sigtrap ; SIGTRAP the offending process. | |
531 | move.d [$sp+], $r0 ; Restore R0 in delay slot. | |
532 | ||
533 | .data | |
534 | ||
535 | .section .rodata,"a" | |
536 | sys_call_table: | |
537 | .long sys_restart_syscall ; 0 - old "setup()" system call, used | |
538 | ; for restarting. | |
539 | .long sys_exit | |
540 | .long sys_fork | |
541 | .long sys_read | |
542 | .long sys_write | |
543 | .long sys_open /* 5 */ | |
544 | .long sys_close | |
545 | .long sys_waitpid | |
546 | .long sys_creat | |
547 | .long sys_link | |
548 | .long sys_unlink /* 10 */ | |
549 | .long sys_execve | |
550 | .long sys_chdir | |
551 | .long sys_time | |
552 | .long sys_mknod | |
553 | .long sys_chmod /* 15 */ | |
554 | .long sys_lchown16 | |
555 | .long sys_ni_syscall /* old break syscall holder */ | |
556 | .long sys_stat | |
557 | .long sys_lseek | |
558 | .long sys_getpid /* 20 */ | |
559 | .long sys_mount | |
560 | .long sys_oldumount | |
561 | .long sys_setuid16 | |
562 | .long sys_getuid16 | |
563 | .long sys_stime /* 25 */ | |
564 | .long sys_ptrace | |
565 | .long sys_alarm | |
566 | .long sys_fstat | |
567 | .long sys_pause | |
568 | .long sys_utime /* 30 */ | |
569 | .long sys_ni_syscall /* old stty syscall holder */ | |
570 | .long sys_ni_syscall /* old gtty syscall holder */ | |
571 | .long sys_access | |
572 | .long sys_nice | |
573 | .long sys_ni_syscall /* 35 old ftime syscall holder */ | |
574 | .long sys_sync | |
575 | .long sys_kill | |
576 | .long sys_rename | |
577 | .long sys_mkdir | |
578 | .long sys_rmdir /* 40 */ | |
579 | .long sys_dup | |
580 | .long sys_pipe | |
581 | .long sys_times | |
582 | .long sys_ni_syscall /* old prof syscall holder */ | |
583 | .long sys_brk /* 45 */ | |
584 | .long sys_setgid16 | |
585 | .long sys_getgid16 | |
586 | .long sys_signal | |
587 | .long sys_geteuid16 | |
588 | .long sys_getegid16 /* 50 */ | |
589 | .long sys_acct | |
590 | .long sys_umount /* recycled never used phys( */ | |
591 | .long sys_ni_syscall /* old lock syscall holder */ | |
592 | .long sys_ioctl | |
593 | .long sys_fcntl /* 55 */ | |
594 | .long sys_ni_syscall /* old mpx syscall holder */ | |
595 | .long sys_setpgid | |
596 | .long sys_ni_syscall /* old ulimit syscall holder */ | |
597 | .long sys_ni_syscall /* old sys_olduname holder */ | |
598 | .long sys_umask /* 60 */ | |
599 | .long sys_chroot | |
600 | .long sys_ustat | |
601 | .long sys_dup2 | |
602 | .long sys_getppid | |
603 | .long sys_getpgrp /* 65 */ | |
604 | .long sys_setsid | |
605 | .long sys_sigaction | |
606 | .long sys_sgetmask | |
607 | .long sys_ssetmask | |
608 | .long sys_setreuid16 /* 70 */ | |
609 | .long sys_setregid16 | |
610 | .long sys_sigsuspend | |
611 | .long sys_sigpending | |
612 | .long sys_sethostname | |
613 | .long sys_setrlimit /* 75 */ | |
614 | .long sys_old_getrlimit | |
615 | .long sys_getrusage | |
616 | .long sys_gettimeofday | |
617 | .long sys_settimeofday | |
618 | .long sys_getgroups16 /* 80 */ | |
619 | .long sys_setgroups16 | |
620 | .long sys_select /* was old_select in Linux/E100 */ | |
621 | .long sys_symlink | |
622 | .long sys_lstat | |
623 | .long sys_readlink /* 85 */ | |
624 | .long sys_uselib | |
625 | .long sys_swapon | |
626 | .long sys_reboot | |
e55380ed | 627 | .long sys_old_readdir |
a4679373 | 628 | .long sys_old_mmap /* 90 */ |
51533b61 MS |
629 | .long sys_munmap |
630 | .long sys_truncate | |
631 | .long sys_ftruncate | |
632 | .long sys_fchmod | |
633 | .long sys_fchown16 /* 95 */ | |
634 | .long sys_getpriority | |
635 | .long sys_setpriority | |
636 | .long sys_ni_syscall /* old profil syscall holder */ | |
637 | .long sys_statfs | |
638 | .long sys_fstatfs /* 100 */ | |
639 | .long sys_ni_syscall /* sys_ioperm in i386 */ | |
640 | .long sys_socketcall | |
641 | .long sys_syslog | |
642 | .long sys_setitimer | |
643 | .long sys_getitimer /* 105 */ | |
644 | .long sys_newstat | |
645 | .long sys_newlstat | |
646 | .long sys_newfstat | |
647 | .long sys_ni_syscall /* old sys_uname holder */ | |
648 | .long sys_ni_syscall /* sys_iopl in i386 */ | |
649 | .long sys_vhangup | |
650 | .long sys_ni_syscall /* old "idle" system call */ | |
651 | .long sys_ni_syscall /* vm86old in i386 */ | |
652 | .long sys_wait4 | |
653 | .long sys_swapoff /* 115 */ | |
654 | .long sys_sysinfo | |
655 | .long sys_ipc | |
656 | .long sys_fsync | |
657 | .long sys_sigreturn | |
658 | .long sys_clone /* 120 */ | |
659 | .long sys_setdomainname | |
660 | .long sys_newuname | |
661 | .long sys_ni_syscall /* sys_modify_ldt */ | |
662 | .long sys_adjtimex | |
663 | .long sys_mprotect /* 125 */ | |
664 | .long sys_sigprocmask | |
665 | .long sys_ni_syscall /* old "create_module" */ | |
666 | .long sys_init_module | |
667 | .long sys_delete_module | |
668 | .long sys_ni_syscall /* 130: old "get_kernel_syms" */ | |
669 | .long sys_quotactl | |
670 | .long sys_getpgid | |
671 | .long sys_fchdir | |
672 | .long sys_bdflush | |
673 | .long sys_sysfs /* 135 */ | |
674 | .long sys_personality | |
675 | .long sys_ni_syscall /* for afs_syscall */ | |
676 | .long sys_setfsuid16 | |
677 | .long sys_setfsgid16 | |
678 | .long sys_llseek /* 140 */ | |
679 | .long sys_getdents | |
680 | .long sys_select | |
681 | .long sys_flock | |
682 | .long sys_msync | |
683 | .long sys_readv /* 145 */ | |
684 | .long sys_writev | |
685 | .long sys_getsid | |
686 | .long sys_fdatasync | |
687 | .long sys_sysctl | |
688 | .long sys_mlock /* 150 */ | |
689 | .long sys_munlock | |
690 | .long sys_mlockall | |
691 | .long sys_munlockall | |
692 | .long sys_sched_setparam | |
693 | .long sys_sched_getparam /* 155 */ | |
694 | .long sys_sched_setscheduler | |
695 | .long sys_sched_getscheduler | |
696 | .long sys_sched_yield | |
697 | .long sys_sched_get_priority_max | |
698 | .long sys_sched_get_priority_min /* 160 */ | |
699 | .long sys_sched_rr_get_interval | |
700 | .long sys_nanosleep | |
701 | .long sys_mremap | |
702 | .long sys_setresuid16 | |
703 | .long sys_getresuid16 /* 165 */ | |
704 | .long sys_ni_syscall /* sys_vm86 */ | |
705 | .long sys_ni_syscall /* Old sys_query_module */ | |
706 | .long sys_poll | |
f5b94099 | 707 | .long sys_ni_syscall /* Old nfsservctl */ |
51533b61 MS |
708 | .long sys_setresgid16 /* 170 */ |
709 | .long sys_getresgid16 | |
710 | .long sys_prctl | |
711 | .long sys_rt_sigreturn | |
712 | .long sys_rt_sigaction | |
713 | .long sys_rt_sigprocmask /* 175 */ | |
714 | .long sys_rt_sigpending | |
715 | .long sys_rt_sigtimedwait | |
716 | .long sys_rt_sigqueueinfo | |
717 | .long sys_rt_sigsuspend | |
718 | .long sys_pread64 /* 180 */ | |
719 | .long sys_pwrite64 | |
720 | .long sys_chown16 | |
721 | .long sys_getcwd | |
722 | .long sys_capget | |
723 | .long sys_capset /* 185 */ | |
724 | .long sys_sigaltstack | |
725 | .long sys_sendfile | |
726 | .long sys_ni_syscall /* streams1 */ | |
727 | .long sys_ni_syscall /* streams2 */ | |
728 | .long sys_vfork /* 190 */ | |
729 | .long sys_getrlimit | |
730 | .long sys_mmap2 | |
731 | .long sys_truncate64 | |
732 | .long sys_ftruncate64 | |
733 | .long sys_stat64 /* 195 */ | |
734 | .long sys_lstat64 | |
735 | .long sys_fstat64 | |
736 | .long sys_lchown | |
737 | .long sys_getuid | |
738 | .long sys_getgid /* 200 */ | |
739 | .long sys_geteuid | |
740 | .long sys_getegid | |
741 | .long sys_setreuid | |
742 | .long sys_setregid | |
743 | .long sys_getgroups /* 205 */ | |
744 | .long sys_setgroups | |
745 | .long sys_fchown | |
746 | .long sys_setresuid | |
747 | .long sys_getresuid | |
748 | .long sys_setresgid /* 210 */ | |
749 | .long sys_getresgid | |
750 | .long sys_chown | |
751 | .long sys_setuid | |
752 | .long sys_setgid | |
753 | .long sys_setfsuid /* 215 */ | |
754 | .long sys_setfsgid | |
755 | .long sys_pivot_root | |
756 | .long sys_mincore | |
757 | .long sys_madvise | |
758 | .long sys_getdents64 /* 220 */ | |
759 | .long sys_fcntl64 | |
760 | .long sys_ni_syscall /* reserved for TUX */ | |
761 | .long sys_ni_syscall | |
762 | .long sys_gettid | |
763 | .long sys_readahead /* 225 */ | |
764 | .long sys_setxattr | |
765 | .long sys_lsetxattr | |
766 | .long sys_fsetxattr | |
767 | .long sys_getxattr | |
768 | .long sys_lgetxattr /* 230 */ | |
769 | .long sys_fgetxattr | |
770 | .long sys_listxattr | |
771 | .long sys_llistxattr | |
772 | .long sys_flistxattr | |
773 | .long sys_removexattr /* 235 */ | |
774 | .long sys_lremovexattr | |
775 | .long sys_fremovexattr | |
776 | .long sys_tkill | |
777 | .long sys_sendfile64 | |
778 | .long sys_futex /* 240 */ | |
779 | .long sys_sched_setaffinity | |
780 | .long sys_sched_getaffinity | |
781 | .long sys_ni_syscall /* sys_set_thread_area */ | |
782 | .long sys_ni_syscall /* sys_get_thread_area */ | |
783 | .long sys_io_setup /* 245 */ | |
784 | .long sys_io_destroy | |
785 | .long sys_io_getevents | |
786 | .long sys_io_submit | |
787 | .long sys_io_cancel | |
788 | .long sys_fadvise64 /* 250 */ | |
789 | .long sys_ni_syscall | |
790 | .long sys_exit_group | |
791 | .long sys_lookup_dcookie | |
792 | .long sys_epoll_create | |
793 | .long sys_epoll_ctl /* 255 */ | |
794 | .long sys_epoll_wait | |
795 | .long sys_remap_file_pages | |
ffc8b00d JN |
796 | .long sys_set_tid_address |
797 | .long sys_timer_create | |
798 | .long sys_timer_settime /* 260 */ | |
799 | .long sys_timer_gettime | |
800 | .long sys_timer_getoverrun | |
801 | .long sys_timer_delete | |
802 | .long sys_clock_settime | |
803 | .long sys_clock_gettime /* 265 */ | |
804 | .long sys_clock_getres | |
805 | .long sys_clock_nanosleep | |
51533b61 MS |
806 | .long sys_statfs64 |
807 | .long sys_fstatfs64 | |
808 | .long sys_tgkill /* 270 */ | |
809 | .long sys_utimes | |
ffc8b00d | 810 | .long sys_fadvise64_64 |
51533b61 MS |
811 | .long sys_ni_syscall /* sys_vserver */ |
812 | .long sys_ni_syscall /* sys_mbind */ | |
813 | .long sys_ni_syscall /* 275 sys_get_mempolicy */ | |
814 | .long sys_ni_syscall /* sys_set_mempolicy */ | |
815 | .long sys_mq_open | |
816 | .long sys_mq_unlink | |
817 | .long sys_mq_timedsend | |
818 | .long sys_mq_timedreceive /* 280 */ | |
819 | .long sys_mq_notify | |
820 | .long sys_mq_getsetattr | |
821 | .long sys_ni_syscall /* reserved for kexec */ | |
822 | .long sys_waitid | |
ffc8b00d JN |
823 | .long sys_ni_syscall /* 285 */ /* available */ |
824 | .long sys_add_key | |
825 | .long sys_request_key | |
826 | .long sys_keyctl | |
827 | .long sys_ioprio_set | |
828 | .long sys_ioprio_get /* 290 */ | |
829 | .long sys_inotify_init | |
830 | .long sys_inotify_add_watch | |
831 | .long sys_inotify_rm_watch | |
832 | .long sys_migrate_pages | |
833 | .long sys_openat /* 295 */ | |
834 | .long sys_mkdirat | |
835 | .long sys_mknodat | |
836 | .long sys_fchownat | |
837 | .long sys_futimesat | |
838 | .long sys_fstatat64 /* 300 */ | |
839 | .long sys_unlinkat | |
840 | .long sys_renameat | |
841 | .long sys_linkat | |
842 | .long sys_symlinkat | |
843 | .long sys_readlinkat /* 305 */ | |
844 | .long sys_fchmodat | |
845 | .long sys_faccessat | |
846 | .long sys_pselect6 | |
847 | .long sys_ppoll | |
848 | .long sys_unshare /* 310 */ | |
849 | .long sys_set_robust_list | |
850 | .long sys_get_robust_list | |
851 | .long sys_splice | |
852 | .long sys_sync_file_range | |
853 | .long sys_tee /* 315 */ | |
854 | .long sys_vmsplice | |
855 | .long sys_move_pages | |
856 | .long sys_getcpu | |
857 | .long sys_epoll_pwait | |
858 | .long sys_utimensat /* 320 */ | |
859 | .long sys_signalfd | |
7800029d | 860 | .long sys_timerfd_create |
ffc8b00d JN |
861 | .long sys_eventfd |
862 | .long sys_fallocate | |
7800029d JN |
863 | .long sys_timerfd_settime /* 325 */ |
864 | .long sys_timerfd_gettime | |
6d3d4be4 JN |
865 | .long sys_signalfd4 |
866 | .long sys_eventfd2 | |
867 | .long sys_epoll_create1 | |
868 | .long sys_dup3 /* 330 */ | |
869 | .long sys_pipe2 | |
870 | .long sys_inotify_init1 | |
871 | .long sys_preadv | |
872 | .long sys_pwritev | |
7b21fddd | 873 | .long sys_setns /* 335 */ |
bb1d2a94 JN |
874 | .long sys_name_to_handle_at |
875 | .long sys_open_by_handle_at | |
876 | .long sys_rt_tgsigqueueinfo | |
877 | .long sys_perf_event_open | |
878 | .long sys_recvmmsg /* 340 */ | |
879 | .long sys_accept4 | |
880 | .long sys_fanotify_init | |
881 | .long sys_fanotify_mark | |
882 | .long sys_prlimit64 | |
883 | .long sys_clock_adjtime /* 345 */ | |
884 | .long sys_syncfs | |
885 | .long sys_sendmmsg | |
886 | .long sys_process_vm_readv | |
887 | .long sys_process_vm_writev | |
888 | .long sys_kcmp /* 350 */ | |
889 | .long sys_finit_module | |
ee59843c CG |
890 | .long sys_sched_setattr |
891 | .long sys_sched_getattr | |
892 | .long sys_renameat2 | |
893 | .long sys_seccomp /* 355 */ | |
894 | .long sys_getrandom | |
895 | .long sys_memfd_create | |
896 | .long sys_bpf | |
897 | .long sys_execveat | |
bb1d2a94 JN |
898 | |
899 | /* | |
900 | * NOTE!! This doesn't have to be exact - we just have | |
901 | * to make sure we have _enough_ of the "sys_ni_syscall" | |
902 | * entries. Don't panic if you notice that this hasn't | |
903 | * been shrunk every time we add a new system call. | |
904 | */ | |
51533b61 MS |
905 | |
906 | .rept NR_syscalls - (.-sys_call_table) / 4 | |
907 | .long sys_ni_syscall | |
908 | .endr | |
909 |