Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / include / asm-sh / timer.h
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);
9         int (*start)(void);
10         int (*stop)(void);
11 #ifndef CONFIG_GENERIC_TIME
12         unsigned long (*get_offset)(void);
13 #endif
14 };
15
16 struct sys_timer {
17         const char              *name;
18
19         struct sys_device       dev;
20         struct sys_timer_ops    *ops;
21 };
22
23 #define TICK_SIZE (tick_nsec / 1000)
24
25 extern struct sys_timer tmu_timer;
26 extern struct sys_timer *sys_timer;
27
28 #ifndef CONFIG_GENERIC_TIME
29 static inline unsigned long get_timer_offset(void)
30 {
31         return sys_timer->ops->get_offset();
32 }
33 #endif
34
35 /* arch/sh/kernel/timers/timer.c */
36 struct sys_timer *get_sys_timer(void);
37
38 /* arch/sh/kernel/time.c */
39 void handle_timer_tick(void);
40
41 #endif /* __ASM_SH_TIMER_H */