timer_none.c 654 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <linux/init.h>
  2. #include <asm/timer.h>
  3. static void mark_offset_none(void)
  4. {
  5. /* nothing needed */
  6. }
  7. static unsigned long get_offset_none(void)
  8. {
  9. return 0;
  10. }
  11. static unsigned long long monotonic_clock_none(void)
  12. {
  13. return 0;
  14. }
  15. static void delay_none(unsigned long loops)
  16. {
  17. int d0;
  18. __asm__ __volatile__(
  19. "\tjmp 1f\n"
  20. ".align 16\n"
  21. "1:\tjmp 2f\n"
  22. ".align 16\n"
  23. "2:\tdecl %0\n\tjns 2b"
  24. :"=&a" (d0)
  25. :"0" (loops));
  26. }
  27. /* none timer_opts struct */
  28. struct timer_opts timer_none = {
  29. .name = "none",
  30. .mark_offset = mark_offset_none,
  31. .get_offset = get_offset_none,
  32. .monotonic_clock = monotonic_clock_none,
  33. .delay = delay_none,
  34. };