aboutsummaryrefslogtreecommitdiffstats
path: root/arch/openrisc/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/openrisc/kernel/entry.S')
-rw-r--r--arch/openrisc/kernel/entry.S30
1 files changed, 10 insertions, 20 deletions
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S
index 374e63e7c9f6..dce86aef8aba 100644
--- a/arch/openrisc/kernel/entry.S
+++ b/arch/openrisc/kernel/entry.S
@@ -894,6 +894,16 @@ ENTRY(ret_from_fork)
894 l.jal schedule_tail 894 l.jal schedule_tail
895 l.nop 895 l.nop
896 896
897 /* Check if we are a kernel thread */
898 l.sfeqi r20,0
899 l.bf 1f
900 l.nop
901
902 /* ...we are a kernel thread so invoke the requested callback */
903 l.jalr r20
904 l.or r3,r22,r0
905
9061:
897 /* _syscall_returns expect r11 to contain return value */ 907 /* _syscall_returns expect r11 to contain return value */
898 l.lwz r11,PT_GPR11(r1) 908 l.lwz r11,PT_GPR11(r1)
899 909
@@ -915,26 +925,6 @@ ENTRY(ret_from_fork)
915 l.j _syscall_return 925 l.j _syscall_return
916 l.nop 926 l.nop
917 927
918/* Since syscalls don't save call-clobbered registers, the args to
919 * kernel_thread_helper will need to be passed through callee-saved
920 * registers and copied to the parameter registers when the thread
921 * begins running.
922 *
923 * See arch/openrisc/kernel/process.c:
924 * The args are passed as follows:
925 * arg1 (r3) : passed in r20
926 * arg2 (r4) : passed in r22
927 */
928
929ENTRY(_kernel_thread_helper)
930 l.or r3,r20,r0
931 l.or r4,r22,r0
932 l.movhi r31,hi(kernel_thread_helper)
933 l.ori r31,r31,lo(kernel_thread_helper)
934 l.jr r31
935 l.nop
936
937
938/* ========================================================[ switch ] === */ 928/* ========================================================[ switch ] === */
939 929
940/* 930/*