diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 12:02:25 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 12:02:25 +0900 |
commit | 42859eea96ba6beabfb0369a1eeffa3c7d2bd9cb (patch) | |
tree | fa38aeda0d6e7a4c48a882b166b8643594a1ad50 /arch/arm/kernel/entry-common.S | |
parent | f59b51fe3d3092c08d7d554ecb40db24011b2ebc (diff) | |
parent | f322220d6159455da2b5a8a596d802c8695fed30 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull generic execve() changes from Al Viro:
"This introduces the generic kernel_thread() and kernel_execve()
functions, and switches x86, arm, alpha, um and s390 over to them."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (26 commits)
s390: convert to generic kernel_execve()
s390: switch to generic kernel_thread()
s390: fold kernel_thread_helper() into ret_from_fork()
s390: fold execve_tail() into start_thread(), convert to generic sys_execve()
um: switch to generic kernel_thread()
x86, um/x86: switch to generic sys_execve and kernel_execve
x86: split ret_from_fork
alpha: introduce ret_from_kernel_execve(), switch to generic kernel_execve()
alpha: switch to generic kernel_thread()
alpha: switch to generic sys_execve()
arm: get rid of execve wrapper, switch to generic execve() implementation
arm: optimized current_pt_regs()
arm: introduce ret_from_kernel_execve(), switch to generic kernel_execve()
arm: split ret_from_fork, simplify kernel_thread() [based on patch by rmk]
generic sys_execve()
generic kernel_execve()
new helper: current_pt_regs()
preparation for generic kernel_thread()
um: kill thread->forking
um: let signal_delivered() do SIGTRAP on singlestepping into handler
...
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index f45987037bf..e340fa1db20 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -91,6 +91,30 @@ 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) + +/* + * 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" @@ -517,11 +541,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] |