From c2a4357a4582255e0d69ff5e641cb77e3fcee6fe Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 25 Oct 2004 19:07:36 +0000 Subject: Update. 2004-10-25 Kaz Kojima * 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. --- nptl/ChangeLog | 8 ++++ nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S | 1 + .../unix/sysv/linux/sh/pthread_cond_timedwait.S | 49 +++++++++++++++++++++- 3 files changed, 57 insertions(+), 1 deletion(-) (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 3d6bd03..be5893d 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,11 @@ +2004-10-25 Kaz Kojima + + * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S + (__pthread_cond_timedwait): Use clock_gettime syscall if exists. + + * sysdeps/unix/sysv/linux/sh/lowlevellock.S + (__lll_mutex_timedlock_wait): Fix a bad branch condition. + 2004-10-24 Ulrich Drepper * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use 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 -- cgit v1.1