1 /* vDSO internal symbols. Linux generic version.
2 Copyright (C) 2019-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
20 #include <libc-vdso.h>
22 /* vDSO symbol used on clock_gettime implementation. */
23 #ifdef HAVE_CLOCK_GETTIME_VSYSCALL
24 int (*VDSO_SYMBOL(clock_gettime
)) (clockid_t
, struct timespec
*)
27 /* vDSO symbol used on clock_gettime64 implementation. */
28 #ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
29 int (*VDSO_SYMBOL(clock_gettime64
)) (clockid_t
, struct __timespec64
*)
32 /* vDSO symbol used on clock_getres implementation. */
33 #ifdef HAVE_CLOCK_GETRES_VSYSCALL
34 int (*VDSO_SYMBOL(clock_getres
)) (clockid_t
, struct timespec
*)
37 /* vDSO symbol used on gettimeofday implementation. */
38 #ifdef HAVE_GETTIMEOFDAY_VSYSCALL
39 int (*VDSO_SYMBOL (gettimeofday
)) (struct timeval
*, void *)
42 /* vDSO symbol used on GNU extension getcpu implementation. */
43 #ifdef HAVE_GETCPU_VSYSCALL
44 long int (*VDSO_SYMBOL(getcpu
)) (unsigned *, unsigned *, void *)
47 /* vDSO symbol used on time implementation. */
48 #ifdef HAVE_TIME_VSYSCALL
49 time_t (*VDSO_SYMBOL(time
)) (time_t *) attribute_hidden
;
53 __libc_vdso_platform_setup (void)
55 #ifdef HAVE_CLOCK_GETTIME_VSYSCALL
56 VDSO_SYMBOL(clock_gettime
)
57 = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME_VSYSCALL
);
60 #ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
61 VDSO_SYMBOL(clock_gettime64
)
62 = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME64_VSYSCALL
);
65 #ifdef HAVE_CLOCK_GETRES_VSYSCALL
66 VDSO_SYMBOL(clock_getres
)
67 = get_vdso_mangle_symbol (HAVE_CLOCK_GETRES_VSYSCALL
);
70 #ifdef HAVE_GETTIMEOFDAY_VSYSCALL
71 VDSO_SYMBOL(gettimeofday
)
72 = get_vdso_mangle_symbol (HAVE_GETTIMEOFDAY_VSYSCALL
);
75 #ifdef HAVE_GETCPU_VSYSCALL
76 VDSO_SYMBOL(getcpu
) = get_vdso_mangle_symbol (HAVE_GETCPU_VSYSCALL
);
79 #ifdef HAVE_TIME_VSYSCALL
80 VDSO_SYMBOL(time
) = get_vdso_mangle_symbol (HAVE_TIME_VSYSCALL
);
83 #ifdef VDSO_SETUP_ARCH
88 #define VDSO_SETUP __libc_vdso_platform_setup
90 #include <csu/init-first.c>