2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
32 #ifndef __IOKIT_IOTYPES_H
33 #define __IOKIT_IOTYPES_H
40 #include <IOKit/system.h>
42 #include <mach/message.h>
43 #include <mach/vm_types.h>
46 #include <IOKit/IOReturn.h>
59 #ifndef __MACTYPES__ /* CF MacTypes.h */
60 #ifndef __TYPES__ /* guess... Mac Types.h */
62 #include <libkern/OSTypes.h>
76 #endif /* __TYPES__ */
77 #endif /* __MACTYPES__ */
79 typedef UInt32 IOOptionBits
;
80 typedef SInt32 IOFixed
;
81 typedef UInt32 IOVersion
;
82 typedef UInt32 IOItemCount
;
83 typedef UInt32 IOCacheMode
;
85 typedef UInt32 IOByteCount
;
87 typedef vm_address_t IOVirtualAddress
;
88 typedef IOVirtualAddress IOLogicalAddress
;
92 typedef UInt64 IOPhysicalAddress
;
93 typedef UInt64 IOPhysicalLength
;
94 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
99 typedef UInt32 IOPhysicalAddress
;
100 typedef UInt32 IOPhysicalLength
;
101 #define IOPhysical32( hi, lo ) (lo)
102 #define IOPhysSize 32
107 struct IOVirtualRange
109 IOVirtualAddress address
;
115 IOVirtualAddress address
;
121 * Map between #defined or enum'd constants and text description.
130 * Memory alignment -- specified as a power of two.
132 typedef unsigned int IOAlignment
;
134 #define IO_NULL_VM_TASK ((vm_task_t)0)
138 * Pull in machine specific stuff.
141 //#include <IOKit/machine/IOTypes.h>
145 #ifndef __IOKIT_PORTS_DEFINED__
146 #define __IOKIT_PORTS_DEFINED__
148 typedef struct OSObject
* io_object_t
;
150 typedef mach_port_t io_object_t
;
152 #endif /* __IOKIT_PORTS_DEFINED__ */
154 #include <device/device_types.h>
156 typedef io_object_t io_connect_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 typedef io_object_t io_enumerator_t
;
163 #endif /* MACH_KERNEL */
165 // IOConnectMapMemory memoryTypes
167 kIODefaultMemoryType
= 0
173 kIOWriteThruCache
= 2,
177 // IOMemory mapping options
179 kIOMapAnywhere
= 0x00000001,
181 kIOMapCacheMask
= 0x00000300,
182 kIOMapCacheShift
= 8,
183 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
184 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
185 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
186 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
188 kIOMapUserOptionsMask
= 0x00000fff,
190 kIOMapReadOnly
= 0x00001000,
192 kIOMapStatic
= 0x01000000,
193 kIOMapReference
= 0x02000000
196 /*! @enum Scale Factors
197 @discussion Used when a scale_factor parameter is required to define a unit of time.
198 @constant kNanosecondScale Scale factor for nanosecond based times.
199 @constant kMicrosecondScale Scale factor for microsecond based times.
200 @constant kMillisecondScale Scale factor for millisecond based times.
201 @constant kSecondScale Scale factor for second based times. */
204 kNanosecondScale
= 1,
205 kMicrosecondScale
= 1000,
206 kMillisecondScale
= 1000 * 1000,
207 kSecondScale
= 1000 * 1000 * 1000
210 /* compatibility types */
214 * Machine-independent caching specification.
217 IO_CacheOff
, // cache inhibit
222 //typedef char OSString[64];
223 typedef unsigned int IODeviceNumber
;
224 typedef unsigned int IOObjectNumber
;
232 #endif /* ! __IOKIT_IOTYPES_H */