vgettimeofday.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Powerpc userspace implementations of gettimeofday() and similar.
  4. */
  5. #include <linux/time.h>
  6. #include <linux/types.h>
  7. #ifdef __powerpc64__
  8. int __c_kernel_clock_gettime(clockid_t clock, struct __kernel_timespec *ts,
  9. const struct vdso_data *vd)
  10. {
  11. return __cvdso_clock_gettime_data(vd, clock, ts);
  12. }
  13. int __c_kernel_clock_getres(clockid_t clock_id, struct __kernel_timespec *res,
  14. const struct vdso_data *vd)
  15. {
  16. return __cvdso_clock_getres_data(vd, clock_id, res);
  17. }
  18. #else
  19. int __c_kernel_clock_gettime(clockid_t clock, struct old_timespec32 *ts,
  20. const struct vdso_data *vd)
  21. {
  22. return __cvdso_clock_gettime32_data(vd, clock, ts);
  23. }
  24. int __c_kernel_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts,
  25. const struct vdso_data *vd)
  26. {
  27. return __cvdso_clock_gettime_data(vd, clock, ts);
  28. }
  29. int __c_kernel_clock_getres(clockid_t clock_id, struct old_timespec32 *res,
  30. const struct vdso_data *vd)
  31. {
  32. return __cvdso_clock_getres_time32_data(vd, clock_id, res);
  33. }
  34. #endif
  35. int __c_kernel_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz,
  36. const struct vdso_data *vd)
  37. {
  38. return __cvdso_gettimeofday_data(vd, tv, tz);
  39. }
  40. __kernel_old_time_t __c_kernel_time(__kernel_old_time_t *time, const struct vdso_data *vd)
  41. {
  42. return __cvdso_time_data(vd, time);
  43. }