2 * Copyright (c) 1998-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@
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)
59 #ifndef __MACTYPES__ /* CF MacTypes.h */
60 #ifndef __TYPES__ /* guess... Mac Types.h */
63 #include <libkern/OSTypes.h>
65 #endif /* __TYPES__ */
66 #endif /* __MACTYPES__ */
69 #include <libkern/OSBase.h>
72 typedef UInt32 IOOptionBits
;
73 typedef SInt32 IOFixed
;
74 typedef UInt32 IOVersion
;
75 typedef UInt32 IOItemCount
;
76 typedef UInt32 IOCacheMode
;
78 typedef UInt32 IOByteCount
;
80 /* LP64todo - these will need to expand to mach_vm_address_t */
81 typedef vm_address_t IOVirtualAddress
;
82 typedef IOVirtualAddress IOLogicalAddress
;
86 typedef UInt64 IOPhysicalAddress
;
87 typedef UInt64 IOPhysicalLength
;
88 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
93 typedef UInt32 IOPhysicalAddress
;
94 typedef UInt32 IOPhysicalLength
;
95 #define IOPhysical32( hi, lo ) (lo)
102 struct IOVirtualRange
104 IOVirtualAddress address
;
107 struct IOAddressRange
109 mach_vm_address_t address
;
110 mach_vm_size_t length
;
115 IOVirtualAddress address
;
121 mach_vm_address_t address
;
122 mach_vm_size_t length
;
127 * Map between #defined or enum'd constants and text description.
136 * Memory alignment -- specified as a power of two.
138 typedef unsigned int IOAlignment
;
140 #define IO_NULL_VM_TASK ((vm_task_t)0)
144 * Pull in machine specific stuff.
147 //#include <IOKit/machine/IOTypes.h>
151 #ifndef __IOKIT_PORTS_DEFINED__
152 #define __IOKIT_PORTS_DEFINED__
154 typedef struct OSObject
* io_object_t
;
156 typedef mach_port_t io_object_t
;
158 #endif /* __IOKIT_PORTS_DEFINED__ */
160 #include <device/device_types.h>
162 typedef io_object_t io_connect_t
;
163 typedef io_object_t io_enumerator_t
;
164 typedef io_object_t io_iterator_t
;
165 typedef io_object_t io_registry_entry_t
;
166 typedef io_object_t io_service_t
;
168 #define IO_OBJECT_NULL ((io_object_t) 0)
170 #endif /* MACH_KERNEL */
172 // IOConnectMapMemory memoryTypes
174 kIODefaultMemoryType
= 0
180 kIOWriteThruCache
= 2,
181 kIOCopybackCache
= 3,
182 kIOWriteCombineCache
= 4
185 // IOMemory mapping options
187 kIOMapAnywhere
= 0x00000001,
189 kIOMapCacheMask
= 0x00000700,
190 kIOMapCacheShift
= 8,
191 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
192 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
193 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
194 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
195 kIOMapWriteCombineCache
= kIOWriteCombineCache
<< kIOMapCacheShift
,
197 kIOMapUserOptionsMask
= 0x00000fff,
199 kIOMapReadOnly
= 0x00001000,
201 kIOMapStatic
= 0x01000000,
202 kIOMapReference
= 0x02000000,
203 kIOMapUnique
= 0x04000000,
204 kIOMap64Bit
= 0x08000000
207 /*! @enum Scale Factors
208 @discussion Used when a scale_factor parameter is required to define a unit of time.
209 @constant kNanosecondScale Scale factor for nanosecond based times.
210 @constant kMicrosecondScale Scale factor for microsecond based times.
211 @constant kMillisecondScale Scale factor for millisecond based times.
212 @constant kTickScale Scale factor for the standard (100Hz) tick.
213 @constant kSecondScale Scale factor for second based times. */
216 kNanosecondScale
= 1,
217 kMicrosecondScale
= 1000,
218 kMillisecondScale
= 1000 * 1000,
219 kSecondScale
= 1000 * 1000 * 1000,
220 kTickScale
= (kSecondScale
/ 100)
223 /* compatibility types */
227 * Machine-independent caching specification.
230 IO_CacheOff
, // cache inhibit
235 //typedef char OSString[64];
236 typedef unsigned int IODeviceNumber
;
237 typedef unsigned int IOObjectNumber
;
245 #endif /* ! __IOKIT_IOTYPES_H */