i386/pthread_cond_timedwait: always use clock_gettime
Commit Message
Since we require at least a 2.6.32 Linux kernel, the clock_gettime
syscall is always available. Remove the corresponding compatibility
code.
* sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
[!__NR_clock_gettime] (__pthread_cond_timedwait):
Remove compatibility code.
---
ChangeLog | 6 ++++++
sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S | 18 ------------------
2 files changed, 6 insertions(+), 18 deletions(-)
Comments
On 29 Dec 2015 23:31, Aurelien Jarno wrote:
> Since we require at least a 2.6.32 Linux kernel, the clock_gettime
> syscall is always available. Remove the corresponding compatibility
> code.
how about nptl/pthread_cond_timedwait.c ?
-mike
On 2015-12-29 17:40, Mike Frysinger wrote:
> On 29 Dec 2015 23:31, Aurelien Jarno wrote:
> > Since we require at least a 2.6.32 Linux kernel, the clock_gettime
> > syscall is always available. Remove the corresponding compatibility
> > code.
>
> how about nptl/pthread_cond_timedwait.c ?
Good point. I did look for old compat code in the sysdeps/ directory, I
should also have done that in nptl. This also looks a good candidate,
but I first need to check the clock_gettime is available in 2.6.32
kernels for all architectures. I'll look at that and send a patch if it
is the case.
@@ -1,5 +1,11 @@
2015-12-29 Aurelien Jarno <aurelien@aurel32.et>
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
+ [!__NR_clock_gettime] (__pthread_cond_timedwait): Remove
+ compatibility code.
+
+2015-12-29 Aurelien Jarno <aurelien@aurel32.et>
+
* sysdeps/unix/sysv/linux/dl-openat64.c [!__NR_openat] (openat64):
Remove compatibility code.
@@ -555,7 +555,6 @@ __pthread_cond_timedwait:
/* Get the current time. */
108: movl %ebx, %edx
-# ifdef __NR_clock_gettime
/* Get the clock number. */
movl cond_nwaiters(%ebx), %ebx
andl $((1 << nwaiters_shift) - 1), %ebx
@@ -571,23 +570,6 @@ __pthread_cond_timedwait:
movl 4(%ebp), %edx
subl 24(%esp), %ecx
subl 28(%esp), %edx
-# else
- /* Get the current time. */
- leal 24(%esp), %ebx
- xorl %ecx, %ecx
- movl $__NR_gettimeofday, %eax
- ENTER_KERNEL
- movl %edx, %ebx
-
- /* Compute relative timeout. */
- movl 28(%esp), %eax
- movl $1000, %edx
- mul %edx /* Milli seconds to nano seconds. */
- movl (%ebp), %ecx
- movl 4(%ebp), %edx
- subl 24(%esp), %ecx
- subl %eax, %edx
-# endif
jns 112f
addl $1000000000, %edx
subl $1, %ecx