about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-12-15 21:07:43 +0000
committerJakub Jelinek <jakub@redhat.com>2004-12-15 21:07:43 +0000
commitd138a182cc117f5507f2c18c3e4322f6db19ce07 (patch)
tree8e348c89f38edd71a7046298802b79df47d85731 /sysdeps/unix/sysv/linux/powerpc
parent95eb6211a12e45aca7d6902fa779561563de4836 (diff)
downloadglibc-d138a182cc117f5507f2c18c3e4322f6db19ce07.tar.gz
glibc-d138a182cc117f5507f2c18c3e4322f6db19ce07.tar.xz
glibc-d138a182cc117f5507f2c18c3e4322f6db19ce07.zip
Updated to fedora-glibc-20041215T2056
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S25
2 files changed, 12 insertions, 19 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
index 891cf83631..f232284747 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S
@@ -48,7 +48,7 @@ ENTRY (BP_SYM (__clone))
 	beq-	cr0,L(badargs)
 
 	/* Set up stack frame for parent.  */
-	stwu	r1,-36(r1)
+	stwu	r1,-32(r1)
 #ifdef RESET_PID
 	stmw	r28,16(r1)
 #else
@@ -100,7 +100,7 @@ ENTRY (BP_SYM (__clone))
 #endif
 
 #ifdef RESET_PID
-	andis.	r0,r28,1	/* This is & CLONE_THREAD */
+	andis.	r0,r28,CLONE_THREAD>>16
 	bne+	r0,L(oldpid)
 	andi.	r0,r28,CLONE_VM
 	li	r3,-1
@@ -130,7 +130,7 @@ L(parent):
 	lmw	r30,16(r1)
 # endif
 #endif
-	addi	r1,r1,36
+	addi	r1,r1,32
 	bnslr+
 	b	JUMPTARGET(__syscall_error)
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index f6ce115077..287597c480 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -42,18 +42,17 @@ ENTRY (BP_SYM (__clone))
 
 	/* Check for child_stack == NULL || fn == NULL.  */
 	cmpdi	cr0,r4,0
-	ld	r0,0(r3)
-	cmpdi	cr1,r0,0
+	cmpdi	cr1,r3,0
 	cror	cr0*4+eq,cr1*4+eq,cr0*4+eq
 	beq-	cr0,L(badargs)
 
 	/* Set up stack frame for parent.  */
-	stdu	r1,-88(r1)
+	stdu	r1,-80(r1)
 	std	r29,56(r1)
 	std	r30,64(r1)
 	std	r31,72(r1)
 #ifdef RESET_PID
-	std	r28,80(r1)
+	std	r28,48(r1)
 #endif
 
 	/* Set up stack frame for child.  */
@@ -85,18 +84,12 @@ ENTRY (BP_SYM (__clone))
 	crandc	cr1*4+eq,cr1*4+eq,cr0*4+so
 	bne-	cr1,L(parent)		/* The '-' is to minimise the race.  */
 
-	/* On at least mklinux DR3a5, clone() doesn't actually change
-	   the stack pointer.  I'm pretty sure this is a bug, because
-	   it adds a race condition if a signal is sent to a thread
-	   just after it is created (in the previous three instructions).  */
-	mr	r1,r30
-
 #ifdef RESET_PID
-	rldicl.	r0,r28,48,63	/* This is & CLONE_THREAD */
-	bne+	r0,L(oldpid)
-	rldicl.	r0,r28,56,63	/* This is & CLONE_VM */
+	andis.	r0,r28,CLONE_THREAD>>16
+	bne+	cr0,L(oldpid)
+	andi.	r0,r28,CLONE_VM
 	li	r3,-1
-	bne-	r0,L(nomoregetpid)
+	bne-	cr0,L(nomoregetpid)
 	DO_CALL(SYS_ify(getpid))
 L(nomoregetpid):
 	stw	r3,TID(r13)
@@ -122,12 +115,12 @@ L(oldpid):
 L(parent):
 	/* Parent.  Restore registers & return.  */
 #ifdef RESET_PID
-	ld	r28,88(r1)
+	ld	r28,48(r1)
 #endif
 	ld	r31,72(r1)
 	ld	r30,64(r1)
 	ld	r29,56(r1)
-	addi	r1,r1,88
+	addi	r1,r1,80
 	bnslr+
 	b	JUMPTARGET(__syscall_error)