aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2015-03-10 09:43:07 -0400
committerVineet Gupta <vgupta@synopsys.com>2015-06-19 08:39:38 -0400
commitc7e6d7920409c11f158ac5d38bdd08062bf16978 (patch)
tree4fd66522a312b2ad2efbb8035fa309e4b7c8a823
parent6d1a20b1d237db29878ae54142e39c87a36d0e95 (diff)
ARC: entry.S: move some code around for cache locality in return path
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r--arch/arc/kernel/entry-compact.S2
-rw-r--r--arch/arc/kernel/entry.S98
2 files changed, 52 insertions, 48 deletions
diff --git a/arch/arc/kernel/entry-compact.S b/arch/arc/kernel/entry-compact.S
index bf611ec9a017..abc62cd10a8c 100644
--- a/arch/arc/kernel/entry-compact.S
+++ b/arch/arc/kernel/entry-compact.S
@@ -391,3 +391,5 @@ not_level1_interrupt:
391 EXCEPTION_EPILOGUE 391 EXCEPTION_EPILOGUE
392debug_marker_syscall: 392debug_marker_syscall:
393 rtie 393 rtie
394
395END(ret_from_exception)
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 75cdc56351d9..603266eb75e1 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -24,6 +24,55 @@
24 *------------------------------------------------------------------ 24 *------------------------------------------------------------------
25 */ 25 */
26 26
27;################### Special Sys Call Wrappers ##########################
28
29ENTRY(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
39END(sys_clone_wrapper)
40
41ENTRY(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
531:
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
62END(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;################### Non TLB Exception Handling ############################# 76;################### Non TLB Exception Handling #############################
28 77
29; --------------------------------------------- 78; ---------------------------------------------
@@ -338,53 +387,6 @@ resume_kernel_mode:
338#endif 387#endif
339 388
340 b .Lrestore_regs 389 b .Lrestore_regs
341END(ret_from_exception)
342
343ENTRY(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
3551:
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
364END(ret_from_fork)
365 390
366;################### Special Sys Call Wrappers ########################## 391##### DONT ADD CODE HERE - .Lrestore_regs actually follows in entry-<isa>.S
367
368ENTRY(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
378END(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
387 392
388; Reset to .text as this file is included in entry-<isa>.S
389.section .text, "ax",@progbits
390#endif