diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2014-06-27 14:00:18 -0700 |
---|---|---|
committer | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2015-01-12 16:03:58 -0200 |
commit | ca677d3c3cd0eba7d1f03092517aea553a0e8569 (patch) | |
tree | a5a899aa528f57614bc472895e47bb2088f97bae /sysdeps/unix/sysv/linux/x86_64/gettimeofday.c | |
parent | 49a9f6ab6407fa38cd74db471678fced967c975e (diff) | |
download | glibc-ca677d3c3cd0eba7d1f03092517aea553a0e8569.tar glibc-ca677d3c3cd0eba7d1f03092517aea553a0e8569.tar.gz glibc-ca677d3c3cd0eba7d1f03092517aea553a0e8569.tar.bz2 glibc-ca677d3c3cd0eba7d1f03092517aea553a0e8569.zip |
Add x86 32 bit vDSO time function support
Linux 3.15 adds support for clock_gettime, gettimeofday, and time vDSO
(commit id 37c975545ec63320789962bf307f000f08fabd48). This patch adds
GLIBC supports to use such symbol when they are avaiable.
Along with x86 vDSO support, this patch cleanup x86_64 code by moving
all common code to x86 common folder. Only init-first.c is different
between implementations.
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86_64/gettimeofday.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/gettimeofday.c | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c index 866d9c1d5f..daa14defb0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c @@ -18,42 +18,9 @@ #include <sys/time.h> #ifdef SHARED - -# include <dl-vdso.h> - +/* If the vDSO is not available we fall back on the old vsyscall. */ # define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul - -void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday"); - -void * -gettimeofday_ifunc (void) -{ - PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); - - /* If the vDSO is not available we fall back on the old vsyscall. */ - return (_dl_vdso_vsym ("__vdso_gettimeofday", &linux26) - ?: (void *) VSYSCALL_ADDR_vgettimeofday); -} -asm (".type __gettimeofday, %gnu_indirect_function"); - -/* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't - let us do it in C because it doesn't know we're defining __gettimeofday - here in this file. */ -asm (".globl __GI___gettimeofday\n" - "__GI___gettimeofday = __gettimeofday"); - -#else - -# include <sysdep.h> -# include <errno.h> - -int -__gettimeofday (struct timeval *tv, struct timezone *tz) -{ - return INLINE_SYSCALL (gettimeofday, 2, tv, tz); -} -libc_hidden_def (__gettimeofday) - +# define GETTIMEOFAY_FALLBACK (void*)VSYSCALL_ADDR_vgettimeofday #endif -weak_alias (__gettimeofday, gettimeofday) -libc_hidden_weak (gettimeofday) + +#include <sysdeps/unix/sysv/linux/x86/gettimeofday.c> |