Linux 2.6.28-rc5
[cris-mirror.git] / arch / sh / include / asm / timer.h
bloba7ca3a195bb589609e1d0eac2c4709f2251b46a4
1 #ifndef __ASM_SH_TIMER_H
2 #define __ASM_SH_TIMER_H
4 #include <linux/sysdev.h>
5 #include <linux/clocksource.h>
6 #include <cpu/timer.h>
8 struct sys_timer_ops {
9 int (*init)(void);
10 int (*start)(void);
11 int (*stop)(void);
12 cycle_t (*read)(void);
13 #ifndef CONFIG_GENERIC_TIME
14 unsigned long (*get_offset)(void);
15 #endif
18 struct sys_timer {
19 const char *name;
21 struct sys_device dev;
22 struct sys_timer_ops *ops;
25 #define TICK_SIZE (tick_nsec / 1000)
27 extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer;
28 extern struct sys_timer *sys_timer;
30 #ifndef CONFIG_GENERIC_TIME
31 static inline unsigned long get_timer_offset(void)
33 return sys_timer->ops->get_offset();
35 #endif
37 /* arch/sh/kernel/timers/timer.c */
38 struct sys_timer *get_sys_timer(void);
40 /* arch/sh/kernel/time.c */
41 void handle_timer_tick(void);
42 extern unsigned long sh_hpt_frequency;
44 #endif /* __ASM_SH_TIMER_H */