patch-2_6_7-vs1_9_1_12
[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  * @name: name of the timer.
8  * @init: Probes and initializes the timer. Takes clock= override 
9  *        string as an argument. Returns 0 on success, anything else
10  *        on failure.
11  * @mark_offset: called by the timer interrupt.
12  * @get_offset:  called by gettimeofday(). Returns the number of microseconds
13  *               since the last timer interupt.
14  * @monotonic_clock: returns the number of nanoseconds since the init of the
15  *                   timer.
16  * @delay: delays this many clock cycles.
17  */
18 struct timer_opts{
19         char* name;
20         int (*init)(char *override);
21         void (*mark_offset)(void);
22         unsigned long (*get_offset)(void);
23         unsigned long long (*monotonic_clock)(void);
24         void (*delay)(unsigned long);
25 };
26
27 #define TICK_SIZE (tick_nsec / 1000)
28
29 extern struct timer_opts* select_timer(void);
30 extern void clock_fallback(void);
31
32 /* Modifiers for buggy PIT handling */
33
34 extern int pit_latch_buggy;
35
36 extern struct timer_opts *cur_timer;
37 extern int timer_ack;
38
39 /* list of externed timers */
40 extern struct timer_opts timer_none;
41 extern struct timer_opts timer_pit;
42 extern struct timer_opts timer_tsc;
43 #ifdef CONFIG_X86_CYCLONE_TIMER
44 extern struct timer_opts timer_cyclone;
45 #endif
46
47 extern unsigned long calibrate_tsc(void);
48 extern void init_cpu_khz(void);
49 #ifdef CONFIG_HPET_TIMER
50 extern struct timer_opts timer_hpet;
51 extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
52 #endif
53
54 #ifdef CONFIG_X86_PM_TIMER
55 extern struct timer_opts timer_pmtmr;
56 #endif
57 #endif