]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/arc/kernel/entry.S
ARC: ptrace support
[karo-tx-linux.git] / arch / arc / kernel / entry.S
1 /*
2  * Low Level Interrupts/Traps/Exceptions(non-TLB) Handling for ARC
3  *
4  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * vineetg: Feb 2011 (ptrace low level code fixes)
11  *  -traced syscall return code (r0) was not saved into pt_regs for restoring
12  *   into user reg-file when traded task rets to user space.
13  *  -syscalls needing arch-wrappers (mainly for passing sp as pt_regs)
14  *   were not invoking post-syscall trace hook (jumping directly into
15  *   ret_from_system_call)
16  *
17  * vineetg: Nov 2010:
18  *  -Vector table jumps (@8 bytes) converted into branches (@4 bytes)
19  *  -To maintain the slot size of 8 bytes/vector, added nop, which is
20  *   not executed at runtime.
21  *
22  * vineetg: Nov 2009 (Everything needed for TIF_RESTORE_SIGMASK)
23  *  -do_signal()invoked upon TIF_RESTORE_SIGMASK as well
24  *  -Wrappers for sys_{,rt_}sigsuspend() nolonger needed as they don't
25  *   need ptregs anymore
26  *
27  * Vineetg: Oct 2009
28  *  -In a rare scenario, Process gets a Priv-V exception and gets scheduled
29  *   out. Since we don't do FAKE RTIE for Priv-V, CPU excpetion state remains
30  *   active (AE bit enabled).  This causes a double fault for a subseq valid
31  *   exception. Thus FAKE RTIE needed in low level Priv-Violation handler.
32  *   Instr Error could also cause similar scenario, so same there as well.
33  *
34  * Vineetg: Aug 28th 2008: Bug #94984
35  *  -Zero Overhead Loop Context shd be cleared when entering IRQ/EXcp/Trap
36  *   Normally CPU does this automatically, however when doing FAKE rtie,
37  *   we need to explicitly do this. The problem in macros
38  *   FAKE_RET_FROM_EXCPN and FAKE_RET_FROM_EXCPN_LOCK_IRQ was that this bit
39  *   was being "CLEARED" rather then "SET". Since it is Loop INHIBIT Bit,
40  *   setting it and not clearing it clears ZOL context
41  *
42  * Vineetg: May 16th, 2008
43  *  - r25 now contains the Current Task when in kernel
44  *
45  * Vineetg: Dec 22, 2007
46  *    Minor Surgery of Low Level ISR to make it SMP safe
47  *    - MMU_SCRATCH0 Reg used for freeing up r9 in Level 1 ISR
48  *    - _current_task is made an array of NR_CPUS
49  *    - Access of _current_task wrapped inside a macro so that if hardware
50  *       team agrees for a dedicated reg, no other code is touched
51  *
52  * Amit Bhor, Rahul Trivedi, Kanika Nema, Sameer Dhavale : Codito Tech 2004
53  */
54
55 /*------------------------------------------------------------------
56  *    Function                            ABI
57  *------------------------------------------------------------------
58  *
59  *  Arguments                           r0 - r7
60  *  Caller Saved Registers              r0 - r12
61  *  Callee Saved Registers              r13- r25
62  *  Global Pointer (gp)                 r26
63  *  Frame Pointer (fp)                  r27
64  *  Stack Pointer (sp)                  r28
65  *  Interrupt link register (ilink1)    r29
66  *  Interrupt link register (ilink2)    r30
67  *  Branch link register (blink)        r31
68  *------------------------------------------------------------------
69  */
70
71         .cpu A7
72
73 ;############################ Vector Table #################################
74
75 .macro VECTOR  lbl
76 #if 1   /* Just in case, build breaks */
77         j   \lbl
78 #else
79         b   \lbl
80         nop
81 #endif
82 .endm
83
84         .section .vector, "ax",@progbits
85         .align 4
86
87 /* Each entry in the vector table must occupy 2 words. Since it is a jump
88  * across sections (.vector to .text) we are gauranteed that 'j somewhere'
89  * will use the 'j limm' form of the intrsuction as long as somewhere is in
90  * a section other than .vector.
91  */
92
93 ; ********* Critical System Events **********************
94 VECTOR   res_service             ; 0x0, Restart Vector  (0x0)
95 VECTOR   mem_service             ; 0x8, Mem exception   (0x1)
96 VECTOR   instr_service           ; 0x10, Instrn Error   (0x2)
97
98 ; ******************** Device ISRs **********************
99 VECTOR   handle_interrupt_level1
100
101 VECTOR   handle_interrupt_level1
102
103 VECTOR   handle_interrupt_level1
104
105 VECTOR   handle_interrupt_level1
106
107 .rept   25
108 VECTOR   handle_interrupt_level1 ; Other devices
109 .endr
110
111 /* FOR ARC600: timer = 0x3, uart = 0x8, emac = 0x10 */
112
113 ; ******************** Exceptions **********************
114 VECTOR   EV_MachineCheck         ; 0x100, Fatal Machine check   (0x20)
115 VECTOR   EV_TLBMissI             ; 0x108, Intruction TLB miss   (0x21)
116 VECTOR   EV_TLBMissD             ; 0x110, Data TLB miss         (0x22)
117 VECTOR   EV_TLBProtV             ; 0x118, Protection Violation  (0x23)
118                                  ;         or Misaligned Access
119 VECTOR   EV_PrivilegeV           ; 0x120, Privilege Violation   (0x24)
120 VECTOR   EV_Trap                 ; 0x128, Trap exception        (0x25)
121 VECTOR   EV_Extension            ; 0x130, Extn Intruction Excp  (0x26)
122
123 .rept   24
124 VECTOR   reserved                ; Reserved Exceptions
125 .endr
126
127 #include <linux/linkage.h>   /* ARC_{EXTRY,EXIT} */
128 #include <asm/entry.h>       /* SAVE_ALL_{INT1,INT2,TRAP...} */
129 #include <asm/errno.h>
130 #include <asm/arcregs.h>
131 #include <asm/irqflags.h>
132
133 ;##################### Scratch Mem for IRQ stack switching #############
134
135         .section .data          ; NOT .global
136         .align 32
137         .type   int1_saved_reg, @object
138         .size   int1_saved_reg, 4
139 int1_saved_reg:
140         .zero 4
141
142 ; ---------------------------------------------
143         .section .text, "ax",@progbits
144
145 res_service:            ; processor restart
146         flag    0x1     ; not implemented
147         nop
148         nop
149
150 reserved:               ; processor restart
151         rtie            ; jump to processor initializations
152
153 ;##################### Interrupt Handling ##############################
154
155 ; ---------------------------------------------
156 ;  Level 1 ISR
157 ; ---------------------------------------------
158 ARC_ENTRY handle_interrupt_level1
159
160         /* free up r9 as scratchpad */
161         st   r9, [@int1_saved_reg]
162
163         ;Which mode (user/kernel) was the system in when intr occured
164         lr  r9, [status32_l1]
165
166         SWITCH_TO_KERNEL_STK
167         SAVE_ALL_INT1
168
169         lr  r0, [icause1]
170         and r0, r0, 0x1f
171
172         bl.d  @arch_do_IRQ
173         mov r1, sp
174
175         mov r8,0x1
176         sr r8, [AUX_IRQ_LV12]       ; clear bit in Sticky Status Reg
177
178         b   ret_from_exception
179 ARC_EXIT handle_interrupt_level1
180
181 ;################### Non TLB Exception Handling #############################
182
183 ; ---------------------------------------------
184 ; Instruction Error Exception Handler
185 ; ---------------------------------------------
186
187 ARC_ENTRY instr_service
188
189         EXCPN_PROLOG_FREEUP_REG r9
190
191         lr  r9, [erstatus]
192
193         SWITCH_TO_KERNEL_STK
194         SAVE_ALL_SYS
195
196         lr  r0, [ecr]
197         lr  r1, [efa]
198
199         mov r2, sp
200
201         FAKE_RET_FROM_EXCPN r9
202
203         bl  do_insterror_or_kprobe
204         b   ret_from_exception
205 ARC_EXIT instr_service
206
207 ; ---------------------------------------------
208 ; Memory Error Exception Handler
209 ; ---------------------------------------------
210
211 ARC_ENTRY mem_service
212
213         EXCPN_PROLOG_FREEUP_REG r9
214
215         lr  r9, [erstatus]
216
217         SWITCH_TO_KERNEL_STK
218         SAVE_ALL_SYS
219
220         lr  r0, [ecr]
221         lr  r1, [efa]
222         mov r2, sp
223         bl  do_memory_error
224         b   ret_from_exception
225 ARC_EXIT mem_service
226
227 ; ---------------------------------------------
228 ; Machine Check Exception Handler
229 ; ---------------------------------------------
230
231 ARC_ENTRY EV_MachineCheck
232
233         EXCPN_PROLOG_FREEUP_REG r9
234         lr  r9, [erstatus]
235
236         SWITCH_TO_KERNEL_STK
237         SAVE_ALL_SYS
238
239         lr  r0, [ecr]
240         lr  r1, [efa]
241         mov r2, sp
242
243         brne    r0, 0x200100, 1f
244         bl      do_tlb_overlap_fault
245         b       ret_from_exception
246
247 1:
248         ; DEAD END: can't do much, display Regs and HALT
249         SAVE_CALLEE_SAVED_USER
250
251         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, r10
252         st  sp, [r10, THREAD_CALLEE_REG]
253
254         j  do_machine_check_fault
255
256 ARC_EXIT EV_MachineCheck
257
258 ; ---------------------------------------------
259 ; Protection Violation Exception Handler
260 ; ---------------------------------------------
261
262 ARC_ENTRY EV_TLBProtV
263
264         EXCPN_PROLOG_FREEUP_REG r9
265
266         ;Which mode (user/kernel) was the system in when Exception occured
267         lr  r9, [erstatus]
268
269         SWITCH_TO_KERNEL_STK
270         SAVE_ALL_SYS
271
272         ;---------(3) Save some more regs-----------------
273         ;  vineetg: Mar 6th: Random Seg Fault issue #1
274         ;  ecr and efa were not saved in case an Intr sneaks in
275         ;  after fake rtie
276         ;
277         lr  r3, [ecr]
278         lr  r4, [efa]
279
280         ; --------(4) Return from CPU Exception Mode ---------
281         ;  Fake a rtie, but rtie to next label
282         ;  That way, subsequently, do_page_fault ( ) executes in pure kernel
283         ;  mode with further Exceptions enabled
284
285         FAKE_RET_FROM_EXCPN r9
286
287         ;------ (5) Type of Protection Violation? ----------
288         ;
289         ; ProtV Hardware Exception is triggered for Access Faults of 2 types
290         ;   -Access Violaton (WRITE to READ ONLY Page) - for linux COW
291         ;   -Unaligned Access (READ/WRITE on odd boundary)
292         ;
293         cmp r3, 0x230400    ; Misaligned data access ?
294         beq 4f
295
296         ;========= (6a) Access Violation Processing ========
297         cmp r3, 0x230100
298         mov r1, 0x0              ; if LD exception ? write = 0
299         mov.ne r1, 0x1           ; else write = 1
300
301         mov r2, r4              ; faulting address
302         mov r0, sp              ; pt_regs
303         bl  do_page_fault
304         b   ret_from_exception
305
306         ;========== (6b) Non aligned access ============
307 4:
308         mov r0, r3              ; cause code
309         mov r1, r4              ; faulting address
310         mov r2, sp              ; pt_regs
311
312         bl  do_misaligned_access
313         b   ret_from_exception
314
315 ARC_EXIT EV_TLBProtV
316
317 ; ---------------------------------------------
318 ; Privilege Violation Exception Handler
319 ; ---------------------------------------------
320 ARC_ENTRY EV_PrivilegeV
321
322         EXCPN_PROLOG_FREEUP_REG r9
323
324         lr  r9, [erstatus]
325
326         SWITCH_TO_KERNEL_STK
327         SAVE_ALL_SYS
328
329         lr  r0, [ecr]
330         lr  r1, [efa]
331         mov r2, sp
332
333         FAKE_RET_FROM_EXCPN r9
334
335         bl  do_privilege_fault
336         b   ret_from_exception
337 ARC_EXIT EV_PrivilegeV
338
339 ; ---------------------------------------------
340 ; Extension Instruction Exception Handler
341 ; ---------------------------------------------
342 ARC_ENTRY EV_Extension
343
344         EXCPN_PROLOG_FREEUP_REG r9
345         lr  r9, [erstatus]
346
347         SWITCH_TO_KERNEL_STK
348         SAVE_ALL_SYS
349
350         lr  r0, [ecr]
351         lr  r1, [efa]
352         mov r2, sp
353         bl  do_extension_fault
354         b   ret_from_exception
355 ARC_EXIT EV_Extension
356
357 ;######################### System Call Tracing #########################
358
359 tracesys:
360         ; save EFA in case tracer wants the PC of traced task
361         ; using ERET won't work since next-PC has already committed
362         lr  r12, [efa]
363         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, r11
364         st  r12, [r11, THREAD_FAULT_ADDR]
365
366         ; PRE Sys Call Ptrace hook
367         mov r0, sp                      ; pt_regs needed
368         bl  @syscall_trace_entry
369
370         ; Tracing code now returns the syscall num (orig or modif)
371         mov r8, r0
372
373         ; Do the Sys Call as we normally would.
374         ; Validate the Sys Call number
375         cmp     r8,  NR_syscalls
376         mov.hi  r0, -ENOSYS
377         bhi     tracesys_exit
378
379         ; Restore the sys-call args. Mere invocation of the hook abv could have
380         ; clobbered them (since they are in scratch regs). The tracer could also
381         ; have deliberately changed the syscall args: r0-r7
382         ld  r0, [sp, PT_r0]
383         ld  r1, [sp, PT_r1]
384         ld  r2, [sp, PT_r2]
385         ld  r3, [sp, PT_r3]
386         ld  r4, [sp, PT_r4]
387         ld  r5, [sp, PT_r5]
388         ld  r6, [sp, PT_r6]
389         ld  r7, [sp, PT_r7]
390         ld.as   r9, [sys_call_table, r8]
391         jl      [r9]        ; Entry into Sys Call Handler
392
393 tracesys_exit:
394         st  r0, [sp, PT_r0]     ; sys call return value in pt_regs
395
396         ;POST Sys Call Ptrace Hook
397         bl  @syscall_trace_exit
398         b   ret_from_exception ; NOT ret_from_system_call at is saves r0 which
399         ; we'd done before calling post hook above
400
401 ;################### Break Point TRAP ##########################
402
403         ; ======= (5b) Trap is due to Break-Point =========
404
405 trap_with_param:
406
407         ; stop_pc info by gdb needs this info
408         st  orig_r8_IS_BRKPT, [sp, PT_orig_r8]
409
410         mov r0, r12
411         lr  r1, [efa]
412         mov r2, sp
413
414         ; Now that we have read EFA, its safe to do "fake" rtie
415         ;   and get out of CPU exception mode
416         FAKE_RET_FROM_EXCPN r11
417
418         ; Save callee regs in case gdb wants to have a look
419         ; SP will grow up by size of CALLEE Reg-File
420         ; NOTE: clobbers r12
421         SAVE_CALLEE_SAVED_USER
422
423         ; save location of saved Callee Regs @ thread_struct->pc
424         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, r10
425         st  sp, [r10, THREAD_CALLEE_REG]
426
427         ; Call the trap handler
428         bl  do_non_swi_trap
429
430         ; unwind stack to discard Callee saved Regs
431         DISCARD_CALLEE_SAVED_USER
432
433         b   ret_from_exception
434
435 ;##################### Trap Handling ##############################
436 ;
437 ; EV_Trap caused by TRAP_S and TRAP0 instructions.
438 ;------------------------------------------------------------------
439 ;   (1) System Calls
440 ;       :parameters in r0-r7.
441 ;       :r8 has the system call number
442 ;   (2) Break Points
443 ;------------------------------------------------------------------
444
445 ARC_ENTRY EV_Trap
446
447         ; Need at least 1 reg to code the early exception prolog
448         EXCPN_PROLOG_FREEUP_REG r9
449
450         ;Which mode (user/kernel) was the system in when intr occured
451         lr  r9, [erstatus]
452
453         SWITCH_TO_KERNEL_STK
454         SAVE_ALL_TRAP
455
456         ;------- (4) What caused the Trap --------------
457         lr     r12, [ecr]
458         and.f  0, r12, ECR_PARAM_MASK
459         bnz    trap_with_param
460
461         ; ======= (5a) Trap is due to System Call ========
462
463         ; Before doing anything, return from CPU Exception Mode
464         FAKE_RET_FROM_EXCPN r11
465
466         ; If syscall tracing ongoing, invoke pre-pos-hooks
467         GET_CURR_THR_INFO_FLAGS   r10
468         btst r10, TIF_SYSCALL_TRACE
469         bnz tracesys  ; this never comes back
470
471         ;============ This is normal System Call case ==========
472         ; Sys-call num shd not exceed the total system calls avail
473         cmp     r8,  NR_syscalls
474         mov.hi  r0, -ENOSYS
475         bhi     ret_from_system_call
476
477         ; Offset into the syscall_table and call handler
478         ld.as   r9,[sys_call_table, r8]
479         jl      [r9]        ; Entry into Sys Call Handler
480
481         ; fall through to ret_from_system_call
482 ARC_EXIT EV_Trap
483
484 ARC_ENTRY ret_from_system_call
485
486         st  r0, [sp, PT_r0]     ; sys call return value in pt_regs
487
488         ; fall through yet again to ret_from_exception
489
490 ;############# Return from Intr/Excp/Trap (Linux Specifics) ##############
491 ;
492 ; If ret to user mode do we need to handle signals, schedule() et al.
493
494 ARC_ENTRY ret_from_exception
495
496         ; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32
497         ld  r8, [sp, PT_status32]   ; returning to User/Kernel Mode
498
499 #ifdef CONFIG_PREEMPT
500         bbit0  r8, STATUS_U_BIT, resume_kernel_mode
501 #else
502         bbit0  r8, STATUS_U_BIT, restore_regs
503 #endif
504
505         ; Before returning to User mode check-for-and-complete any pending work
506         ; such as rescheduling/signal-delivery etc.
507 resume_user_mode_begin:
508
509         ; Disable IRQs to ensures that chk for pending work itself is atomic
510         ; (and we don't end up missing a NEED_RESCHED/SIGPENDING due to an
511         ; interim IRQ).
512         IRQ_DISABLE     r10
513
514         ; Fast Path return to user mode if no pending work
515         GET_CURR_THR_INFO_FLAGS   r9
516         and.f  0,  r9, _TIF_WORK_MASK
517         bz     restore_regs
518
519         ; --- (Slow Path #1) task preemption ---
520         bbit0  r9, TIF_NEED_RESCHED, .Lchk_pend_signals
521         mov    blink, resume_user_mode_begin  ; tail-call to U mode ret chks
522         b      @schedule        ; BTST+Bnz causes relo error in link
523
524 .Lchk_pend_signals:
525         IRQ_ENABLE      r10
526
527         ; --- (Slow Path #2) pending signal  ---
528         mov r0, sp      ; pt_regs for arg to do_signal()/do_notify_resume()
529
530         bbit0  r9, TIF_SIGPENDING, .Lchk_notify_resume
531
532         ; Normal Trap/IRQ entry only saves Scratch (caller-saved) regs
533         ; in pt_reg since the "C" ABI (kernel code) will automatically
534         ; save/restore callee-saved regs.
535         ;
536         ; However, here we need to explicitly save callee regs because
537         ; (i)  If this signal causes coredump - full regfile needed
538         ; (ii) If signal is SIGTRAP/SIGSTOP, task is being traced thus
539         ;      tracer might call PEEKUSR(CALLEE reg)
540         ;
541         ; NOTE: SP will grow up by size of CALLEE Reg-File
542         SAVE_CALLEE_SAVED_USER          ; clobbers r12
543
544         ; save location of saved Callee Regs @ thread_struct->callee
545         GET_CURR_TASK_FIELD_PTR   TASK_THREAD, r10
546         st  sp, [r10, THREAD_CALLEE_REG]
547
548         bl  @do_signal
549
550         ; Ideally we want to discard the Callee reg above, however if this was
551         ; a tracing signal, tracer could have done a POKEUSR(CALLEE reg)
552         RESTORE_CALLEE_SAVED_USER
553
554         b      resume_user_mode_begin   ; loop back to start of U mode ret
555
556         ; --- (Slow Path #3) notify_resume ---
557 .Lchk_notify_resume:
558         btst   r9, TIF_NOTIFY_RESUME
559         blnz   @do_notify_resume
560         b      resume_user_mode_begin   ; unconditionally back to U mode ret chks
561                                         ; for single exit point from this block
562
563 #ifdef CONFIG_PREEMPT
564
565 resume_kernel_mode:
566
567         ; Can't preempt if preemption disabled
568         GET_CURR_THR_INFO_FROM_SP   r10
569         ld  r8, [r10, THREAD_INFO_PREEMPT_COUNT]
570         brne  r8, 0, restore_regs
571
572         ; check if this task's NEED_RESCHED flag set
573         ld  r9, [r10, THREAD_INFO_FLAGS]
574         bbit0  r9, TIF_NEED_RESCHED, restore_regs
575
576         IRQ_DISABLE     r9
577
578         ; Invoke PREEMPTION
579         bl      preempt_schedule_irq
580
581         ; preempt_schedule_irq() always returns with IRQ disabled
582 #endif
583
584         ; fall through
585
586 ;############# Return from Intr/Excp/Trap (ARC Specifics) ##############
587 ;
588 ; Restore the saved sys context (common exit-path for EXCPN/IRQ/Trap)
589 ; IRQ shd definitely not happen between now and rtie
590
591 restore_regs :
592
593         ; Disable Interrupts while restoring reg-file back
594         ; XXX can this be optimised out
595         IRQ_DISABLE_SAVE    r9, r10     ;@r10 has prisitine (pre-disable) copy
596
597 #ifdef CONFIG_ARC_CURR_IN_REG
598         ; Restore User R25
599         ; Earlier this used to be only for returning to user mode
600         ; However with 2 levels of IRQ this can also happen even if
601         ; in kernel mode
602         ld r9, [sp, PT_sp]
603         brhs r9, VMALLOC_START, 8f
604         RESTORE_USER_R25
605 8:
606 #endif
607
608         ; Restore REG File. In case multiple Events outstanding,
609         ; use the same priorty as rtie: EXCPN, L2 IRQ, L1 IRQ, None
610         ; Note that we use realtime STATUS32 (not pt_regs->status32) to
611         ; decide that.
612
613         ; if Returning from Exception
614         bbit0  r10, STATUS_AE_BIT, not_exception
615         RESTORE_ALL_SYS
616         rtie
617
618         ; Not Exception so maybe Interrupts (Level 1 or 2)
619
620 not_exception:
621
622         bbit0  r10, STATUS_A1_BIT, not_level1_interrupt
623
624         ;return from level 1
625
626         RESTORE_ALL_INT1
627 debug_marker_l1:
628         rtie
629
630 not_level1_interrupt:
631
632         ;this case is for syscalls or Exceptions (with fake rtie)
633
634         RESTORE_ALL_SYS
635 debug_marker_syscall:
636         rtie
637
638 ARC_EXIT ret_from_exception
639
640 ARC_ENTRY ret_from_fork
641         ; when the forked child comes here from the __switch_to function
642         ; r0 has the last task pointer.
643         ; put last task in scheduler queue
644         bl   @schedule_tail
645
646         ; If kernel thread, jump to it's entry-point
647         ld   r9, [sp, PT_status32]
648         brne r9, 0, 1f
649
650         jl.d [r14]
651         mov  r0, r13            ; arg to payload
652
653 1:
654         ; special case of kernel_thread entry point returning back due to
655         ; kernel_execve() - pretend return from syscall to ret to userland
656         b    ret_from_exception
657 ARC_EXIT ret_from_fork
658
659 ;################### Special Sys Call Wrappers ##########################
660
661 ; TBD: call do_fork directly from here
662 ARC_ENTRY sys_fork_wrapper
663         SAVE_CALLEE_SAVED_USER
664         bl  @sys_fork
665         DISCARD_CALLEE_SAVED_USER
666
667         GET_CURR_THR_INFO_FLAGS   r10
668         btst r10, TIF_SYSCALL_TRACE
669         bnz  tracesys_exit
670
671         b ret_from_system_call
672 ARC_EXIT sys_fork_wrapper
673
674 ARC_ENTRY sys_vfork_wrapper
675         SAVE_CALLEE_SAVED_USER
676         bl  @sys_vfork
677         DISCARD_CALLEE_SAVED_USER
678
679         GET_CURR_THR_INFO_FLAGS   r10
680         btst r10, TIF_SYSCALL_TRACE
681         bnz  tracesys_exit
682
683         b ret_from_system_call
684 ARC_EXIT sys_vfork_wrapper
685
686 ARC_ENTRY sys_clone_wrapper
687         SAVE_CALLEE_SAVED_USER
688         bl  @sys_clone
689         DISCARD_CALLEE_SAVED_USER
690
691         GET_CURR_THR_INFO_FLAGS   r10
692         btst r10, TIF_SYSCALL_TRACE
693         bnz  tracesys_exit
694
695         b ret_from_system_call
696 ARC_EXIT sys_clone_wrapper