about summary refs log tree commit diff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-26 04:49:06 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-26 04:49:06 +0000
commit42e6c66593eb7a07afd58e70bef9aeed9f910548 (patch)
tree917aa294557cf8439bdccc82c1e45a34edea2584 /nptl/sysdeps
parent3d2dd6ca71fa9933e3413625d606f4b486661409 (diff)
downloadglibc-42e6c66593eb7a07afd58e70bef9aeed9f910548.tar.gz
glibc-42e6c66593eb7a07afd58e70bef9aeed9f910548.tar.xz
glibc-42e6c66593eb7a07afd58e70bef9aeed9f910548.zip
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
	support.
	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
Diffstat (limited to 'nptl/sysdeps')
-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
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S1
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S5
6 files changed, 29 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
 
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
index 1f5d0bba34..4919c11fd2 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
@@ -50,6 +50,7 @@ sem_post:
 
 	movl	$SYS_futex, %eax
 	movl	$FUTEX_WAKE, %esi
+	orl	PRIVATE(%rdi), %esi
 	movl	$1, %edx
 	syscall
 
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index 1bb74c0368..4068a1b6b8 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -116,7 +116,12 @@ sem_timedwait:
 #else
 	leaq	VALUE(%r12), %rdi
 #endif
+#if FUTEX_WAIT == 0
+	movl	PRIVATE(%rdi), %esi
+#else
 	movl	$FUTEX_WAIT, %esi
+	orl	PRIVATE(%rdi), %esi
+#endif
 	movl	$SYS_futex, %eax
 	xorl	%edx, %edx
 	syscall
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
index e958d63f55..e099ede029 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
@@ -82,7 +82,12 @@ sem_wait:
 	xorq	%r10, %r10
 	movl	$SYS_futex, %eax
 	movq	%r13, %rdi
+#if FUTEX_WAIT == 0
+	movl	PRIVATE(%rdi), %esi
+#else
 	movl	$FUTEX_WAIT, %esi
+	orl	PRIVATE(%rdi), %esi
+#endif
 	xorl	%edx, %edx
 	syscall
 	movq	%rax, %r12