2 * Copyright (c) 1998-2000 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 typedef vm_address_t IOVirtualAddress
;
85 typedef IOVirtualAddress IOLogicalAddress
;
89 typedef UInt64 IOPhysicalAddress
;
90 typedef UInt64 IOPhysicalLength
;
91 #define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32))
96 typedef UInt32 IOPhysicalAddress
;
97 typedef UInt32 IOPhysicalLength
;
98 #define IOPhysical32( hi, lo ) (lo)
104 struct IOVirtualRange
106 IOVirtualAddress address
;
112 IOVirtualAddress address
;
118 * Map between #defined or enum'd constants and text description.
127 * Memory alignment -- specified as a power of two.
129 typedef unsigned int IOAlignment
;
131 #define IO_NULL_VM_TASK ((vm_task_t)0)
135 * Pull in machine specific stuff.
138 //#include <IOKit/machine/IOTypes.h>
142 #ifndef __IOKIT_PORTS_DEFINED__
143 #define __IOKIT_PORTS_DEFINED__
145 typedef struct OSObject
* io_object_t
;
147 typedef mach_port_t io_object_t
;
149 #endif /* __IOKIT_PORTS_DEFINED__ */
151 #include <device/device_types.h>
153 typedef io_object_t io_connect_t
;
154 typedef io_object_t io_iterator_t
;
155 typedef io_object_t io_registry_entry_t
;
156 typedef io_object_t io_service_t
;
158 typedef io_object_t io_enumerator_t
;
160 #endif /* MACH_KERNEL */
162 // IOConnectMapMemory memoryTypes
164 kIODefaultMemoryType
= 0
170 kIOWriteThruCache
= 2,
174 // IOMemory mapping options
176 kIOMapAnywhere
= 0x00000001,
178 kIOMapCacheMask
= 0x00000300,
179 kIOMapCacheShift
= 8,
180 kIOMapDefaultCache
= kIODefaultCache
<< kIOMapCacheShift
,
181 kIOMapInhibitCache
= kIOInhibitCache
<< kIOMapCacheShift
,
182 kIOMapWriteThruCache
= kIOWriteThruCache
<< kIOMapCacheShift
,
183 kIOMapCopybackCache
= kIOCopybackCache
<< kIOMapCacheShift
,
185 kIOMapUserOptionsMask
= 0x00000fff,
187 kIOMapReadOnly
= 0x00001000,
189 kIOMapStatic
= 0x01000000,
190 kIOMapReference
= 0x02000000
193 /*! @enum Scale Factors
194 @discussion Used when a scale_factor parameter is required to define a unit of time.
195 @constant kNanosecondScale Scale factor for nanosecond based times.
196 @constant kMicrosecondScale Scale factor for microsecond based times.
197 @constant kMillisecondScale Scale factor for millisecond based times.
198 @constant kSecondScale Scale factor for second based times. */
201 kNanosecondScale
= 1,
202 kMicrosecondScale
= 1000,
203 kMillisecondScale
= 1000 * 1000,
204 kSecondScale
= 1000 * 1000 * 1000
207 /* compatibility types */
211 * Machine-independent caching specification.
214 IO_CacheOff
, // cache inhibit
219 //typedef char OSString[64];
220 typedef unsigned int IODeviceNumber
;
221 typedef unsigned int IOObjectNumber
;
229 #endif /* ! __IOKIT_IOTYPES_H */