diff options
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/x86_64/init-first.c')
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/x86_64/init-first.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c index ead7dbcc3..e676f623e 100644 --- a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c +++ b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 Free Software Foundation, Inc. +/* Copyright (C) 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,6 +26,10 @@ long int (*__vdso_clock_gettime) (clockid_t, struct timespec *) __attribute__ ((nocommon)); strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden) +long int (*__vdso_getcpu) (unsigned *, unsigned *, void *); + +long int (*__vdso_time) (time_t *) attribute_hidden; + static inline void _libc_vdso_platform_setup (void) @@ -43,6 +47,22 @@ _libc_vdso_platform_setup (void) p = _dl_vdso_vsym ("clock_gettime", &linux26); PTR_MANGLE (p); __GI___vdso_clock_gettime = p; + + p = _dl_vdso_vsym ("getcpu", &linux26); + /* If the vDSO is not available we fall back on the old vsyscall. */ +#define VSYSCALL_ADDR_vgetcpu 0xffffffffff600800 + if (p == NULL) + p = (void *) VSYSCALL_ADDR_vgetcpu; + PTR_MANGLE (p); + __vdso_getcpu = p; + + p = _dl_vdso_vsym ("time", &linux26); + /* If the vDSO is not available we fall back on the old vsyscall. */ +#define VSYSCALL_ADDR_vtime 0xffffffffff600400 + if (p == NULL) + p = (void *) VSYSCALL_ADDR_vtime; + PTR_MANGLE (p); + __vdso_time = p; } # define VDSO_SETUP _libc_vdso_platform_setup |