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 | |
parent | 64c2f6596bd84b05a781baf034fdd56ce1192d36 (diff) |
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')
-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 de9f032116c0..3665d287780f 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, | |||
761 | } else { | 761 | } else { |
762 | CHECK_FULL_REGS(regs); | 762 | CHECK_FULL_REGS(regs); |
763 | *childregs = *regs; | 763 | *childregs = *regs; |
764 | childregs->gpr[1] = usp; | 764 | if (usp) |
765 | childregs->gpr[1] = usp; | ||
765 | p->thread.regs = childregs; | 766 | p->thread.regs = childregs; |
766 | childregs->gpr[3] = 0; /* Result from fork() */ | 767 | childregs->gpr[3] = 0; /* Result from fork() */ |
767 | if (clone_flags & CLONE_SETTLS) { | 768 | if (clone_flags & CLONE_SETTLS) { |
@@ -1030,8 +1031,6 @@ int sys_clone(unsigned long clone_flags, unsigned long usp, | |||
1030 | int __user *child_tidp, int p6, | 1031 | int __user *child_tidp, int p6, |
1031 | struct pt_regs *regs) | 1032 | struct pt_regs *regs) |
1032 | { | 1033 | { |
1033 | if (usp == 0) | ||
1034 | usp = regs->gpr[1]; /* stack pointer for child */ | ||
1035 | return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp); | 1034 | return do_fork(clone_flags, usp, regs, 0, parent_tidp, child_tidp); |
1036 | } | 1035 | } |
1037 | 1036 | ||
@@ -1039,14 +1038,14 @@ int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, | |||
1039 | unsigned long p4, unsigned long p5, unsigned long p6, | 1038 | unsigned long p4, unsigned long p5, unsigned long p6, |
1040 | struct pt_regs *regs) | 1039 | struct pt_regs *regs) |
1041 | { | 1040 | { |
1042 | return do_fork(SIGCHLD, regs->gpr[1], regs, 0, NULL, NULL); | 1041 | return do_fork(SIGCHLD, 0, regs, 0, NULL, NULL); |
1043 | } | 1042 | } |
1044 | 1043 | ||
1045 | int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, | 1044 | int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, |
1046 | unsigned long p4, unsigned long p5, unsigned long p6, | 1045 | unsigned long p4, unsigned long p5, unsigned long p6, |
1047 | struct pt_regs *regs) | 1046 | struct pt_regs *regs) |
1048 | { | 1047 | { |
1049 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gpr[1], | 1048 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, |
1050 | regs, 0, NULL, NULL); | 1049 | regs, 0, NULL, NULL); |
1051 | } | 1050 | } |
1052 | 1051 | ||