2 * Copyright (c) 1998-2004 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@
29 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
35 #ifndef __IOKIT_IOTYPES_H
36 #define __IOKIT_IOTYPES_H
43 #include <IOKit/system.h>
45 #include <mach/message.h>
46 #include <mach/vm_types.h>
49 #include <IOKit/IOReturn.h>
62 #ifndef __MACTYPES__ /* CF MacTypes.h */
63 #ifndef __TYPES__ /* guess... Mac Types.h */
66 #include <libkern/OSTypes.h>
68 #endif /* __TYPES__ */
69 #endif /* __MACTYPES__ */
71 typedef UInt32 IOOptionBits
;
72 typedef SInt32 IOFixed
;
73 typedef UInt32 IOVersion
;
74 typedef UInt32 IOItemCount
;
75 typedef UInt32 IOCacheMode
;
77 typedef UInt32 IOByteCount
;
79 /* LP64todo - these will need to expand to mach_vm_address_t */
80 typedef vm_address_t IOVirtualAddress
;
81 typedef IOVirtualAddress IOLogicalAddress
;
85 typedef UInt64 IOPhysicalAddress
;
86 typedef UInt64 IOPhysicalLength
;
87 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
92 typedef UInt32 IOPhysicalAddress
;
93 typedef UInt32 IOPhysicalLength
;
94 #define IOPhysical32( hi, lo ) (lo)
100 struct IOVirtualRange
102 IOVirtualAddress address
;
105 struct IOAddressRange
107 mach_vm_address_t address
;
108 mach_vm_size_t length
;
113 IOVirtualAddress address
;
117 struct IOAddressRange
119 mach_vm_address_t address
;
120 mach_vm_size_t length
;
125 * Map between #defined or enum'd constants and text description.
134 * Memory alignment -- specified as a power of two.
136 typedef unsigned int IOAlignment
;
138 #define IO_NULL_VM_TASK ((vm_task_t)0)
142 * Pull in machine specific stuff.
145 //#include <IOKit/machine/IOTypes.h>
149 #ifndef __IOKIT_PORTS_DEFINED__
150 #define __IOKIT_PORTS_DEFINED__
152 typedef struct OSObject
* io_object_t
;
154 typedef mach_port_t io_object_t
;
156 #endif /* __IOKIT_PORTS_DEFINED__ */
158 #include <device/device_types.h>
160 typedef io_object_t io_connect_t
;
161 typedef io_object_t io_enumerator_t
;
162 typedef io_object_t io_iterator_t
;
163 typedef io_object_t io_registry_entry_t
;
164 typedef io_object_t io_service_t
;
166 #define IO_OBJECT_NULL ((io_object_t) 0)
168 #endif /* MACH_KERNEL */
170 // IOConnectMapMemory memoryTypes
172 kIODefaultMemoryType
= 0
178 kIOWriteThruCache
= 2,
179 kIOCopybackCache
= 3,
180 kIOWriteCombineCache
= 4
183 // IOMemory mapping options
185 kIOMapAnywhere
= 0x00000001,
187 kIOMapCacheMask
= 0x00000700,
188 kIOMapCacheShift
= 8,
189 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
190 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
191 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
192 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
193 kIOMapWriteCombineCache
= kIOWriteCombineCache
<< kIOMapCacheShift
,
195 kIOMapUserOptionsMask
= 0x00000fff,
197 kIOMapReadOnly
= 0x00001000,
199 kIOMapStatic
= 0x01000000,
200 kIOMapReference
= 0x02000000,
201 kIOMapUnique
= 0x04000000
204 /*! @enum Scale Factors
205 @discussion Used when a scale_factor parameter is required to define a unit of time.
206 @constant kNanosecondScale Scale factor for nanosecond based times.
207 @constant kMicrosecondScale Scale factor for microsecond based times.
208 @constant kMillisecondScale Scale factor for millisecond based times.
209 @constant kTickScale Scale factor for the standard (100Hz) tick.
210 @constant kSecondScale Scale factor for second based times. */
213 kNanosecondScale
= 1,
214 kMicrosecondScale
= 1000,
215 kMillisecondScale
= 1000 * 1000,
216 kSecondScale
= 1000 * 1000 * 1000,
217 kTickScale
= (kSecondScale
/ 100)
220 /* compatibility types */
224 * Machine-independent caching specification.
227 IO_CacheOff
, // cache inhibit
232 //typedef char OSString[64];
233 typedef unsigned int IODeviceNumber
;
234 typedef unsigned int IOObjectNumber
;
242 #endif /* ! __IOKIT_IOTYPES_H */