2 * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
37 #ifndef __IOKIT_IOTYPES_H
38 #define __IOKIT_IOTYPES_H
45 #include <IOKit/system.h>
47 #include <mach/message.h>
48 #include <mach/vm_types.h>
51 #include <IOKit/IOReturn.h>
64 #ifndef __MACTYPES__ /* CF MacTypes.h */
65 #ifndef __TYPES__ /* guess... Mac Types.h */
67 #include <libkern/OSTypes.h>
81 #endif /* __TYPES__ */
82 #endif /* __MACTYPES__ */
84 typedef UInt32 IOOptionBits
;
85 typedef SInt32 IOFixed
;
86 typedef UInt32 IOVersion
;
87 typedef UInt32 IOItemCount
;
88 typedef UInt32 IOCacheMode
;
90 typedef UInt32 IOByteCount
;
92 /* LP64todo - these will need to expand to mach_vm_address_t */
93 typedef vm_address_t IOVirtualAddress
;
94 typedef IOVirtualAddress IOLogicalAddress
;
98 typedef UInt64 IOPhysicalAddress
;
99 typedef UInt64 IOPhysicalLength
;
100 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
101 #define IOPhysSize 64
105 typedef UInt32 IOPhysicalAddress
;
106 typedef UInt32 IOPhysicalLength
;
107 #define IOPhysical32( hi, lo ) (lo)
108 #define IOPhysSize 32
113 struct IOVirtualRange
115 IOVirtualAddress address
;
121 IOVirtualAddress address
;
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
206 /*! @enum Scale Factors
207 @discussion Used when a scale_factor parameter is required to define a unit of time.
208 @constant kNanosecondScale Scale factor for nanosecond based times.
209 @constant kMicrosecondScale Scale factor for microsecond based times.
210 @constant kMillisecondScale Scale factor for millisecond based times.
211 @constant kTickScale Scale factor for the standard (100Hz) tick.
212 @constant kSecondScale Scale factor for second based times. */
215 kNanosecondScale
= 1,
216 kMicrosecondScale
= 1000,
217 kMillisecondScale
= 1000 * 1000,
218 kSecondScale
= 1000 * 1000 * 1000,
219 kTickScale
= (kSecondScale
/ 100)
222 /* compatibility types */
226 * Machine-independent caching specification.
229 IO_CacheOff
, // cache inhibit
234 //typedef char OSString[64];
235 typedef unsigned int IODeviceNumber
;
236 typedef unsigned int IOObjectNumber
;
244 #endif /* ! __IOKIT_IOTYPES_H */