summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/entry.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-10-25 11:10:50 +0400
committerChris Zankel <chris@zankel.net>2012-10-25 15:00:03 -0700
commit3306a72669a2af23b324540b08e68e82ac5b7dab (patch)
tree0363c3f7120560ccf1750281a5ab366640734181 /arch/xtensa/kernel/entry.S
parent6ebe7da25b7879194fdb5c43ea67b383dd9014d6 (diff)
downloadop-kernel-dev-3306a72669a2af23b324540b08e68e82ac5b7dab.zip
op-kernel-dev-3306a72669a2af23b324540b08e68e82ac5b7dab.tar.gz
xtensa: switch to generic kernel_thread()
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/kernel/entry.S')
-rw-r--r--arch/xtensa/kernel/entry.S41
1 files changed, 13 insertions, 28 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index 18453067..d4ec138 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -1833,34 +1833,6 @@ ENTRY(system_call)
/*
- * Create a kernel thread
- *
- * int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
- * a2 a2 a3 a4
- */
-
-ENTRY(kernel_thread)
- entry a1, 16
-
- mov a5, a2 # preserve fn over syscall
- mov a7, a3 # preserve args over syscall
-
- movi a3, _CLONE_VM | _CLONE_UNTRACED
- movi a2, __NR_clone
- or a6, a4, a3 # arg0: flags
- mov a3, a1 # arg1: sp
- syscall
-
- beq a3, a1, 1f # branch if parent
- mov a6, a7 # args
- callx4 a5 # fn(args)
-
- movi a2, __NR_exit
- syscall # return value of fn(args) still in a6
-
-1: retw
-
-/*
* Do a system call from kernel instead of calling sys_execve, so we end up
* with proper pt_regs.
*
@@ -1958,3 +1930,16 @@ ENTRY(ret_from_fork)
j common_exception_return
+/*
+ * Kernel thread creation helper
+ * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg
+ * left from _switch_to: a6 = prev
+ */
+ENTRY(ret_from_kernel_thread)
+
+ call4 schedule_tail
+ mov a6, a3
+ callx4 a2
+ call4 do_exit
+
+ENDPROC(ret_from_kernel_thread)
OpenPOWER on IntegriCloud