2 * Copyright (c) 1998-2012 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@
28 #ifndef __IOKIT_IOTYPES_H
29 #define __IOKIT_IOTYPES_H
36 #include <IOKit/system.h>
38 #include <mach/message.h>
39 #include <mach/vm_types.h>
42 #include <IOKit/IOReturn.h>
49 #if defined (__cplusplus)
52 #define NULL ((void *)0)
60 #include <libkern/OSTypes.h>
63 #include <libkern/OSBase.h>
66 typedef UInt32 IOOptionBits
;
67 typedef SInt32 IOFixed
;
68 typedef UInt32 IOVersion
;
69 typedef UInt32 IOItemCount
;
70 typedef UInt32 IOCacheMode
;
72 typedef UInt32 IOByteCount32
;
73 typedef UInt64 IOByteCount64
;
75 typedef UInt32 IOPhysicalAddress32
;
76 typedef UInt64 IOPhysicalAddress64
;
77 typedef UInt32 IOPhysicalLength32
;
78 typedef UInt64 IOPhysicalLength64
;
80 #if !defined(__arm__) && !defined(__i386__)
81 typedef mach_vm_address_t IOVirtualAddress
;
83 typedef vm_address_t IOVirtualAddress
;
86 #if !defined(__arm__) && !defined(__i386__) && !(defined(__x86_64__) && !defined(KERNEL))
87 typedef IOByteCount64 IOByteCount
;
89 typedef IOByteCount32 IOByteCount
;
92 typedef IOVirtualAddress IOLogicalAddress
;
94 #if !defined(__arm__) && !defined(__i386__) && !(defined(__x86_64__) && !defined(KERNEL))
96 typedef IOPhysicalAddress64 IOPhysicalAddress
;
97 typedef IOPhysicalLength64 IOPhysicalLength
;
98 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
103 typedef IOPhysicalAddress32 IOPhysicalAddress
;
104 typedef IOPhysicalLength32 IOPhysicalLength
;
105 #define IOPhysical32( hi, lo ) (lo)
106 #define IOPhysSize 32
113 IOPhysicalAddress address
;
119 IOVirtualAddress address
;
123 #if !defined(__arm__) && !defined(__i386__)
124 typedef IOVirtualRange IOAddressRange
;
128 mach_vm_address_t address
;
129 mach_vm_size_t length
;
134 * Map between #defined or enum'd constants and text description.
143 * Memory alignment -- specified as a power of two.
145 typedef unsigned int IOAlignment
;
147 #define IO_NULL_VM_TASK ((vm_task_t)0)
151 * Pull in machine specific stuff.
154 //#include <IOKit/machine/IOTypes.h>
158 #ifndef __IOKIT_PORTS_DEFINED__
159 #define __IOKIT_PORTS_DEFINED__
163 typedef OSObject
* io_object_t
;
165 typedef struct OSObject
* io_object_t
;
168 typedef mach_port_t io_object_t
;
170 #endif /* __IOKIT_PORTS_DEFINED__ */
172 #include <device/device_types.h>
174 typedef io_object_t io_connect_t
;
175 typedef io_object_t io_enumerator_t
;
176 typedef io_object_t io_iterator_t
;
177 typedef io_object_t io_registry_entry_t
;
178 typedef io_object_t io_service_t
;
180 #define IO_OBJECT_NULL ((io_object_t) 0)
182 #endif /* MACH_KERNEL */
184 // IOConnectMapMemory memoryTypes
186 kIODefaultMemoryType
= 0
192 kIOWriteThruCache
= 2,
193 kIOCopybackCache
= 3,
194 kIOWriteCombineCache
= 4,
195 kIOCopybackInnerCache
= 5
198 // IOMemory mapping options
200 kIOMapAnywhere
= 0x00000001,
202 kIOMapCacheMask
= 0x00000700,
203 kIOMapCacheShift
= 8,
204 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
205 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
206 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
207 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
208 kIOMapWriteCombineCache
= kIOWriteCombineCache
<< kIOMapCacheShift
,
209 kIOMapCopybackInnerCache
= kIOCopybackInnerCache
<< kIOMapCacheShift
,
211 kIOMapUserOptionsMask
= 0x00000fff,
213 kIOMapReadOnly
= 0x00001000,
215 kIOMapStatic
= 0x01000000,
216 kIOMapReference
= 0x02000000,
217 kIOMapUnique
= 0x04000000,
218 #ifdef XNU_KERNEL_PRIVATE
219 kIOMap64Bit
= 0x08000000,
221 kIOMapPrefault
= 0x10000000,
224 /*! @enum Scale Factors
225 @discussion Used when a scale_factor parameter is required to define a unit of time.
226 @constant kNanosecondScale Scale factor for nanosecond based times.
227 @constant kMicrosecondScale Scale factor for microsecond based times.
228 @constant kMillisecondScale Scale factor for millisecond based times.
229 @constant kTickScale Scale factor for the standard (100Hz) tick.
230 @constant kSecondScale Scale factor for second based times. */
233 kNanosecondScale
= 1,
234 kMicrosecondScale
= 1000,
235 kMillisecondScale
= 1000 * 1000,
236 kSecondScale
= 1000 * 1000 * 1000,
237 kTickScale
= (kSecondScale
/ 100)
241 kIOConnectMethodVarOutputSize
= -3
244 /* compatibility types */
248 typedef unsigned int IODeviceNumber
;
256 #endif /* ! __IOKIT_IOTYPES_H */