ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-i386 / timer.h
1 #ifndef _ASMi386_TIMER_H
2 #define _ASMi386_TIMER_H
3
4 /**
5  * struct timer_ops - used to define a timer source
6  *
7  * @init: Probes and initializes the timer. Takes clock= override 
8  *  string as an argument. Returns 0 on success, anything else on failure.
9  * @mark_offset: called by the timer interrupt
10  * @get_offset: called by gettimeofday().  Returns the number of ms since the
11  *      last timer intruupt.
12  */
13 struct timer_opts{
14         char* name;
15         int (*init)(char *override);
16         void (*mark_offset)(void);
17         unsigned long (*get_offset)(void);
18         unsigned long long (*monotonic_clock)(void);
19         void (*delay)(unsigned long);
20 };
21
22 #define TICK_SIZE (tick_nsec / 1000)
23
24 extern struct timer_opts* select_timer(void);
25 extern void clock_fallback(void);
26
27 /* Modifiers for buggy PIT handling */
28
29 extern int pit_latch_buggy;
30
31 extern struct timer_opts *cur_timer;
32 extern int timer_ack;
33
34 /* list of externed timers */
35 extern struct timer_opts timer_none;
36 extern struct timer_opts timer_pit;
37 extern struct timer_opts timer_tsc;
38 #ifdef CONFIG_X86_CYCLONE_TIMER
39 extern struct timer_opts timer_cyclone;
40 #endif
41
42 extern unsigned long calibrate_tsc(void);
43 extern void init_cpu_khz(void);
44 #ifdef CONFIG_HPET_TIMER
45 extern struct timer_opts timer_hpet;
46 extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
47 #endif
48
49 #ifdef CONFIG_X86_PM_TIMER
50 extern struct timer_opts timer_pmtmr;
51 #endif
52 #endif