timer.h 866 字节
Newer Older
P
Paul Mundt 已提交
1 2 3 4
#ifndef __ASM_SH_TIMER_H
#define __ASM_SH_TIMER_H

#include <linux/sysdev.h>
5
#include <linux/clocksource.h>
P
Paul Mundt 已提交
6
#include <cpu/timer.h>
P
Paul Mundt 已提交
7 8 9

struct sys_timer_ops {
	int (*init)(void);
A
Andriy Skulysh 已提交
10 11
	int (*start)(void);
	int (*stop)(void);
12
#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
P
Paul Mundt 已提交
13
	unsigned long (*get_offset)(void);
14
#endif
P
Paul Mundt 已提交
15 16 17 18 19 20 21 22 23 24 25
};

struct sys_timer {
	const char		*name;

	struct sys_device	dev;
	struct sys_timer_ops	*ops;
};

#define TICK_SIZE (tick_nsec / 1000)

M
Magnus Damm 已提交
26
extern struct sys_timer tmu_timer, mtu2_timer;
P
Paul Mundt 已提交
27 28
extern struct sys_timer *sys_timer;

29
#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
P
Paul Mundt 已提交
30 31 32 33
static inline unsigned long get_timer_offset(void)
{
	return sys_timer->ops->get_offset();
}
34
#endif
P
Paul Mundt 已提交
35 36 37 38 39

/* arch/sh/kernel/timers/timer.c */
struct sys_timer *get_sys_timer(void);

/* arch/sh/kernel/time.c */
P
Paul Mundt 已提交
40
void handle_timer_tick(void);
41 42

extern struct clocksource clocksource_sh;
P
Paul Mundt 已提交
43 44

#endif /* __ASM_SH_TIMER_H */