about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/i386
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S11
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S11
3 files changed, 18 insertions, 7 deletions
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 e66db146ec..280dc2fe27 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
@@ -52,9 +52,10 @@ __new_sem_post:
 	cmpl	$0, NWAITERS(%ebx)
 	je	2f
 
-	movl	$SYS_futex, %eax
 	movl	$FUTEX_WAKE, %ecx
+	orl	PRIVATE(%ebx), %ecx
 	movl	$1, %edx
+	movl	$SYS_futex, %eax
 	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 3677ab3bf9..57b5b58186 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
@@ -30,7 +30,7 @@
 
 #define SYS_gettimeofday	__NR_gettimeofday
 #define SYS_futex		240
-#define FUTEX_WAKE		1
+#define FUTEX_WAIT		0
 
 
 #if VALUE != 0
@@ -108,10 +108,15 @@ sem_timedwait:
 	movl	%eax, 8(%esp)
 
 	movl	28(%esp), %ebx	/* Load semaphore address.  */
-	xorl	%ecx, %ecx
+#if FUTEX_WAIT == 0
+	movl	PRIVATE(%ebx), %ecx
+#else
+	movl	$FUTEX_WAIT, %ecx
+	orl	PRIVATE(%ebx), %ecx
+#endif
 	movl	%esp, %esi
-	movl	$SYS_futex, %eax
 	xorl	%edx, %edx
+	movl	$SYS_futex, %eax
 	ENTER_KERNEL
 	movl	%eax, %esi
 
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
index bb4d6443e9..d0eef75144 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
@@ -29,7 +29,7 @@
 #endif
 
 #define SYS_futex		240
-#define FUTEX_WAKE		1
+#define FUTEX_WAIT		0
 
 
 #if VALUE != 0
@@ -76,10 +76,15 @@ __new_sem_wait:
 6:	call	__pthread_enable_asynccancel
 	movl	%eax, (%esp)
 
+#if FUTEX_WAIT == 0
+	movl	PRIVATE(%ebx), %ecx
+#else
+	movl	$FUTEX_WAIT, %ecx
+	orl	PRIVATE(%ebx), %ecx
+#endif
 	xorl	%esi, %esi
+	xorl	%edx, %edx
 	movl	$SYS_futex, %eax
-	movl	%esi, %ecx
-	movl	%esi, %edx
 	ENTER_KERNEL
 	movl	%eax, %esi