aboutsummaryrefslogtreecommitdiff
path: root/nptl
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
parent3d2dd6ca71fa9933e3413625d606f4b486661409 (diff)
downloadglibc-42e6c66593eb7a07afd58e70bef9aeed9f910548.zip
glibc-42e6c66593eb7a07afd58e70bef9aeed9f910548.tar.gz
glibc-42e6c66593eb7a07afd58e70bef9aeed9f910548.tar.bz2
* 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')
-rw-r--r--nptl/ChangeLog8
-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
7 files changed, 37 insertions, 7 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 4778511..08626b4 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,13 @@
2007-05-25 Ulrich Drepper <drepper@redhat.com>
+ * 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.
+
* semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
* sem_init.c (__new_sem_init): Rewrite to initialize all three
fields in the structure.
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 e66db14..280dc2f 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 3677ab3..57b5b58 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 bb4d644..d0eef75 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 1f5d0bb..4919c11 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 1bb74c0..4068a1b 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 e958d63..e099ede 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