]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/powerpc/init-first.c
1 /* Initialization code run first thing by the ELF startup code. Linux/PowerPC.
2 Copyright (C) 2007-2019 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/>. */
20 #include <libc-vdso.h>
22 int (*VDSO_SYMBOL(gettimeofday
)) (struct timeval
*, void *)
24 int (*VDSO_SYMBOL(clock_gettime
)) (clockid_t
, struct timespec
*);
25 int (*VDSO_SYMBOL(clock_getres
)) (clockid_t
, struct timespec
*);
26 unsigned long long (*VDSO_SYMBOL(get_tbfreq
)) (void);
27 int (*VDSO_SYMBOL(getcpu
)) (unsigned *, unsigned *);
28 time_t (*VDSO_SYMBOL(time
)) (time_t *);
30 #if defined(__PPC64__) || defined(__powerpc64__)
31 void *VDSO_SYMBOL(sigtramp_rt64
);
33 void *VDSO_SYMBOL(sigtramp32
);
34 void *VDSO_SYMBOL(sigtramp_rt32
);
38 _libc_vdso_platform_setup (void)
40 PREPARE_VERSION_KNOWN (linux2615
, LINUX_2_6_15
);
42 void *p
= _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615
);
44 VDSO_SYMBOL (gettimeofday
) = p
;
46 p
= _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615
);
48 VDSO_SYMBOL (clock_gettime
) = p
;
50 p
= _dl_vdso_vsym ("__kernel_clock_getres", &linux2615
);
52 VDSO_SYMBOL (clock_getres
) = p
;
54 p
= _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615
);
56 VDSO_SYMBOL (get_tbfreq
) = p
;
58 p
= _dl_vdso_vsym ("__kernel_getcpu", &linux2615
);
60 VDSO_SYMBOL (getcpu
) = p
;
62 p
= _dl_vdso_vsym ("__kernel_time", &linux2615
);
64 VDSO_SYMBOL (time
) = p
;
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
68 (__kernel_sigtramp32).
69 There is no need to pointer mangle these symbol because they will
70 used only for pointer comparison. */
71 #if defined(__PPC64__) || defined(__powerpc64__)
72 VDSO_SYMBOL(sigtramp_rt64
) = _dl_vdso_vsym ("__kernel_sigtramp_rt64",
75 VDSO_SYMBOL(sigtramp32
) = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615
);
76 VDSO_SYMBOL(sigtramp_rt32
) = _dl_vdso_vsym ("__kernel_sigtramp_rt32",
81 #define VDSO_SETUP _libc_vdso_platform_setup
83 #include <csu/init-first.c>