2 * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 #ifndef __IOKIT_IOTYPES_H
31 #define __IOKIT_IOTYPES_H
38 #include <IOKit/system.h>
40 #include <mach/message.h>
41 #include <mach/vm_types.h>
44 #include <IOKit/IOReturn.h>
57 #ifndef __MACTYPES__ /* CF MacTypes.h */
58 #ifndef __TYPES__ /* guess... Mac Types.h */
60 #include <libkern/OSTypes.h>
74 #endif /* __TYPES__ */
75 #endif /* __MACTYPES__ */
77 typedef UInt32 IOOptionBits
;
78 typedef SInt32 IOFixed
;
79 typedef UInt32 IOVersion
;
80 typedef UInt32 IOItemCount
;
81 typedef UInt32 IOCacheMode
;
83 typedef UInt32 IOByteCount
;
85 /* LP64todo - these will need to expand to mach_vm_address_t */
86 typedef vm_address_t IOVirtualAddress
;
87 typedef IOVirtualAddress IOLogicalAddress
;
91 typedef UInt64 IOPhysicalAddress
;
92 typedef UInt64 IOPhysicalLength
;
93 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
98 typedef UInt32 IOPhysicalAddress
;
99 typedef UInt32 IOPhysicalLength
;
100 #define IOPhysical32( hi, lo ) (lo)
101 #define IOPhysSize 32
106 struct IOVirtualRange
108 IOVirtualAddress address
;
114 IOVirtualAddress address
;
120 * Map between #defined or enum'd constants and text description.
129 * Memory alignment -- specified as a power of two.
131 typedef unsigned int IOAlignment
;
133 #define IO_NULL_VM_TASK ((vm_task_t)0)
137 * Pull in machine specific stuff.
140 //#include <IOKit/machine/IOTypes.h>
144 #ifndef __IOKIT_PORTS_DEFINED__
145 #define __IOKIT_PORTS_DEFINED__
147 typedef struct OSObject
* io_object_t
;
149 typedef mach_port_t io_object_t
;
151 #endif /* __IOKIT_PORTS_DEFINED__ */
153 #include <device/device_types.h>
155 typedef io_object_t io_connect_t
;
156 typedef io_object_t io_enumerator_t
;
157 typedef io_object_t io_iterator_t
;
158 typedef io_object_t io_registry_entry_t
;
159 typedef io_object_t io_service_t
;
161 #define IO_OBJECT_NULL ((io_object_t) 0)
163 #endif /* MACH_KERNEL */
165 // IOConnectMapMemory memoryTypes
167 kIODefaultMemoryType
= 0
173 kIOWriteThruCache
= 2,
174 kIOCopybackCache
= 3,
175 kIOWriteCombineCache
= 4
178 // IOMemory mapping options
180 kIOMapAnywhere
= 0x00000001,
182 kIOMapCacheMask
= 0x00000700,
183 kIOMapCacheShift
= 8,
184 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
185 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
186 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
187 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
188 kIOMapWriteCombineCache
= kIOWriteCombineCache
<< kIOMapCacheShift
,
190 kIOMapUserOptionsMask
= 0x00000fff,
192 kIOMapReadOnly
= 0x00001000,
194 kIOMapStatic
= 0x01000000,
195 kIOMapReference
= 0x02000000,
196 kIOMapUnique
= 0x04000000
199 /*! @enum Scale Factors
200 @discussion Used when a scale_factor parameter is required to define a unit of time.
201 @constant kNanosecondScale Scale factor for nanosecond based times.
202 @constant kMicrosecondScale Scale factor for microsecond based times.
203 @constant kMillisecondScale Scale factor for millisecond based times.
204 @constant kTickScale Scale factor for the standard (100Hz) tick.
205 @constant kSecondScale Scale factor for second based times. */
208 kNanosecondScale
= 1,
209 kMicrosecondScale
= 1000,
210 kMillisecondScale
= 1000 * 1000,
211 kSecondScale
= 1000 * 1000 * 1000,
212 kTickScale
= (kSecondScale
/ 100)
215 /* compatibility types */
219 * Machine-independent caching specification.
222 IO_CacheOff
, // cache inhibit
227 //typedef char OSString[64];
228 typedef unsigned int IODeviceNumber
;
229 typedef unsigned int IOObjectNumber
;
237 #endif /* ! __IOKIT_IOTYPES_H */