about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-08 10:30:42 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-08 10:30:42 +0000
commitccf1d5737a2241f2521eb3af2bbf0c118dce828d (patch)
treef3bc34979cc66a962df2b25097bec078cdaeaca2
parentd130a3415649b36ac672ab49068aec7c02a8135c (diff)
downloadglibc-ccf1d5737a2241f2521eb3af2bbf0c118dce828d.tar.gz
glibc-ccf1d5737a2241f2521eb3af2bbf0c118dce828d.tar.xz
glibc-ccf1d5737a2241f2521eb3af2bbf0c118dce828d.zip
Update.
	* tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
	* tst-signal3.c (do_test): Likewise.
	* tst-sem5.c (do_test): Likewise.
	* tst-kill6.c (do_test): Likewise.
	* tst-tls3.c (do_test): Likewise.  Include <errno.h>.

	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
	of inc/dec.
	* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
-rw-r--r--nptl/ChangeLog27
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S10
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S14
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S16
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S18
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S20
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S16
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S12
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S14
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/lowlevelsem.h8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S2
-rw-r--r--nptl/tst-kill6.c3
-rw-r--r--nptl/tst-sem5.c4
-rw-r--r--nptl/tst-signal3.c5
-rw-r--r--nptl/tst-tls2.c3
-rw-r--r--nptl/tst-tls3.c3
23 files changed, 116 insertions, 85 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 4f5dc87d06..4018220e33 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,32 @@
 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
 
+	* tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
+	* tst-signal3.c (do_test): Likewise.
+	* tst-sem5.c (do_test): Likewise.
+	* tst-kill6.c (do_test): Likewise.
+	* tst-tls3.c (do_test): Likewise.  Include <errno.h>.
+
+	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
+	of inc/dec.
+	* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
+	* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
+	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
+	Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
+	Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
+	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
+
 	* allocatestack.c (allocate_stack): If mprotect() fails free the
 	TLS memory.
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
index a40526c740..acff4c580d 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
@@ -77,7 +77,7 @@ lll_unlock_wake_cb:
 
 	movl	20(%esp), %ebx
 	LOCK
-	incl	(%ebx)
+	addl	$1, (%ebx)
 	jng	1f
 
 	popl	%edx
@@ -140,7 +140,7 @@ __lll_timedwait_tid:
 	subl	%eax, %edx
 	jns	5f
 	addl	$1000000000, %edx
-	decl	%ecx
+	subl	$1, %ecx
 5:	testl	%ecx, %ecx
 	js	6f		/* Time is already up.  */
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
index 3e6a71c1b4..be488a7c05 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
@@ -107,7 +107,7 @@ __lll_mutex_timedlock_wait:
 	subl	%eax, %edx
 	jns	4f
 	addl	$1000000000, %edx
-	decl	%ecx
+	subl	$1, %ecx
 4:	testl	%ecx, %ecx
 	js	5f		/* Time is already up.  */
 
@@ -159,9 +159,9 @@ __lll_mutex_unlock_wake:
 	pushl	%ecx
 	pushl	%edx
 
-	movl	$FUTEX_WAKE, %ecx
 	movl	%eax, %ebx
-	movl	$0, (%ebx)
+	movl	$0, (%eax)
+	movl	$FUTEX_WAKE, %ecx
 	movl	$1, %edx	/* Wake one thread.  */
 	movl	$SYS_futex, %eax
 	ENTER_KERNEL
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
index d36bc7e1b2..f7c8166c72 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
@@ -53,7 +53,7 @@ pthread_barrier_wait:
 
 	/* One less waiter.  If this was the last one needed wake
 	   everybody.  */
-2:	decl	LEFT(%ebx)
+2:	subl	$1, LEFT(%ebx)
 	je	3f
 
 	/* There are more threads to come.  */
@@ -67,7 +67,7 @@ pthread_barrier_wait:
 
 	/* Release the mutex.  */
 	LOCK
