aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S10
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S8
2 files changed, 7 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
index eb973db0b8..9d496f0a4c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
@@ -76,13 +76,11 @@ ENTRY (__clone)
crandc cr1*4+eq,cr1*4+eq,cr0*4+so
bne- cr1,L(parent) /* The '-' is to minimise the race. */
- andis. r0,r28,CLONE_THREAD>>16
- bne+ r0,L(oldpid)
- andi. r0,r28,CLONE_VM
- li r3,-1
- bne- r0,L(nomoregetpid)
+ /* If CLONE_VM is set do not update the pid/tid field. */
+ andi. r0,r29,CLONE_VM
+ bne+ cr0,L(oldpid)
+
DO_CALL(SYS_ify(getpid))
-L(nomoregetpid):
stw r3,TID(r2)
stw r3,PID(r2)
L(oldpid):
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index 959fdb7b76..7c59b9b4e9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -78,13 +78,11 @@ ENTRY (__clone)
crandc cr1*4+eq,cr1*4+eq,cr0*4+so
bne- cr1,L(parent) /* The '-' is to minimise the race. */
- andis. r0,r29,CLONE_THREAD>>16
+ /* If CLONE_VM is set do not update the pid/tid field. */
+ rldicl. r0,r29,56,63 /* flags & CLONE_VM. */
bne+ cr0,L(oldpid)
- andi. r0,r29,CLONE_VM
- li r3,-1
- bne- cr0,L(nomoregetpid)
+
DO_CALL(SYS_ify(getpid))
-L(nomoregetpid):
stw r3,TID(r13)
stw r3,PID(r13)
L(oldpid):