diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-01-17 01:14:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-17 02:15:28 -0500 |
commit | aa01666df35cd769c0957d4b3ae6ee99d680ab88 (patch) | |
tree | 7dd68a8522cc6f9e8eb49fb9af630fca8b3e464d /include/asm-sh | |
parent | 36ddf31b689a8c11d424e43565d2aa440b77bbf4 (diff) |
[PATCH] sh: Simple timer framework
This builds on some of the clock framework code to support a simple system
timer interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/timer.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h new file mode 100644 index 000000000000..dd6579c0b04c --- /dev/null +++ b/include/asm-sh/timer.h | |||
@@ -0,0 +1,42 @@ | |||
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 | unsigned long (*get_offset)(void); | ||
10 | unsigned long (*get_frequency)(void); | ||
11 | }; | ||
12 | |||
13 | struct sys_timer { | ||
14 | const char *name; | ||
15 | |||
16 | struct sys_device dev; | ||
17 | struct sys_timer_ops *ops; | ||
18 | }; | ||
19 | |||
20 | #define TICK_SIZE (tick_nsec / 1000) | ||
21 | |||
22 | extern struct sys_timer tmu_timer; | ||
23 | extern struct sys_timer *sys_timer; | ||
24 | |||
25 | static inline unsigned long get_timer_offset(void) | ||
26 | { | ||
27 | return sys_timer->ops->get_offset(); | ||
28 | } | ||
29 | |||
30 | static inline unsigned long get_timer_frequency(void) | ||
31 | { | ||
32 | return sys_timer->ops->get_frequency(); | ||
33 | } | ||
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(struct pt_regs *); | ||
40 | |||
41 | #endif /* __ASM_SH_TIMER_H */ | ||
42 | |||