timekeeping32.h 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _LINUX_TIMEKEEPING32_H
  2. #define _LINUX_TIMEKEEPING32_H
  3. /*
  4. * These interfaces are all based on the old timespec type
  5. * and should get replaced with the timespec64 based versions
  6. * over time so we can remove the file here.
  7. */
  8. static inline unsigned long get_seconds(void)
  9. {
  10. return ktime_get_real_seconds();
  11. }
  12. static inline void getnstimeofday(struct timespec *ts)
  13. {
  14. struct timespec64 ts64;
  15. ktime_get_real_ts64(&ts64);
  16. *ts = timespec64_to_timespec(ts64);
  17. }
  18. static inline void ktime_get_ts(struct timespec *ts)
  19. {
  20. struct timespec64 ts64;
  21. ktime_get_ts64(&ts64);
  22. *ts = timespec64_to_timespec(ts64);
  23. }
  24. static inline void getrawmonotonic(struct timespec *ts)
  25. {
  26. struct timespec64 ts64;
  27. ktime_get_raw_ts64(&ts64);
  28. *ts = timespec64_to_timespec(ts64);
  29. }
  30. static inline void getboottime(struct timespec *ts)
  31. {
  32. struct timespec64 ts64;
  33. getboottime64(&ts64);
  34. *ts = timespec64_to_timespec(ts64);
  35. }
  36. #endif