time.c 730 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/delay.h>
  3. #include <linux/ktime.h>
  4. #include <linux/timekeeping.h>
  5. __rust_helper void rust_helper_fsleep(unsigned long usecs)
  6. {
  7. fsleep(usecs);
  8. }
  9. __rust_helper ktime_t rust_helper_ktime_get_real(void)
  10. {
  11. return ktime_get_real();
  12. }
  13. __rust_helper ktime_t rust_helper_ktime_get_boottime(void)
  14. {
  15. return ktime_get_boottime();
  16. }
  17. __rust_helper ktime_t rust_helper_ktime_get_clocktai(void)
  18. {
  19. return ktime_get_clocktai();
  20. }
  21. __rust_helper s64 rust_helper_ktime_to_us(const ktime_t kt)
  22. {
  23. return ktime_to_us(kt);
  24. }
  25. __rust_helper s64 rust_helper_ktime_to_ms(const ktime_t kt)
  26. {
  27. return ktime_to_ms(kt);
  28. }
  29. __rust_helper void rust_helper_udelay(unsigned long usec)
  30. {
  31. udelay(usec);
  32. }