timer.h 764 B

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