]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/hpet.h
2 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
33 * HPET kernel functions to support the HPET KEXT and the
34 * power management KEXT.
39 * Memory mapped registers for the HPET
41 typedef struct hpetReg
{
42 uint64_t GCAP_ID
; /* General capabilities */
44 uint64_t GEN_CONF
; /* General configuration */
46 uint64_t GINTR_STA
; /* General Interrupt status */
48 uint64_t MAIN_CNT
; /* Main counter */
50 uint64_t TIM0_CONF
; /* Timer 0 config and cap */
52 #define Tn_INT_ENB_CNF 4
53 uint64_t TIM0_COMP
; /* Timer 0 comparator */
56 uint64_t TIM1_CONF
; /* Timer 1 config and cap */
57 uint64_t TIM1_COMP
; /* Timer 1 comparator */
59 uint64_t TIM2_CONF
; /* Timer 2 config and cap */
60 uint64_t TIM2_COMP
; /* Timer 2 comparator */
63 typedef struct hpetReg hpetReg_t
;
76 typedef struct hpetInfo hpetInfo_t
;
78 extern uint64_t hpetFemto
;
79 extern uint64_t hpetFreq
;
80 extern uint64_t hpetCvtt2n
;
81 extern uint64_t hpetCvtn2t
;
82 extern uint64_t tsc2hpet
;
83 extern uint64_t hpet2tsc
;
84 extern uint64_t bus2hpet
;
85 extern uint64_t hpet2bus
;
87 extern uint32_t rcbaArea
;
88 extern uint32_t rcbaAreap
;
90 extern void map_rcbaAread(void);
91 extern void hpet_init(void);
93 extern void hpet_save(void);
94 extern void hpet_restore(void);
96 #ifdef XNU_KERNEL_PRIVATE
97 extern int HPETInterrupt(void);
100 extern uint64_t rdHPET(void);
101 extern void hpet_get_info(hpetInfo_t
*info
);
103 #define hpetAddr 0xFED00000
106 #endif /* _I386_HPET_H_ */
108 #endif /* KERNEL_PRIVATE */