-	incl	MUTEX(%ebx)
+	addl	$1, MUTEX(%ebx)
 	jng	6f
 
 	/* Wait for the remaining threads.  The call will return immediately
@@ -98,9 +98,9 @@ pthread_barrier_wait:
 3:	movl	INIT_COUNT(%ebx), %eax
 	movl	%eax, LEFT(%ebx)
 #if CURR_EVENT == 0
-	incl	(%ebx)
+	addl	$1, (%ebx)
 #else
-	incl	CURR_EVENT(%ebx)
+	addl	$1, CURR_EVENT(%ebx)
 #endif
 
 	/* Wake up all waiters.  The count is a signed number in the kernel
@@ -114,7 +114,7 @@ pthread_barrier_wait:
 	   waking the waiting threads since otherwise a new thread might
 	   arrive and gets waken up, too.  */
 	LOCK
-	incl	MUTEX(%ebx)
+	addl	$1, MUTEX(%ebx)
 	jng	4f
 
 5:	orl	$-1, %eax		/* == PTHREAD_BARRIER_SERIAL_THREAD */
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
index 49fe9d761b..0fa402a95e 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
@@ -71,7 +71,7 @@ __pthread_cond_broadcast:
 
 	/* Unlock.  */
 	LOCK
-	decl	cond_lock-wakeup_seq(%ebx)
+	subl	$1, cond_lock-wakeup_seq(%ebx)
 	jne	7f
 
 	/* Wake up all threads.  */
@@ -87,7 +87,7 @@ __pthread_cond_broadcast:
 	.align	16
 	/* Unlock.  */
 4:	LOCK
-	decl	cond_lock-wakeup_seq(%ebx)
+	subl	$1, cond_lock-wakeup_seq(%ebx)
 	jne	5f
 
 6:	xorl	%eax, %eax
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
index 807d2f5015..5465d7b2a8 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
@@ -76,7 +76,7 @@ __pthread_cond_signal:
 
 	/* Unlock.  */
 4:	LOCK
-	decl	cond_lock-wakeup_seq(%ebx)
+	subl	$1, cond_lock-wakeup_seq(%ebx)
 	jne	5f
 
 6:	xorl	%eax, %eax
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
index 090fecbd43..122be6f714 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
@@ -102,9 +102,9 @@ __pthread_cond_timedwait:
 	/* Unlock.  */
 8:	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	jne	3f
 
@@ -129,7 +129,7 @@ __pthread_cond_timedwait:
 	subl	%eax, %edx
 	jns	12f
 	addl	$1000000000, %edx
-	decl	%ecx
+	subl	$1, %ecx
 12:	testl	%ecx, %ecx
 	js	13f
 
@@ -190,9 +190,9 @@ __pthread_cond_timedwait:
 
 	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	jne	10f
 
@@ -259,9 +259,9 @@ __pthread_cond_timedwait:
 16:	movl	%eax, (%esp)
 	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	jne	17f
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
index 58ef65e551..a679ee65e6 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
@@ -71,9 +71,9 @@ __condvar_cleanup:
 
 	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	je	2f
 #if cond_lock == 0
@@ -159,9 +159,9 @@ __pthread_cond_wait:
 	/* Unlock.  */
 8:	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	jne	3f
 
@@ -211,9 +211,9 @@ __pthread_cond_wait:
 
 	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	jne	10f
 
@@ -277,9 +277,9 @@ __pthread_cond_wait:
 12:	movl	%eax, (%esp)
 	LOCK
 #if cond_lock == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	cond_lock(%ebx)
+	subl	$1, cond_lock(%ebx)
 #endif
 	jne	13f
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
index f8f2e06b18..1ddc6bb323 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
@@ -66,16 +66,16 @@ __pthread_rwlock_rdlock:
 	cmpl	$0, FLAGS(%ebx)
 	je	5f
 
