blob: 5df842bcf7b63d554ef6486b11e07a663514c373 [file] [log] [blame]
Paul Mundtaa016662006-01-16 22:14:18 -08001#ifndef __ASM_SH_TIMER_H
2#define __ASM_SH_TIMER_H
3
4#include <linux/sysdev.h>
5#include <asm/cpu/timer.h>
6
7struct sys_timer_ops {
8 int (*init)(void);
Andriy Skulysh3aa770e2006-09-27 16:20:22 +09009 int (*start)(void);
10 int (*stop)(void);
Paul Mundt45882142006-10-04 13:21:45 +090011#ifndef CONFIG_GENERIC_TIME
Paul Mundtaa016662006-01-16 22:14:18 -080012 unsigned long (*get_offset)(void);
Paul Mundt45882142006-10-04 13:21:45 +090013#endif
Paul Mundtaa016662006-01-16 22:14:18 -080014};
15
16struct 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
25extern struct sys_timer tmu_timer;
26extern struct sys_timer *sys_timer;
27
Paul Mundt45882142006-10-04 13:21:45 +090028#ifndef CONFIG_GENERIC_TIME
Paul Mundtaa016662006-01-16 22:14:18 -080029static inline unsigned long get_timer_offset(void)
30{
31 return sys_timer->ops->get_offset();
32}
Paul Mundt45882142006-10-04 13:21:45 +090033#endif
Paul Mundtaa016662006-01-16 22:14:18 -080034
Paul Mundtaa016662006-01-16 22:14:18 -080035/* arch/sh/kernel/timers/timer.c */
36struct sys_timer *get_sys_timer(void);
37
38/* arch/sh/kernel/time.c */
Paul Mundt35f3c512006-10-06 15:31:16 +090039void handle_timer_tick(void);
Paul Mundtaa016662006-01-16 22:14:18 -080040
41#endif /* __ASM_SH_TIMER_H */