]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 19 Mar 2003 19:15:36 +0000 (19:15 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 19 Mar 2003 19:15:36 +0000 (19:15 +0000)
2003-03-19  Ulrich Drepper  <drepper@redhat.com>

* sysdeps/pthread/Makefile: Fix cut&paste error.

linuxthreads/ChangeLog
linuxthreads/sysdeps/pthread/Makefile
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S

index ecd57bf81cd64b7b3c81577fb54bc83ade5f31a5..3376c13d5d5861f911d88c513213ac3ff6d3a952 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-19  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/pthread/Makefile: Fix cut&paste error.
+
 2003-03-18  Roland McGrath  <roland@redhat.com>
 
        * Versions (libpthread: GLIBC_2.2): Remove
index 6b92fbf47f0ed4d9f7831969f49be184f6e56eab..e9d57d58e4be975777ac2689375bed99f958b8fd 100644 (file)
@@ -9,5 +9,5 @@ endif
 endif
 
 ifeq ($(subdir),posix)
-CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../nptl/Banner)\""
+CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../linuxthreads/Banner)\""
 endif
index a517311a0e75f0917864aece970933770caa6d8f..0ff78787a6ce538706d6031e12d3a2a575561c0b 100644 (file)
@@ -1,5 +1,8 @@
 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
 
+       * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
+       support for clock selection.
+
        * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
        signalling waiters.
 
index 97a642e65eaf0109347639260c2e815d7709279d..7a75e0d7d26d08a03eab314369235e4564b32b64 100644 (file)
@@ -120,6 +120,27 @@ __pthread_cond_timedwait:
        callq   __pthread_enable_asynccancel_2
 
        /* Get the current time.  */
+#ifdef __NR_clock_gettime
+       /* Get the clock number.  Note that the field in the condvar
+          structure stores the number minus 1.  */
+       movq    8(%rsp), %rdi
+       movl    cond_clock(%rdi), %edi
+       /* Only clocks 0 and 1 are allowed.  Both are handled in the
+          kernel.  */
+       leaq    24(%rsp), %rsi
+       movq    $__NR_clock_gettime, %rax
+       syscall
+# ifndef __ASSUME_POSIX_TIMERS
+       cmpq    $-ENOSYS, %rax
+       je      19f
+# endif
+
+       /* Compute relative timeout.  */
+       movq    (%r13), %rcx
+       movq    8(%r13), %rdx
+       subq    24(%rsp), %rcx
+       subq    32(%rsp), %rdx
+#else
        leaq    24(%rsp), %rdi
        xorq    %rsi, %rsi
        movq    $VSYSCALL_ADDR_vgettimeofday, %rax
@@ -133,17 +154,18 @@ __pthread_cond_timedwait:
        movq    8(%r13), %rdx
        subq    24(%rsp), %rcx
        subq    %rax, %rdx
+#endif
        jns     12f
        addq    $1000000000, %rdx
        decq    %rcx
 12:    testq   %rcx, %rcx
+       movq    8(%rsp), %rdi
        js      13f
 
        /* Store relative timeout.  */
-       movq    %rcx, 24(%rsp)
+21:    movq    %rcx, 24(%rsp)
        movq    %rdx, 32(%rsp)
 
-       movq    8(%rsp), %rdi
        leaq    24(%rsp), %r10
        xorq    %rsi, %rsi      /* movq $FUTEX_WAIT, %rsi */
        movq    %r12, %rdx
@@ -265,6 +287,30 @@ __pthread_cond_timedwait:
 
 17:    movq    (%rsp), %rax
        jmp     18b
+
+#if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
+       /* clock_gettime not available.  */
+19:    leaq    24(%rsp), %rdi
+       xorq    %rsi, %rsi
+       movq    $VSYSCALL_ADDR_vgettimeofday, %rax
+       callq   *%rax
+
+       /* Compute relative timeout.  */
+       movq    32(%rsp), %rax
+       movq    $1000, %rdx
+       mul     %rdx            /* Milli seconds to nano seconds.  */
+       movq    (%r13), %rcx
+       movq    8(%r13), %rdx
+       subq    24(%rsp), %rcx
+       subq    %rax, %rdx
+       jns     20f
+       addq    $1000000000, %rdx
+       decq    %rcx
+20:    testq   %rcx, %rcx
+       movq    8(%rsp), %rdi
+       js      13b
+       jmp     21b
+#endif
        .size   __pthread_cond_timedwait, .-__pthread_cond_timedwait
 versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait,
                  GLIBC_2_3_2)