-3:	incl	READERS_QUEUED(%ebx)
+3:	addl	$1, READERS_QUEUED(%ebx)
 	je	4f
 
 	movl	READERS_WAKEUP(%ebx), %edx
 
 	LOCK
 #if MUTEX == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	MUTEX(%ebx)
+	subl	$1, MUTEX(%ebx)
 #endif
 	jne	10f
 
@@ -97,17 +97,17 @@ __pthread_rwlock_rdlock:
 	testl	%eax, %eax
 	jne	12f
 
-13:	decl	READERS_QUEUED(%ebx)
+13:	subl	$1, READERS_QUEUED(%ebx)
 	jmp	2b
 
 5:	xorl	%ecx, %ecx
-	incl	NR_READERS(%ebx)
+	addl	$1, NR_READERS(%ebx)
 	je	8f
 9:	LOCK
 #if MUTEX == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	MUTEX(%ebx)
+	subl	$1, MUTEX(%ebx)
 #endif
 	jne	6f
 7:
@@ -142,12 +142,12 @@ __pthread_rwlock_rdlock:
 	jmp	7b
 
 	/* Overflow.  */
-8:	decl	NR_READERS(%ebx)
+8:	subl	$1, NR_READERS(%ebx)
 	movl	$EAGAIN, %ecx
 	jmp	9b
 
 	/* Overflow.  */
-4:	decl	READERS_QUEUED(%ebx)
+4:	subl	$1, READERS_QUEUED(%ebx)
 	movl	$EAGAIN, %ecx
 	jmp	9b
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
index 2e47350990..a69e857a14 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
@@ -76,16 +76,16 @@ pthread_rwlock_timedrdlock:
 3:	cmpl	$1000000000, 4(%edi)
 	jae	19f
 
-	incl	READERS_QUEUED(%ebp)
+	addl	$1, READERS_QUEUED(%ebp)
 	je	4f
 
 	movl	READERS_WAKEUP(%ebp), %esi
 
 	LOCK
 #if MUTEX == 0
-	decl	(%ebp)
+	subl	$1, (%ebp)
 #else
-	decl	MUTEX(%ebp)
+	subl	$1, MUTEX(%ebp)
 #endif
 	jne	10f
 
@@ -105,7 +105,7 @@ pthread_rwlock_timedrdlock:
 	subl	%eax, %edx
 	jns	15f
 	addl	$1000000000, %edx
-	decl	%ecx
+	subl	$1, %ecx
 15:	testl	%ecx, %ecx
 	js	16f		/* Time is already up.  */
 
@@ -132,7 +132,7 @@ pthread_rwlock_timedrdlock:
 	testl	%eax, %eax
 	jne	12f
 
-13:	decl	READERS_QUEUED(%ebp)
+13:	subl	$1, READERS_QUEUED(%ebp)
 	cmpl	$-ETIMEDOUT, %edx
 	jne	2b
 
@@ -141,13 +141,13 @@ pthread_rwlock_timedrdlock:
 
 
 5:	xorl	%ecx, %ecx
-	incl	NR_READERS(%ebp)
+	addl	$1, NR_READERS(%ebp)
 	je	8f
 9:	LOCK
 #if MUTEX == 0
-	decl	(%ebp)
+	subl	$1, (%ebp)
 #else
-	decl	MUTEX(%ebp)
+	subl	$1, MUTEX(%ebp)
 #endif
 	jne	6f
 
@@ -184,12 +184,12 @@ pthread_rwlock_timedrdlock:
 	jmp	7b
 
 	/* Overflow.  */
-8:	decl	NR_READERS(%ebp)
+8:	subl	$1, NR_READERS(%ebp)
 	movl	$EAGAIN, %ecx
 	jmp	9b
 
 	/* Overflow.  */
-4:	decl	READERS_QUEUED(%ebp)
+4:	subl	$1, READERS_QUEUED(%ebp)
 	movl	$EAGAIN, %ecx
 	jmp	9b
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
index fd9747e8e6..bd812263f1 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
@@ -74,16 +74,16 @@ pthread_rwlock_timedwrlock:
 3:	cmpl	$1000000000, 4(%edi)
 	jae	19f
 
