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