timer.h 877 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. cycle_t (*read)(void);
  11. #ifndef CONFIG_GENERIC_TIME
  12. unsigned long (*get_offset)(void);
  13. #endif
  14. };
  15. struct sys_timer {
  16. const char *name;
  17. struct sys_device dev;
  18. struct sys_timer_ops *ops;
  19. };
  20. #define TICK_SIZE (tick_nsec / 1000)
  21. extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer;
  22. extern struct sys_timer *sys_timer;
  23. #ifndef CONFIG_GENERIC_TIME
  24. static inline unsigned long get_timer_offset(void)
  25. {
  26. return sys_timer->ops->get_offset();
  27. }
  28. #endif
  29. /* arch/sh/kernel/timers/timer.c */
  30. struct sys_timer *get_sys_timer(void);
  31. /* arch/sh/kernel/time.c */
  32. void handle_timer_tick(void);
  33. extern unsigned long sh_hpt_frequency;
  34. #endif /* __ASM_SH_TIMER_H */