-	incl	WRITERS_QUEUED(%ebp)
+	addl	$1, WRITERS_QUEUED(%ebp)
 	je	4f
 
 	movl	WRITERS_WAKEUP(%ebp), %esi
 
 	LOCK
 #if MUTEX == 0
-	decl	(%ebp)
+	subl	$1, (%ebp)
 #else
-	decl	MUTEX(%ebp)
+	subl	$1, MUTEX(%ebp)
 #endif
 	jne	10f
 
@@ -103,7 +103,7 @@ pthread_rwlock_timedwrlock:
 	subl	%eax, %edx
 	jns	15f
 	addl	$1000000000, %edx
-	decl	%ecx
+	subl	$1, %ecx
 15:	testl	%ecx, %ecx
 	js	16f		/* Time is already up.  */
 
@@ -130,7 +130,7 @@ pthread_rwlock_timedwrlock:
 	testl	%eax, %eax
 	jne	12f
 
-13:	decl	WRITERS_QUEUED(%ebp)
+13:	subl	$1, WRITERS_QUEUED(%ebp)
 	cmpl	$-ETIMEDOUT, %edx
 	jne	2b
 
@@ -143,9 +143,9 @@ pthread_rwlock_timedwrlock:
 	movl	%eax, WRITER(%ebp)
 9:	LOCK
 #if MUTEX == 0
-	decl	(%ebp)
+	subl	$1, (%ebp)
 #else
-	decl	MUTEX(%ebp)
+	subl	$1, MUTEX(%ebp)
 #endif
 	jne	6f
 
@@ -182,7 +182,7 @@ pthread_rwlock_timedwrlock:
 	jmp	7b
 
 	/* Overflow.  */
-4:	decl	WRITERS_QUEUED(%ebp)
+4:	subl	$1, WRITERS_QUEUED(%ebp)
 	movl	$EAGAIN, %ecx
 	jmp	9b
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
index c51c148c55..35f61bf0f9 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
@@ -56,7 +56,7 @@ __pthread_rwlock_unlock:
 
 2:	cmpl	$0, WRITER(%edi)
 	jne	5f
-	decl	NR_READERS(%edi)
+	subl	$1, NR_READERS(%edi)
 	jnz	6f
 
 5:	movl	$0, WRITER(%edi)
@@ -74,12 +74,12 @@ __pthread_rwlock_unlock:
 	movl	$0x7fffffff, %edx
 	leal	READERS_WAKEUP(%edi), %ebx
 
-0:	incl	(%ebx)
+0:	addl	$1, (%ebx)
 	LOCK
 #if MUTEX == 0
-	decl	(%edi)
+	subl	$1, (%edi)
 #else
-	decl	MUTEX(%edi)
+	subl	$1, MUTEX(%edi)
 #endif
 	jne	7f
 
@@ -94,9 +94,9 @@ __pthread_rwlock_unlock:
 	.align	16
 6:	LOCK
 #if MUTEX == 0
-	decl	(%edi)
+	subl	$1, (%edi)
 #else
-	decl	MUTEX(%edi)
+	subl	$1, MUTEX(%edi)
 #endif
 	jne	3f
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
index 080e66305e..939a3176e0 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
@@ -64,16 +64,16 @@ __pthread_rwlock_wrlock:
 	cmp	$0, NR_READERS(%ebx)
 	je	5f
 
-3:	incl	WRITERS_QUEUED(%ebx)
+3:	addl	$1, WRITERS_QUEUED(%ebx)
 	je	4f
 
 	movl	WRITERS_WAKEUP(%ebx), %edx
 
 	LOCK
 #if MUTEX == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	MUTEX(%ebx)
+	subl	$1, MUTEX(%ebx)
 #endif
 	jne	10f
 
@@ -95,7 +95,7 @@ __pthread_rwlock_wrlock:
 	testl	%eax, %eax
 	jne	12f
 
