From 9e14f828ee4a7a4a98703e380d180717a579fb35 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 9 Sep 2012 21:31:07 -0400 Subject: arm: split ret_from_fork, simplify kernel_thread() [based on patch by rmk] Signed-off-by: Al Viro --- arch/arm/kernel/entry-common.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/arm/kernel/entry-common.S') diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 978eac57e04a..9a48b7a577e7 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -91,6 +91,18 @@ ENTRY(ret_from_fork) b ret_slow_syscall ENDPROC(ret_from_fork) +ENTRY(ret_from_kernel_thread) + UNWIND(.fnstart) + UNWIND(.cantunwind) + bl schedule_tail + mov r0, r4 + adr lr, BSYM(1f) @ kernel threads should not exit + mov pc, r5 +1: bl do_exit + nop + UNWIND(.fnend) +ENDPROC(ret_from_kernel_thread) + .equ NR_syscalls,0 #define CALL(x) .equ NR_syscalls,NR_syscalls+1 #include "calls.S" -- cgit From 583d632fb3f6d7e9d133a7260829dd7565f8cc99 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 2 Aug 2012 11:46:39 +0400 Subject: arm: introduce ret_from_kernel_execve(), switch to generic kernel_execve() Signed-off-by: Al Viro --- arch/arm/kernel/entry-common.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/arm/kernel/entry-common.S') diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 9a48b7a577e7..4a6e46a9a3d7 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -103,6 +103,18 @@ ENTRY(ret_from_kernel_thread) UNWIND(.fnend) ENDPROC(ret_from_kernel_thread) +/* + * turn a kernel thread into userland process + * use: ret_from_kernel_execve(struct pt_regs *normal) + */ +ENTRY(ret_from_kernel_execve) + mov why, #0 @ not a syscall + str why, [r0, #S_R0] @ ... and we want 0 in ->ARM_r0 as well + get_thread_info tsk @ thread structure + mov sp, r0 @ stack pointer just under pt_regs + b ret_slow_syscall +ENDPROC(ret_from_kernel_execve) + .equ NR_syscalls,0 #define CALL(x) .equ NR_syscalls,NR_syscalls+1 #include "calls.S" -- cgit From a63c97a000c9c9a03372943a40c3ba8652aa0ccf Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 2 Aug 2012 11:52:41 +0400 Subject: arm: get rid of execve wrapper, switch to generic execve() implementation Signed-off-by: Al Viro --- arch/arm/kernel/entry-common.S | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/arm/kernel/entry-common.S') diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 4a6e46a9a3d7..ed7941277ca2 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -532,11 +532,6 @@ sys_vfork_wrapper: b sys_vfork ENDPROC(sys_vfork_wrapper) -sys_execve_wrapper: - add r3, sp, #S_OFF - b sys_execve -ENDPROC(sys_execve_wrapper) - sys_clone_wrapper: add ip, sp, #S_OFF str ip, [sp, #4] -- cgit