aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-10-25 19:07:36 +0000
committerUlrich Drepper <drepper@redhat.com>2004-10-25 19:07:36 +0000
commitc2a4357a4582255e0d69ff5e641cb77e3fcee6fe (patch)
tree08d6258ea6acc7c949659d21a4b6935650128b09 /nptl/sysdeps
parentcd40e3a7cb46f51d5e853c4521e887596af5fabf (diff)
downloadglibc-c2a4357a4582255e0d69ff5e641cb77e3fcee6fe.zip
glibc-c2a4357a4582255e0d69ff5e641cb77e3fcee6fe.tar.gz
glibc-c2a4357a4582255e0d69ff5e641cb77e3fcee6fe.tar.bz2
Update.
2004-10-25 Kaz Kojima <kkojima@rr.iij4u.or.jp> * sysdeps/sh/dl-machine.h: Include sysdep.h. (ELF_MACHINE_RUNTIME_TRAMPOLINE): Add CFI directives. (elf_machine_runtime_setup): Add always_inline attribute. (_dl_start_user): Pass the correct environ. (elf_machine_rela): Replace static inline by auto inline, add always_inline attribute. (elf_machine_rela_relative): Likewise. (elf_machine_lazy_rel): Likewise.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S1
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S49
2 files changed, 49 insertions, 1 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
index d87f089..bcb1561 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
@@ -117,6 +117,7 @@ __lll_mutex_timedlock_wait:
mov #1, r3
mov #2, r4
CMPXCHG (r3, @r8, r4, r2)
+ tst r2, r2
bt 8f
mov r8, r4
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
index d0c55ec..74206a7 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
@@ -133,6 +133,34 @@ __pthread_cond_timedwait:
8:
/* Get current time. */
+#ifdef __NR_clock_gettime
+ /* Get the clock number. */
+ mov.l @(cond_nwaiters,r8), r4
+ mov #((1 << clock_bits) - 1), r0
+ and r0, r4
+ /* Only clocks 0 and 1 are allowed. Both are handled in the
+ kernel. */
+ mov r15, r5
+ add #16, r5
+ mov.w .L__NR_clock_gettime, r3
+ trapa #0x12
+ SYSCALL_INST_PAD
+# ifndef __ASSUME_POSIX_TIMERS
+ cmp/eq #-ENOSYS, r0
+ bt 19f
+# endif
+
+ /* Compute relative timeout. */
+ mov.l @r13, r2
+ mov.l @(4,r13), r3
+ mov.l @(16,r15), r0
+ bra 0f
+ mov.l @(20,r15), r1
+.L__NR_clock_gettime:
+ .word __NR_clock_gettime
+
+# ifndef __ASSUME_POSIX_TIMERS
+19:
mov r15, r4
add #16, r4
mov #0, r5
@@ -143,11 +171,30 @@ __pthread_cond_timedwait:
/* Compute relative timeout. */
mov.l @(20,r15), r0
mov.w .L1k, r1
- dmulu.l r0, r1 /* Milli seconds to nano seconds. */
+ dmulu.l r0, r1 /* Micro seconds to nano seconds. */
mov.l @r13, r2
mov.l @(4,r13), r3
mov.l @(16,r15), r0
sts macl, r1
+#endif
+0:
+#else
+ mov r15, r4
+ add #16, r4
+ mov #0, r5
+ mov #SYS_gettimeofday, r3
+ trapa #0x12
+ SYSCALL_INST_PAD
+
+ /* Compute relative timeout. */
+ mov.l @(20,r15), r0
+ mov.w .L1k, r1
+ dmulu.l r0, r1 /* Micro seconds to nano seconds. */
+ mov.l @r13, r2
+ mov.l @(4,r13), r3
+ mov.l @(16,r15), r0
+ sts macl, r1
+#endif
sub r0, r2
clrt
subc r1, r3