diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-21 22:28:43 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-21 22:28:43 -0400 |
commit | ea516b11545afa5b1420621981c1411a62bef87e (patch) | |
tree | 767e77302b6311f0956160a15bc6089537ee4798 /arch/powerpc/kernel/process.c | |
parent | 64c2f6596bd84b05a781baf034fdd56ce1192d36 (diff) | |
download | op-kernel-dev-ea516b11545afa5b1420621981c1411a62bef87e.zip op-kernel-dev-ea516b11545afa5b1420621981c1411a62bef87e.tar.gz |
powerpc: put the "zero usp means using parent's stack pointer" to copy_thread()
simplifies callers, at that...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index de9f032..3665d28 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -761,7 +761,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, } else { CHECK_FULL_REGS(regs); *childregs = *regs; - childregs->gpr[1] = usp; + if (usp) + childregs->gpr[1] = usp; p->thread.regs = childregs; childregs->gpr[3] = 0; /* Result from fork() */ if (clone_flags & CLONE_SETTLS) { @@ -1030,8 +1031,6 @@ int sys_clone(unsigned long clone_flags, unsigned long usp, int __user *child_tidp, int p6, struct pt_regs *regs) { - if (usp == 0) - usp = regs->gpr[1]; /* stack pointer for child */ return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp); } @@ -1039,14 +1038,14 @@ int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, unsigned long p4, unsigned long p5, unsigned long p6, struct pt_regs *regs) { - return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL); + return do_fork(SIGCHLD, 0, regs, 0, NULL, NULL); } int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, unsigned long p4, unsigned long p5, unsigned long p6, struct pt_regs *regs) { - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1], + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, regs, 0, NULL, NULL); } |