source: trunk/packages/xen-3.1/xen-3.1/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/timer.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.8 KB
Line 
1#ifndef _ASMi386_TIMER_H
2#define _ASMi386_TIMER_H
3#include <linux/init.h>
4
5/**
6 * struct timer_ops - used to define a timer source
7 *
8 * @name: name of the timer.
9 * @init: Probes and initializes the timer. Takes clock= override
10 *        string as an argument. Returns 0 on success, anything else
11 *        on failure.
12 * @mark_offset: called by the timer interrupt.
13 * @get_offset:  called by gettimeofday(). Returns the number of microseconds
14 *               since the last timer interupt.
15 * @monotonic_clock: returns the number of nanoseconds since the init of the
16 *                   timer.
17 * @delay: delays this many clock cycles.
18 */
19struct timer_opts {
20        char* name;
21        void (*mark_offset)(void);
22        unsigned long (*get_offset)(void);
23        unsigned long long (*monotonic_clock)(void);
24        void (*delay)(unsigned long);
25        unsigned long (*read_timer)(void);
26        int (*suspend)(pm_message_t state);
27        int (*resume)(void);
28};
29
30struct init_timer_opts {
31        int (*init)(char *override);
32        struct timer_opts *opts;
33};
34
35#define TICK_SIZE (tick_nsec / 1000)
36
37extern struct timer_opts* __init select_timer(void);
38extern void clock_fallback(void);
39void setup_pit_timer(void);
40
41/* Modifiers for buggy PIT handling */
42
43extern int pit_latch_buggy;
44
45extern struct timer_opts *cur_timer;
46extern int timer_ack;
47
48/* list of externed timers */
49extern struct timer_opts timer_none;
50extern struct timer_opts timer_pit;
51extern struct init_timer_opts timer_pit_init;
52extern struct init_timer_opts timer_tsc_init;
53#ifdef CONFIG_X86_CYCLONE_TIMER
54extern struct init_timer_opts timer_cyclone_init;
55#endif
56
57extern unsigned long calibrate_tsc(void);
58extern void init_cpu_khz(void);
59#ifdef CONFIG_HPET_TIMER
60extern struct init_timer_opts timer_hpet_init;
61extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
62#endif
63
64#ifdef CONFIG_X86_PM_TIMER
65extern struct init_timer_opts timer_pmtmr_init;
66#endif
67#endif
Note: See TracBrowser for help on using the repository browser.