riscv: Fix alignment-ignorant memcpy implementation
[glibc.git] / sysdeps / unix / sysv / linux / dl-vdso-setup.c
blob3a44944dbb56a55dd750d1fe197e9f8b1fb410a3
1 /* Data for vDSO support. Linux version.
2 Copyright (C) 2020-2024 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
7 License as published by the Free Software Foundation; either
8 version 2.1 of the 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 <https://www.gnu.org/licenses/>. */
19 /* This file is included in three different modes for both static (libc.a)
20 and shared (rtld) modes:
22 1. PROCINFO_DECL is defined, meaning we are only interested in
23 declarations. For static it requires use the extern keyword along with
24 the attribute_relro while for shared it will be embedded in the
25 rtld_global_ro.
27 2. PROCINFO_DECL and SHARED are not defined. Nothing to do, the default
28 zero initializion is suffice.
30 3. PROCINFO_DECL is not defined while SHARED is. Similar to 2., the zero
31 initialization of rtld_global_ro is suffice. */
33 #ifndef PROCINFO_CLASS
34 # define PROCINFO_CLASS
35 #endif
37 #ifndef SHARED
38 # define RELRO attribute_relro
39 #else
40 # define RELRO
41 #endif
43 #if defined PROCINFO_DECL || !defined SHARED
44 # ifdef HAVE_CLOCK_GETTIME_VSYSCALL
45 PROCINFO_CLASS int (*_dl_vdso_clock_gettime) (clockid_t,
46 struct timespec *) RELRO;
47 #endif
48 # ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
49 PROCINFO_CLASS int (*_dl_vdso_clock_gettime64) (clockid_t,
50 struct __timespec64 *) RELRO;
51 #endif
52 # ifdef HAVE_GETTIMEOFDAY_VSYSCALL
53 PROCINFO_CLASS int (*_dl_vdso_gettimeofday) (struct timeval *, void *) RELRO;
54 #endif
55 # ifdef HAVE_TIME_VSYSCALL
56 PROCINFO_CLASS time_t (*_dl_vdso_time) (time_t *) RELRO;
57 # endif
58 # ifdef HAVE_GETCPU_VSYSCALL
59 PROCINFO_CLASS int (*_dl_vdso_getcpu) (unsigned *, unsigned *, void *) RELRO;
60 # endif
61 # ifdef HAVE_CLOCK_GETRES_VSYSCALL
62 PROCINFO_CLASS int (*_dl_vdso_clock_getres) (clockid_t,
63 struct timespec *) RELRO;
64 # endif
65 # ifdef HAVE_CLOCK_GETRES64_VSYSCALL
66 PROCINFO_CLASS int (*_dl_vdso_clock_getres_time64) (clockid_t,
67 struct __timespec64 *) RELRO;
68 # endif
70 /* PowerPC specific ones. */
71 # ifdef HAVE_GET_TBFREQ
72 PROCINFO_CLASS uint64_t (*_dl_vdso_get_tbfreq)(void) RELRO;
73 # endif
75 /* RISC-V specific ones. */
76 # ifdef HAVE_RISCV_HWPROBE
77 PROCINFO_CLASS int (*_dl_vdso_riscv_hwprobe)(void *,
78 size_t,
79 size_t,
80 unsigned long *,
81 unsigned int) RELRO;
82 # endif
84 #endif
86 #undef RELRO
87 #undef PROCINFO_DECL
88 #undef PROCINFO_CLASS