|
24 | 24 | *------------------------------------------------------------------ |
25 | 25 | */ |
26 | 26 |
|
| 27 | +;################### Special Sys Call Wrappers ########################## |
| 28 | + |
| 29 | +ENTRY(sys_clone_wrapper) |
| 30 | + SAVE_CALLEE_SAVED_USER |
| 31 | + bl @sys_clone |
| 32 | + DISCARD_CALLEE_SAVED_USER |
| 33 | + |
| 34 | + GET_CURR_THR_INFO_FLAGS r10 |
| 35 | + btst r10, TIF_SYSCALL_TRACE |
| 36 | + bnz tracesys_exit |
| 37 | + |
| 38 | + b ret_from_system_call |
| 39 | +END(sys_clone_wrapper) |
| 40 | + |
| 41 | +ENTRY(ret_from_fork) |
| 42 | + ; when the forked child comes here from the __switch_to function |
| 43 | + ; r0 has the last task pointer. |
| 44 | + ; put last task in scheduler queue |
| 45 | + bl @schedule_tail |
| 46 | + |
| 47 | + ld r9, [sp, PT_status32] |
| 48 | + brne r9, 0, 1f |
| 49 | + |
| 50 | + jl.d [r14] ; kernel thread entry point |
| 51 | + mov r0, r13 ; (see PF_KTHREAD block in copy_thread) |
| 52 | + |
| 53 | +1: |
| 54 | + ; Return to user space |
| 55 | + ; 1. Any forked task (Reach here via BRne above) |
| 56 | + ; 2. First ever init task (Reach here via return from JL above) |
| 57 | + ; This is the historic "kernel_execve" use-case, to return to init |
| 58 | + ; user mode, in a round about way since that is always done from |
| 59 | + ; a kernel thread which is executed via JL above but always returns |
| 60 | + ; out whenever kernel_execve (now inline do_fork()) is involved |
| 61 | + b ret_from_exception |
| 62 | +END(ret_from_fork) |
| 63 | + |
| 64 | +#ifdef CONFIG_ARC_DW2_UNWIND |
| 65 | +; Workaround for bug 94179 (STAR ): |
| 66 | +; Despite -fasynchronous-unwind-tables, linker is not making dwarf2 unwinder |
| 67 | +; section (.debug_frame) as loadable. So we force it here. |
| 68 | +; This also fixes STAR 9000487933 where the prev-workaround (objcopy --setflag) |
| 69 | +; would not work after a clean build due to kernel build system dependencies. |
| 70 | +.section .debug_frame, "wa",@progbits |
| 71 | + |
| 72 | +; Reset to .text as this file is included in entry-<isa>.S |
| 73 | +.section .text, "ax",@progbits |
| 74 | +#endif |
| 75 | + |
27 | 76 | ;################### Non TLB Exception Handling ############################# |
28 | 77 |
|
29 | 78 | ; --------------------------------------------- |
@@ -338,53 +387,6 @@ resume_kernel_mode: |
338 | 387 | #endif |
339 | 388 |
|
340 | 389 | b .Lrestore_regs |
341 | | -END(ret_from_exception) |
342 | | - |
343 | | -ENTRY(ret_from_fork) |
344 | | - ; when the forked child comes here from the __switch_to function |
345 | | - ; r0 has the last task pointer. |
346 | | - ; put last task in scheduler queue |
347 | | - bl @schedule_tail |
348 | | - |
349 | | - ld r9, [sp, PT_status32] |
350 | | - brne r9, 0, 1f |
351 | | - |
352 | | - jl.d [r14] ; kernel thread entry point |
353 | | - mov r0, r13 ; (see PF_KTHREAD block in copy_thread) |
354 | | - |
355 | | -1: |
356 | | - ; Return to user space |
357 | | - ; 1. Any forked task (Reach here via BRne above) |
358 | | - ; 2. First ever init task (Reach here via return from JL above) |
359 | | - ; This is the historic "kernel_execve" use-case, to return to init |
360 | | - ; user mode, in a round about way since that is always done from |
361 | | - ; a kernel thread which is executed via JL above but always returns |
362 | | - ; out whenever kernel_execve (now inline do_fork()) is involved |
363 | | - b ret_from_exception |
364 | | -END(ret_from_fork) |
365 | 390 |
|
366 | | -;################### Special Sys Call Wrappers ########################## |
367 | | - |
368 | | -ENTRY(sys_clone_wrapper) |
369 | | - SAVE_CALLEE_SAVED_USER |
370 | | - bl @sys_clone |
371 | | - DISCARD_CALLEE_SAVED_USER |
372 | | - |
373 | | - GET_CURR_THR_INFO_FLAGS r10 |
374 | | - btst r10, TIF_SYSCALL_TRACE |
375 | | - bnz tracesys_exit |
376 | | - |
377 | | - b ret_from_system_call |
378 | | -END(sys_clone_wrapper) |
379 | | - |
380 | | -#ifdef CONFIG_ARC_DW2_UNWIND |
381 | | -; Workaround for bug 94179 (STAR ): |
382 | | -; Despite -fasynchronous-unwind-tables, linker is not making dwarf2 unwinder |
383 | | -; section (.debug_frame) as loadable. So we force it here. |
384 | | -; This also fixes STAR 9000487933 where the prev-workaround (objcopy --setflag) |
385 | | -; would not work after a clean build due to kernel build system dependencies. |
386 | | -.section .debug_frame, "wa",@progbits |
| 391 | +##### DONT ADD CODE HERE - .Lrestore_regs actually follows in entry-<isa>.S |
387 | 392 |
|
388 | | -; Reset to .text as this file is included in entry-<isa>.S |
389 | | -.section .text, "ax",@progbits |
390 | | -#endif |
|
0 commit comments