-13:	decl	WRITERS_QUEUED(%ebx)
+13:	subl	$1, WRITERS_QUEUED(%ebx)
 	jmp	2b
 
 5:	xorl	%ecx, %ecx
@@ -103,9 +103,9 @@ __pthread_rwlock_wrlock:
 	movl	%eax, WRITER(%ebx)
 9:	LOCK
 #if MUTEX == 0
-	decl	(%ebx)
+	subl	$1, (%ebx)
 #else
-	decl	MUTEX(%ebx)
+	subl	$1, MUTEX(%ebx)
 #endif
 	jne	6f
 7:
@@ -138,7 +138,7 @@ __pthread_rwlock_wrlock:
 	call	__lll_mutex_unlock_wake
 	jmp	7b
 
-4:	decl	WRITERS_QUEUED(%ebx)
+4:	subl	$1, WRITERS_QUEUED(%ebx)
 	movl	$EAGAIN, %ecx
 	jmp	9b
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
index 23f33059cc..0747fb19fa 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
@@ -48,7 +48,7 @@ __new_sem_post:
 
 	movl	$SYS_futex, %eax
 	movl	$FUTEX_WAKE, %ecx
-	incl	%edx
+	addl	$1, %edx
 	ENTER_KERNEL
 
 	testl	%eax, %eax
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
index 4d01b2e502..e39a6dde8e 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
@@ -85,7 +85,7 @@ sem_timedwait:
 	subl	%eax, %edx
 	jns	5f
 	addl	$1000000000, %edx
