timer.h 857 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __ASM_SH_TIMER_H
  2. #define __ASM_SH_TIMER_H
  3. #include <linux/sysdev.h>
  4. #include <linux/clocksource.h>
  5. #include <cpu/timer.h>
  6. struct sys_timer_ops {
  7. int (*init)(void);
  8. int (*start)(void);
  9. int (*stop)(void);
  10. #ifndef CONFIG_GENERIC_TIME
  11. unsigned long (*get_offset)(void);
  12. #endif
  13. };
  14. struct sys_timer {
  15. const char *name;
  16. struct sys_device dev;
  17. struct sys_timer_ops *ops;
  18. };
  19. #define TICK_SIZE (tick_nsec / 1000)
  20. extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer;
  21. extern struct sys_timer *sys_timer;
  22. #ifndef CONFIG_GENERIC_TIME
  23. static inline unsigned long get_timer_offset(void)
  24. {
  25. return sys_timer->ops->get_offset();
  26. }
  27. #endif
  28. /* arch/sh/kernel/timers/timer.c */
  29. struct sys_timer *get_sys_timer(void);
  30. /* arch/sh/kernel/time.c */
  31. void handle_timer_tick(void);
  32. extern struct clocksource clocksource_sh;
  33. #endif /* __ASM_SH_TIMER_H */