diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-21 15:54:27 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 22:13:54 -0500 |
commit | 38a61b6b4a45ec8c82c75403848e1c579113c3c5 (patch) | |
tree | 140ebeb63daf0a526a0a3ba91cd53991681e0ffe /arch/arm/kernel/process.c | |
parent | 1d4b4b2994b5fc208963c0b795291f8c1f18becf (diff) |
arm: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 90084a6de35a..4ab80bbb6d95 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -376,17 +376,18 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | |||
376 | 376 | ||
377 | int | 377 | int |
378 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 378 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
379 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs) | 379 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused) |
380 | { | 380 | { |
381 | struct thread_info *thread = task_thread_info(p); | 381 | struct thread_info *thread = task_thread_info(p); |
382 | struct pt_regs *childregs = task_pt_regs(p); | 382 | struct pt_regs *childregs = task_pt_regs(p); |
383 | 383 | ||
384 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); | 384 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); |
385 | 385 | ||
386 | if (likely(regs)) { | 386 | if (likely(!(p->flags & PF_KTHREAD))) { |
387 | *childregs = *regs; | 387 | *childregs = *current_pt_regs(); |
388 | childregs->ARM_r0 = 0; | 388 | childregs->ARM_r0 = 0; |
389 | childregs->ARM_sp = stack_start; | 389 | if (stack_start) |
390 | childregs->ARM_sp = stack_start; | ||
390 | } else { | 391 | } else { |
391 | memset(childregs, 0, sizeof(struct pt_regs)); | 392 | memset(childregs, 0, sizeof(struct pt_regs)); |
392 | thread->cpu_context.r4 = stk_sz; | 393 | thread->cpu_context.r4 = stk_sz; |
@@ -399,7 +400,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
399 | clear_ptrace_hw_breakpoint(p); | 400 | clear_ptrace_hw_breakpoint(p); |
400 | 401 | ||
401 | if (clone_flags & CLONE_SETTLS) | 402 | if (clone_flags & CLONE_SETTLS) |
402 | thread->tp_value = regs->ARM_r3; | 403 | thread->tp_value = childregs->ARM_r3; |
403 | 404 | ||
404 | thread_notify(THREAD_NOTIFY_COPY, thread); | 405 | thread_notify(THREAD_NOTIFY_COPY, thread); |
405 | 406 | ||