-	decl	%ecx
+	subl	$1, %ecx
 5:	testl	%ecx, %ecx
 	movl	$ETIMEDOUT, %eax
 	js	6f		/* Time is already up.  */
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index 8b302c9dc4..c073a834a8 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -99,7 +99,7 @@ extern int __lll_mutex_unlock_wait (int *__futex)
 
 #define lll_mutex_unlock(futex) \
   (void) ({ int ignore;							      \
-            __asm __volatile (LOCK_INSTR "decl %0\n\t"			      \
+            __asm __volatile (LOCK_INSTR "subl $1,%0\n\t"		      \
 			      "jne 1f\n\t"				      \
 			      ".subsection 1\n"				      \
 			      "1:\tleal %0, %%eax\n\t"			      \
@@ -167,7 +167,7 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
 
 # define lll_unlock(futex) \
   (void) ({ int ignore;							      \
-            __asm __volatile (LOCK_INSTR "incl %0\n\t"			      \
+            __asm __volatile (LOCK_INSTR "addl $1,%0\n\t"		      \
 			      "jng 1f\n\t"				      \
 			      ".subsection 1\n"				      \
 			      "1:\tleal %0, %%eax\n\t"			      \
@@ -225,7 +225,7 @@ extern int __libc_locking_needed attribute_hidden;
             __asm __volatile ("cmpl $0, %%gs:%P3\n\t"			      \
 			      "je,pt 0f\n\t"				      \
 			      "lock\n"					      \
-			      "0:\tincl %0\n\t"				      \
+			      "0:\taddl $1,%0\n\t"			      \
 			      "jng 1f\n\t"				      \
 			      ".subsection 1\n"				      \
 			      "1:\tleal %0, %%eax\n\t"			      \
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevelsem.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevelsem.h
index 59c1602ddb..a273c33cb2 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevelsem.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevelsem.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -46,8 +46,8 @@
 
 #define lll_sem_wait(sem) \
   ({ int result, ignore1, ignore2;					      \
-     __asm __volatile ("1:\tincl 8(%4)\n\t"				      \
-		       LOCK "incl (%4)\n\t"				      \
+     __asm __volatile ("1:\taddl $1,8(%4)\n\t"				      \
+		       LOCK "addl $1,(%4)\n\t"				      \
 		       "jng 2f\n"					      \
 		       ".subsection 1\n"				      \
 		       "2:\tmovl %4, %%eax\n\t"				      \
@@ -70,7 +70,7 @@
 		       "call __lll_lock_wait\n\t"			      \
 		       "jmp 5f\n\t"					      \
 		       ".previous\n"					      \
-		       "5:\tdecl 8(%4)\n\t"				      \
+		       "5:\tsubl $1,8(%4)\n\t"				      \
 		       "xorl %0, %0\n\t"				      \
 		       "cmpl $0, 4(%4)\n\t"				      \
 		       "jne,pt 6f\n\t"					      \
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S b/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S
index 9c4647c60b..abab62ff1e 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S
@@ -119,7 +119,7 @@ __pthread_once:
 
 	/* Sucessful run of the initializer.  Signal that we are done.  */
 	LOCK
-	incl	(%ebx)
+	addl	$1, (%ebx)
 
 	/* Wake up all other threads.  */
 	movl	$0x7fffffff, %edx
diff --git a/nptl/tst-kill6.c b/nptl/tst-kill6.c
index f929a302fc..9956dcb9b8 100644
--- a/nptl/tst-kill6.c
+++ b/nptl/tst-kill6.c
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <pthread.h>
 #include <semaphore.h>
 #include <signal.h>
@@ -112,7 +113,7 @@ do_test (void)
 	  exit (1);
 	}
 
-      if (sem_wait (&sem) != 0)
+      if (TEMP_FAILURE_RETRY (sem_wait (&sem)) != 0)
 	{
 	  puts ("sem_wait failed");
 	  exit (1);
diff --git a/nptl/tst-sem5.c b/nptl/tst-sem5.c
index d76c265bf8..cb85b8e769 100644
--- a/nptl/tst-sem5.c
+++ b/nptl/tst-sem5.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -38,7 +38,7 @@ do_test (void)
       return 1;
     }
 
-  if (sem_wait (&s) == -1)
+  if (TEMP_FAILURE_RETRY (sem_wait (&s)) == -1)
     {
       puts ("sem_wait failed");
       return 1;
diff --git a/nptl/tst-signal3.c b/nptl/tst-signal3.c
index 3de2887545..ef9ca9cc15 100644
--- a/nptl/tst-signal3.c
+++ b/nptl/tst-signal3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <pthread.h>
 #include <semaphore.h>
 #include <signal.h>
@@ -156,7 +157,7 @@ do_test (void)
 
   for (i = 0; i < ROUNDS; ++i)
     {
-      if (sem_wait (&sem) != 0)
+      if (TEMP_FAILURE_RETRY (sem_wait (&sem)) != 0)
 	{
 	  printf ("sem_wait round %d failed: %m\n", i);
 	  exit (1);
diff --git a/nptl/tst-tls2.c b/nptl/tst-tls2.c
index f188d68286..8b0692670e 100644
--- a/nptl/tst-tls2.c
+++ b/nptl/tst-tls2.c
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <pthread.h>
 #include <signal.h>
 #include <semaphore.h>
@@ -159,7 +160,7 @@ do_test (void)
 	  exit (1);
 	}
 
-      if (sem_wait (&s) != 0)
+      if (TEMP_FAILURE_RETRY (sem_wait (&s)) != 0)
 	{
 	  puts ("sem_wait failed");
 	  exit (1);
diff --git a/nptl/tst-tls3.c b/nptl/tst-tls3.c
index 0408a1a351..a34862e58c 100644
--- a/nptl/tst-tls3.c
+++ b/nptl/tst-tls3.c
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <dlfcn.h>
+#include <errno.h>
 #include <pthread.h>
 #include <signal.h>
 #include <semaphore.h>
@@ -145,7 +146,7 @@ do_test (void)
 	      exit (1);
 	    }
 
-	  if (sem_wait (&s) != 0)
+	  if (TEMP_FAILURE_RETRY (sem_wait (&s)) != 0)
 	    {
 	      puts ("sem_wait failed");
 	      exit (1);