]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/powerpc/init-first.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / powerpc / init-first.c
CommitLineData
93c65d43 1/* Initialization code run first thing by the ELF startup code. Linux/PowerPC.
04277e02 2 Copyright (C) 2007-2019 Free Software Foundation, Inc.
8c2e201b
UD
3 This file is part of the GNU C Library.
4
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.
9
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.
14
15 You should have received a copy of the GNU Lesser General Public
59ba27a6 16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
8c2e201b 18
8ae74ead
RÁE
19#include <dl-vdso.h>
20#include <libc-vdso.h>
8c2e201b 21
f534255e
AZ
22int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
23 attribute_hidden;
24int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
25int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
26unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void);
27int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *);
28time_t (*VDSO_SYMBOL(time)) (time_t *);
29
d400dcac 30#if defined(__PPC64__) || defined(__powerpc64__)
f534255e 31void *VDSO_SYMBOL(sigtramp_rt64);
d400dcac 32#else
f534255e
AZ
33void *VDSO_SYMBOL(sigtramp32);
34void *VDSO_SYMBOL(sigtramp_rt32);
d400dcac 35#endif
75fb247e
UD
36
37static inline void
38_libc_vdso_platform_setup (void)
39{
85c748f9 40 PREPARE_VERSION_KNOWN (linux2615, LINUX_2_6_15);
fb84593c 41
f534255e
AZ
42 void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615);
43 PTR_MANGLE (p);
44 VDSO_SYMBOL (gettimeofday) = p;
fb84593c 45
f534255e
AZ
46 p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615);
47 PTR_MANGLE (p);
48 VDSO_SYMBOL (clock_gettime) = p;
fb84593c 49
f534255e
AZ
50 p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615);
51 PTR_MANGLE (p);
52 VDSO_SYMBOL (clock_getres) = p;
fb84593c 53
f534255e
AZ
54 p = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615);
55 PTR_MANGLE (p);
56 VDSO_SYMBOL (get_tbfreq) = p;
d5e0b9bd 57
f534255e
AZ
58 p = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
59 PTR_MANGLE (p);
60 VDSO_SYMBOL (getcpu) = p;
83e7640f 61
f534255e
AZ
62 p = _dl_vdso_vsym ("__kernel_time", &linux2615);
63 PTR_MANGLE (p);
64 VDSO_SYMBOL (time) = p;
d400dcac
AZ
65
66 /* PPC64 uses only one signal trampoline symbol, while PPC32 will use
67 two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not
f534255e
AZ
68 (__kernel_sigtramp32).
69 There is no need to pointer mangle these symbol because they will
70 used only for pointer comparison. */
d400dcac 71#if defined(__PPC64__) || defined(__powerpc64__)
f534255e
AZ
72 VDSO_SYMBOL(sigtramp_rt64) = _dl_vdso_vsym ("__kernel_sigtramp_rt64",
73 &linux2615);
d400dcac 74#else
f534255e
AZ
75 VDSO_SYMBOL(sigtramp32) = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615);
76 VDSO_SYMBOL(sigtramp_rt32) = _dl_vdso_vsym ("__kernel_sigtramp_rt32",
77 &linux2615);
d400dcac 78#endif
75fb247e
UD
79}
80
8ae74ead 81#define VDSO_SETUP _libc_vdso_platform_setup
75fb247e 82
93c65d43 83#include <csu/init-first.c>