timer.h 805 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. unsigned long (*get_offset)(void);
  8. unsigned long (*get_frequency)(void);
  9. };
  10. struct sys_timer {
  11. const char *name;
  12. struct sys_device dev;
  13. struct sys_timer_ops *ops;
  14. };
  15. #define TICK_SIZE (tick_nsec / 1000)
  16. extern struct sys_timer tmu_timer;
  17. extern struct sys_timer *sys_timer;
  18. static inline unsigned long get_timer_offset(void)
  19. {
  20. return sys_timer->ops->get_offset();
  21. }
  22. static inline unsigned long get_timer_frequency(void)
  23. {
  24. return sys_timer->ops->get_frequency();
  25. }
  26. /* arch/sh/kernel/timers/timer.c */
  27. struct sys_timer *get_sys_timer(void);
  28. /* arch/sh/kernel/time.c */
  29. void handle_timer_tick(struct pt_regs *);
  30. #endif /* __ASM_SH_TIMER_H */