headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / kernel / arch / x86 / timers / pit.h
blob13420aeb3368c1b437d3a69a3fe79c1735898aac
1 /*
2 * Copyright 2008, Dustin Howett, dustin.howett@gmail.com. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _KERNEL_ARCH_x86_TIMERS_PIT_H
6 #define _KERNEL_ARCH_x86_TIMERS_PIT_H
8 #include <SupportDefs.h>
10 /* ports */
11 #define PIT_CTRL 0x43
12 #define PIT_CNT0 0x40
13 #define PIT_CNT1 0x41
14 #define PIT_CNT2 0x42
16 /* commands */
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
32 #define PIT_BCD 0x01
34 #define PIT_LATCH 0x00
36 #define PIT_READ 0xF0
37 #define PIT_CNT 0x20
38 #define PIT_STAT 0x10
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 */