Subversion Repositories shark

Rev

Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 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
        int (*init)(char *override);
15
        void (*mark_offset)(void);
16
        unsigned long (*get_offset)(void);
17
        unsigned long long (*monotonic_clock)(void);
18
        void (*delay)(unsigned long);
19
};
20
 
21
#define TICK_SIZE (tick_nsec / 1000)
22
 
23
extern struct timer_opts* select_timer(void);
24
extern void clock_fallback(void);
25
 
26
/* Modifiers for buggy PIT handling */
27
 
28
extern int pit_latch_buggy;
29
 
30
extern struct timer_opts *cur_timer;
31
extern int timer_ack;
32
 
33
/* list of externed timers */
34
extern struct timer_opts timer_none;
35
extern struct timer_opts timer_pit;
36
extern struct timer_opts timer_tsc;
37
#ifdef CONFIG_X86_CYCLONE_TIMER
38
extern struct timer_opts timer_cyclone;
39
#endif
40
 
41
extern unsigned long calibrate_tsc(void);
42
#ifdef CONFIG_HPET_TIMER
43
extern struct timer_opts timer_hpet;
44
extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
45
#endif
46
 
47
#endif