Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 1 | #ifndef __ASM_SH_TIMER_H |
| 2 | #define __ASM_SH_TIMER_H |
| 3 | |
| 4 | #include <linux/sysdev.h> |
| 5 | #include <asm/cpu/timer.h> |
| 6 | |
| 7 | struct sys_timer_ops { |
| 8 | int (*init)(void); |
Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame^] | 9 | int (*start)(void); |
| 10 | int (*stop)(void); |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 11 | unsigned long (*get_offset)(void); |
| 12 | unsigned long (*get_frequency)(void); |
| 13 | }; |
| 14 | |
| 15 | struct sys_timer { |
| 16 | const char *name; |
| 17 | |
| 18 | struct sys_device dev; |
| 19 | struct sys_timer_ops *ops; |
| 20 | }; |
| 21 | |
| 22 | #define TICK_SIZE (tick_nsec / 1000) |
| 23 | |
| 24 | extern struct sys_timer tmu_timer; |
| 25 | extern struct sys_timer *sys_timer; |
| 26 | |
| 27 | static inline unsigned long get_timer_offset(void) |
| 28 | { |
| 29 | return sys_timer->ops->get_offset(); |
| 30 | } |
| 31 | |
| 32 | static inline unsigned long get_timer_frequency(void) |
| 33 | { |
| 34 | return sys_timer->ops->get_frequency(); |
| 35 | } |
| 36 | |
| 37 | /* arch/sh/kernel/timers/timer.c */ |
| 38 | struct sys_timer *get_sys_timer(void); |
| 39 | |
| 40 | /* arch/sh/kernel/time.c */ |
| 41 | void handle_timer_tick(struct pt_regs *); |
| 42 | |
| 43 | #endif /* __ASM_SH_TIMER_H */ |
| 44 | |