Commit | Line | Data |
---|---|---|
aa01666d PM |
1 | #ifndef __ASM_SH_TIMER_H |
2 | #define __ASM_SH_TIMER_H | |
3 | ||
4 | #include <linux/sysdev.h> | |
57be2b48 | 5 | #include <linux/clocksource.h> |
f15cbe6f | 6 | #include <cpu/timer.h> |
aa01666d PM |
7 | |
8 | struct sys_timer_ops { | |
9 | int (*init)(void); | |
3aa770e7 AS |
10 | int (*start)(void); |
11 | int (*stop)(void); | |
45882145 | 12 | #ifndef CONFIG_GENERIC_TIME |
aa01666d | 13 | unsigned long (*get_offset)(void); |
45882145 | 14 | #endif |
aa01666d PM |
15 | }; |
16 | ||
17 | struct sys_timer { | |
18 | const char *name; | |
19 | ||
20 | struct sys_device dev; | |
21 | struct sys_timer_ops *ops; | |
22 | }; | |
23 | ||
24 | #define TICK_SIZE (tick_nsec / 1000) | |
25 | ||
710ee0cc | 26 | extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer; |
aa01666d PM |
27 | extern struct sys_timer *sys_timer; |
28 | ||
45882145 | 29 | #ifndef CONFIG_GENERIC_TIME |
aa01666d PM |
30 | static inline unsigned long get_timer_offset(void) |
31 | { | |
32 | return sys_timer->ops->get_offset(); | |
33 | } | |
45882145 | 34 | #endif |
aa01666d | 35 | |
aa01666d PM |
36 | /* arch/sh/kernel/timers/timer.c */ |
37 | struct sys_timer *get_sys_timer(void); | |
38 | ||
39 | /* arch/sh/kernel/time.c */ | |
35f3c518 | 40 | void handle_timer_tick(void); |
955c0778 MD |
41 | |
42 | extern struct clocksource clocksource_sh; | |
aa01666d PM |
43 | |
44 | #endif /* __ASM_SH_TIMER_H */ |