2 * Copyright 2008, Dustin Howett, dustin.howett@gmail.com. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _KERNEL_ARCH_x86_TIMERS_PIT_H
6 #define _KERNEL_ARCH_x86_TIMERS_PIT_H
8 #include <SupportDefs.h>
17 #define PIT_SELCH0 0x00
18 #define PIT_SELCH1 0x40
19 #define PIT_SELCH2 0x80
21 #define PIT_RWLOW 0x10
22 #define PIT_RWHIGH 0x20
23 #define PIT_RWBOTH 0x30
25 #define PIT_MD_INTON0 0x00
26 #define PIT_MD_ONESHOT 0x02
27 #define PIT_MD_RTGEN 0x04
28 #define PIT_MD_SQGEN 0x06
29 #define PIT_MD_SW_STRB 0x08
30 #define PIT_MD_HW_STRB 0x0A
34 #define PIT_LATCH 0x00
40 #define PIT_CLOCK_RATE 1193180
41 #define PIT_MAX_TIMER_INTERVAL (0xffff * 1000000ll / PIT_CLOCK_RATE)
43 /* Method Prototypes */
44 static int pit_get_prio(void);
45 static status_t
pit_set_hardware_timer(bigtime_t relativeTimeout
);
46 static status_t
pit_clear_hardware_timer(void);
47 static status_t
pit_init(struct kernel_args
*args
);
49 #endif /* _KERNEL_ARCH_x86_TIMERS_PIT_H */