init-first.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPARC VDSO initialization
  2. Copyright (C) 2018-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public License as
  6. published by the Free Software Foundation; either version 2.1 of the
  7. License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifdef SHARED
  16. # include <dl-vdso.h>
  17. # include <libc-vdso.h>
  18. long int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
  19. attribute_hidden;
  20. long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
  21. attribute_hidden;
  22. static inline void
  23. _libc_vdso_platform_setup (void)
  24. {
  25. PREPARE_VERSION_KNOWN (linux_version, LINUX_2_6);
  26. void *p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux_version);
  27. PTR_MANGLE (p);
  28. VDSO_SYMBOL (gettimeofday) = p;
  29. p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux_version);
  30. PTR_MANGLE (p);
  31. VDSO_SYMBOL (clock_gettime) = p;
  32. }
  33. # define VDSO_SETUP _libc_vdso_platform_setup
  34. #endif
  35. #include <csu/init-first.c>