diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-21 22:40:35 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-29 04:16:06 +0100 |
commit | b9763ce33fff6b37e1f2e2effb14fb25e67a68f2 (patch) | |
tree | 22b34cd0cfdcec8f20aa67dd67ef8183c1b5cc1f /arch/frv/kernel/process.c | |
parent | powerpc: switch to generic fork/clone/vfork (diff) | |
download | linux-b9763ce33fff6b37e1f2e2effb14fb25e67a68f2.tar.xz linux-b9763ce33fff6b37e1f2e2effb14fb25e67a68f2.zip |
frv: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r-- | arch/frv/kernel/process.c | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 7e33215f1d8f..0039bf77b192 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c @@ -139,42 +139,12 @@ inline unsigned long user_stack(const struct pt_regs *regs) return user_mode(regs) ? regs->sp : 0; } -asmlinkage int sys_fork(void) -{ -#ifndef CONFIG_MMU - /* fork almost works, enough to trick you into looking elsewhere:-( */ - return -EINVAL; -#else - return do_fork(SIGCHLD, user_stack(__frame), __frame, 0, NULL, NULL); -#endif -} - -asmlinkage int sys_vfork(void) -{ - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, user_stack(__frame), __frame, 0, - NULL, NULL); -} - -/*****************************************************************************/ -/* - * clone a process - * - tlsptr is retrieved by copy_thread() - */ -asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, - int __user *parent_tidptr, int __user *child_tidptr, - int __user *tlsptr) -{ - if (!newsp) - newsp = user_stack(__frame); - return do_fork(clone_flags, newsp, __frame, 0, parent_tidptr, child_tidptr); -} /* end sys_clone() */ - /* * set up the kernel stack and exception frames for a new process */ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg, - struct task_struct *p, struct pt_regs *regs) + struct task_struct *p, struct pt_regs *unused) { struct pt_regs *childregs; @@ -182,9 +152,7 @@ int copy_thread(unsigned long clone_flags, (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE); /* set up the userspace frame (the only place that the USP is stored) */ - *childregs = *__kernel_frame0_ptr; - - p->set_child_tid = p->clear_child_tid = NULL; + *childregs = *current_pt_regs(); p->thread.frame = childregs; p->thread.curr = p; @@ -193,18 +161,15 @@ int copy_thread(unsigned long clone_flags, p->thread.lr = 0; p->thread.frame0 = childregs; - if (unlikely(!regs)) { + if (unlikely(p->flags & PF_KTHREAD)) { childregs->gr9 = usp; /* function */ childregs->gr8 = arg; p->thread.pc = (unsigned long) ret_from_kernel_thread; save_user_regs(p->thread.user); return 0; } - - /* set up the userspace frame (the only place that the USP is stored) */ - *childregs = *regs; - - childregs->sp = usp; + if (usp) + childregs->sp = usp; childregs->next_frame = NULL; p->thread.pc = (unsigned long) ret_from_fork; |