aboutsummaryrefslogtreecommitdiff
path: root/arch/score/kernel
diff options
context:
space:
mode:
authorAl Viro2012-10-21 16:44:57 -0400
committerAl Viro2012-11-28 23:43:40 -0500
commiteda96977024c84e677191cad785351abbb945901 (patch)
treea1038d27bb6b4399d8625da045c4af31d12df4e5 /arch/score/kernel
parent951b39619a76643972f6f23e007fd0f3fbbd71c2 (diff)
score: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/score/kernel')
-rw-r--r--arch/score/kernel/entry.S18
-rw-r--r--arch/score/kernel/process.c8
-rw-r--r--arch/score/kernel/sys_score.c35
3 files changed, 4 insertions, 57 deletions
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S
index da9901088bbb..1557ca1a2951 100644
--- a/arch/score/kernel/entry.S
+++ b/arch/score/kernel/entry.S
@@ -487,11 +487,6 @@ illegal_syscall:
sw r9, [r0, PT_R7]
j syscall_return
-ENTRY(sys_clone)
- mv r4, r0
- la r8, score_clone
- br r8
-
ENTRY(sys_rt_sigreturn)
mv r4, r0
la r8, score_rt_sigreturn
@@ -501,16 +496,3 @@ ENTRY(sys_sigaltstack)
mv r4, r0
la r8, score_sigaltstack
br r8
-
-#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
-ENTRY(sys_fork)
- mv r4, r0
- la r8, score_fork
- br r8
-
-ENTRY(sys_vfork)
- mv r4, r0
- la r8, score_vfork
- br r8
-#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
-
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c
index 6f311cf64b99..f96379a5aee0 100644
--- a/arch/score/kernel/process.c
+++ b/arch/score/kernel/process.c
@@ -94,17 +94,17 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
struct pt_regs *childregs = task_pt_regs(p);
p->thread.reg0 = (unsigned long) childregs;
- if (unlikely(!regs)) {
+ if (unlikely(p->flags & PF_KTHREAD)) {
memset(childregs, 0, sizeof(struct pt_regs));
p->thread->reg12 = usp;
p->thread->reg13 = arg;
p->thread.reg3 = (unsigned long) ret_from_kernel_thread;
} else {
- *childregs = *regs;
+ *childregs = *current_pt_regs();
childregs->regs[7] = 0; /* Clear error flag */
childregs->regs[4] = 0; /* Child gets zero as return value */
- childregs->regs[0] = usp; /* user fork */
- regs->regs[4] = p->pid; /* WTF? */
+ if (usp)
+ childregs->regs[0] = usp; /* user fork */
p->thread.reg3 = (unsigned long) ret_from_fork;
}
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c
index c54434c2fd9d..47c20ba46167 100644
--- a/arch/score/kernel/sys_score.c
+++ b/arch/score/kernel/sys_score.c
@@ -48,38 +48,3 @@ sys_mmap(unsigned long addr, unsigned long len, unsigned long prot,
return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
}
-
-asmlinkage long
-score_fork(struct pt_regs *regs)
-{
- return do_fork(SIGCHLD, regs->regs[0], regs, 0, NULL, NULL);
-}
-
-/*
- * Clone a task - this clones the calling program thread.
- * This is called indirectly via a small wrapper
- */
-asmlinkage long
-score_clone(struct pt_regs *regs)
-{
- unsigned long clone_flags;
- unsigned long newsp;
- int __user *parent_tidptr, *child_tidptr;
-
- clone_flags = regs->regs[4];
- newsp = regs->regs[5];
- if (!newsp)
- newsp = regs->regs[0];
- parent_tidptr = (int __user *)regs->regs[6];
- child_tidptr = (int __user *)regs->regs[8];
-
- return do_fork(clone_flags, newsp, regs, 0,
- parent_tidptr, child_tidptr);
-}
-
-asmlinkage long
-score_vfork(struct pt_regs *regs)
-{
- return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
- regs->regs[0], regs, 0, NULL, NULL);
-}