2 * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
29 #ifndef __IOKIT_IOTYPES_H
30 #define __IOKIT_IOTYPES_H
37 #include <IOKit/system.h>
39 #include <mach/message.h>
40 #include <mach/vm_types.h>
43 #include <IOKit/IOReturn.h>
56 #ifndef __MACTYPES__ /* CF MacTypes.h */
57 #ifndef __TYPES__ /* guess... Mac Types.h */
59 #include <libkern/OSTypes.h>
73 #endif /* __TYPES__ */
74 #endif /* __MACTYPES__ */
76 typedef UInt32 IOOptionBits
;
77 typedef SInt32 IOFixed
;
78 typedef UInt32 IOVersion
;
79 typedef UInt32 IOItemCount
;
80 typedef UInt32 IOCacheMode
;
82 typedef UInt32 IOByteCount
;
84 /* LP64todo - these will need to expand to mach_vm_address_t */
85 typedef vm_address_t IOVirtualAddress
;
86 typedef IOVirtualAddress IOLogicalAddress
;
90 typedef UInt64 IOPhysicalAddress
;
91 typedef UInt64 IOPhysicalLength
;
92 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
97 typedef UInt32 IOPhysicalAddress
;
98 typedef UInt32 IOPhysicalLength
;
99 #define IOPhysical32( hi, lo ) (lo)
100 #define IOPhysSize 32
105 struct IOVirtualRange
107 IOVirtualAddress address
;
113 IOVirtualAddress address
;
119 * Map between #defined or enum'd constants and text description.
128 * Memory alignment -- specified as a power of two.
130 typedef unsigned int IOAlignment
;
132 #define IO_NULL_VM_TASK ((vm_task_t)0)
136 * Pull in machine specific stuff.
139 //#include <IOKit/machine/IOTypes.h>
143 #ifndef __IOKIT_PORTS_DEFINED__
144 #define __IOKIT_PORTS_DEFINED__
146 typedef struct OSObject
* io_object_t
;
148 typedef mach_port_t io_object_t
;
150 #endif /* __IOKIT_PORTS_DEFINED__ */
152 #include <device/device_types.h>
154 typedef io_object_t io_connect_t
;
155 typedef io_object_t io_enumerator_t
;
156 typedef io_object_t io_iterator_t
;
157 typedef io_object_t io_registry_entry_t
;
158 typedef io_object_t io_service_t
;
160 #define IO_OBJECT_NULL ((io_object_t) 0)
162 #endif /* MACH_KERNEL */
164 // IOConnectMapMemory memoryTypes
166 kIODefaultMemoryType
= 0
172 kIOWriteThruCache
= 2,
173 kIOCopybackCache
= 3,
174 kIOWriteCombineCache
= 4
177 // IOMemory mapping options
179 kIOMapAnywhere
= 0x00000001,
181 kIOMapCacheMask
= 0x00000700,
182 kIOMapCacheShift
= 8,
183 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
184 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
185 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
186 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
187 kIOMapWriteCombineCache
= kIOWriteCombineCache
<< kIOMapCacheShift
,
189 kIOMapUserOptionsMask
= 0x00000fff,
191 kIOMapReadOnly
= 0x00001000,
193 kIOMapStatic
= 0x01000000,
194 kIOMapReference
= 0x02000000,
195 kIOMapUnique
= 0x04000000
198 /*! @enum Scale Factors
199 @discussion Used when a scale_factor parameter is required to define a unit of time.
200 @constant kNanosecondScale Scale factor for nanosecond based times.
201 @constant kMicrosecondScale Scale factor for microsecond based times.
202 @constant kMillisecondScale Scale factor for millisecond based times.
203 @constant kTickScale Scale factor for the standard (100Hz) tick.
204 @constant kSecondScale Scale factor for second based times. */
207 kNanosecondScale
= 1,
208 kMicrosecondScale
= 1000,
209 kMillisecondScale
= 1000 * 1000,
210 kSecondScale
= 1000 * 1000 * 1000,
211 kTickScale
= (kSecondScale
/ 100)
214 /* compatibility types */
218 * Machine-independent caching specification.
221 IO_CacheOff
, // cache inhibit
226 //typedef char OSString[64];
227 typedef unsigned int IODeviceNumber
;
228 typedef unsigned int IOObjectNumber
;
236 #endif /* ! __IOKIT_IOTYPES_H */