Root/
Source at commit 1164 created 13 years 12 days ago. By azimutz, Add some pauses to nvidia.c and ati.c to help user feedback collection. | |
---|---|
1 | ␊ |
2 | #ifndef __IONDRVLIBRARIES__␊ |
3 | #define __IONDRVLIBRARIES__␊ |
4 | ␊ |
5 | #include <libkern/OSByteOrder.h>␊ |
6 | #include <libkern/OSAtomic.h>␊ |
7 | #include <IOKit/ndrvsupport/IOMacOSTypes.h>␊ |
8 | #include <IOKit/graphics/IOGraphicsTypes.h>␊ |
9 | ␊ |
10 | ␊ |
11 | #ifdef __cplusplus␊ |
12 | extern "C" {␊ |
13 | #endif␊ |
14 | ␊ |
15 | /* NameRegistry error codes */␊ |
16 | enum {␊ |
17 | nrLockedErr = -2536,␊ |
18 | nrNotEnoughMemoryErr = -2537,␊ |
19 | nrInvalidNodeErr = -2538,␊ |
20 | nrNotFoundErr = -2539,␊ |
21 | nrNotCreatedErr = -2540,␊ |
22 | nrNameErr = -2541,␊ |
23 | nrNotSlotDeviceErr = -2542,␊ |
24 | nrDataTruncatedErr = -2543,␊ |
25 | nrPowerErr = -2544,␊ |
26 | nrPowerSwitchAbortErr = -2545,␊ |
27 | nrTypeMismatchErr = -2546,␊ |
28 | nrNotModifiedErr = -2547,␊ |
29 | nrOverrunErr = -2548,␊ |
30 | nrResultCodeBase = -2549,␊ |
31 | nrPathNotFound = -2550, /* a path component lookup failed */␊ |
32 | nrPathBufferTooSmall = -2551, /* buffer for path is too small */␊ |
33 | nrInvalidEntryIterationOp = -2552, /* invalid entry iteration operation */␊ |
34 | nrPropertyAlreadyExists = -2553, /* property already exists */␊ |
35 | nrIterationDone = -2554, /* iteration operation is done */␊ |
36 | nrExitedIteratorScope = -2555, /* outer scope of iterator was exited */␊ |
37 | nrTransactionAborted = -2556, /* transaction was aborted */␊ |
38 | ␊ |
39 | gestaltUndefSelectorErr = -5551 /*undefined selector was passed to Gestalt*/␊ |
40 | };␊ |
41 | ␊ |
42 | enum {␊ |
43 | kNVRAMProperty = 0x00000020, // matches NR␊ |
44 | };␊ |
45 | ␊ |
46 | ␊ |
47 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
48 | ␊ |
49 | #ifndef _IOKIT_IOSERVICE_H␊ |
50 | typedef struct IOService IOService;␊ |
51 | #endif␊ |
52 | ␊ |
53 | IOReturn _IONDRVLibrariesInitialize( IOService * provider );␊ |
54 | IOReturn _IONDRVLibrariesFinalize( IOService * provider );␊ |
55 | ␊ |
56 | #ifndef kAAPLRegEntryIDKey␊ |
57 | #define kAAPLRegEntryIDKey "AAPL,RegEntryID"␊ |
58 | #endif␊ |
59 | ␊ |
60 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
61 | ␊ |
62 | UInt32 EndianSwap32Bit( UInt32 data );␊ |
63 | ␊ |
64 | UInt16 EndianSwap16Bit( UInt16 data );␊ |
65 | ␊ |
66 | void SynchronizeIO(void);␊ |
67 | ␊ |
68 | OSErr ExpMgrConfigReadLong(␊ |
69 | RegEntryIDPtr node,␊ |
70 | LogicalAddress configAddr,␊ |
71 | UInt32 * valuePtr);␊ |
72 | ␊ |
73 | OSErr ExpMgrConfigWriteLong(␊ |
74 | RegEntryIDPtr node,␊ |
75 | LogicalAddress configAddr,␊ |
76 | UInt32 value);␊ |
77 | ␊ |
78 | OSErr ExpMgrConfigReadWord(␊ |
79 | RegEntryIDPtr node,␊ |
80 | LogicalAddress configAddr,␊ |
81 | UInt16 * valuePtr);␊ |
82 | ␊ |
83 | OSErr ExpMgrConfigWriteWord(␊ |
84 | RegEntryIDPtr node,␊ |
85 | LogicalAddress configAddr,␊ |
86 | UInt16 value);␊ |
87 | ␊ |
88 | OSErr ExpMgrConfigReadByte(␊ |
89 | RegEntryIDPtr node,␊ |
90 | LogicalAddress configAddr,␊ |
91 | UInt8 * valuePtr);␊ |
92 | ␊ |
93 | OSErr ExpMgrConfigWriteByte(␊ |
94 | RegEntryIDPtr node,␊ |
95 | LogicalAddress configAddr,␊ |
96 | UInt8 value);␊ |
97 | ␊ |
98 | OSErr ExpMgrIOReadLong(␊ |
99 | RegEntryIDPtr node,␊ |
100 | LogicalAddress ioAddr,␊ |
101 | UInt32 * valuePtr);␊ |
102 | ␊ |
103 | OSErr ExpMgrIOWriteLong(␊ |
104 | RegEntryIDPtr node,␊ |
105 | LogicalAddress ioAddr,␊ |
106 | UInt32 value);␊ |
107 | ␊ |
108 | OSErr ExpMgrIOReadWord(␊ |
109 | RegEntryIDPtr node,␊ |
110 | LogicalAddress ioAddr,␊ |
111 | UInt16 * valuePtr);␊ |
112 | ␊ |
113 | OSErr ExpMgrIOWriteWord(␊ |
114 | RegEntryIDPtr node,␊ |
115 | LogicalAddress ioAddr,␊ |
116 | UInt16 value);␊ |
117 | ␊ |
118 | OSErr ExpMgrIOReadByte(␊ |
119 | RegEntryIDPtr node,␊ |
120 | LogicalAddress ioAddr,␊ |
121 | UInt8 * valuePtr);␊ |
122 | ␊ |
123 | OSErr ExpMgrIOWriteByte(␊ |
124 | RegEntryIDPtr node,␊ |
125 | LogicalAddress ioAddr,␊ |
126 | UInt8 value);␊ |
127 | ␊ |
128 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
129 | /*******************************************************************************␊ |
130 | * ␊ |
131 | * Foundation Types␊ |
132 | *␊ |
133 | */␊ |
134 | /* Value of a property */␊ |
135 | typedef void * RegPropertyValue;␊ |
136 | /* Length of property value */␊ |
137 | typedef UInt32 RegPropertyValueSize;␊ |
138 | ␊ |
139 | /*******************************************************************************/␊ |
140 | ␊ |
141 | /*******************************************************************************␊ |
142 | *␊ |
143 | * Root Entry Name Definitions (Applies to all Names in the RootNameSpace)␊ |
144 | *␊ |
145 | * + Names are a colon-separated list of name components. Name components␊ |
146 | * may not themselves contain colons. ␊ |
147 | * + Names are presented as null-terminated ASCII character strings.␊ |
148 | * + Names follow similar parsing rules to Apple file system absolute␊ |
149 | * and relative paths. However the '::' parent directory syntax is␊ |
150 | * not currently supported.␊ |
151 | */␊ |
152 | /* Max length of Entry Name */␊ |
153 | enum {␊ |
154 | kRegCStrMaxEntryNameLength = 47␊ |
155 | };␊ |
156 | ␊ |
157 | /* Entry Names are single byte ASCII */␊ |
158 | typedef char RegCStrEntryName;␊ |
159 | typedef char * RegCStrEntryNamePtr;␊ |
160 | /* length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1*/␊ |
161 | typedef char RegCStrEntryNameBuf[48];␊ |
162 | typedef char RegCStrPathName;␊ |
163 | typedef UInt32 RegPathNameSize;␊ |
164 | enum {␊ |
165 | kRegPathNameSeparator = ':', /* 0x3A */␊ |
166 | kRegEntryNameTerminator = 0x00, /* '\0' */␊ |
167 | kRegPathNameTerminator = 0x00 /* '\0' */␊ |
168 | };␊ |
169 | ␊ |
170 | /*******************************************************************************␊ |
171 | *␊ |
172 | * Property Name and ID Definitions␊ |
173 | * (Applies to all Properties Regardless of NameSpace)␊ |
174 | */␊ |
175 | enum {␊ |
176 | kRegMaximumPropertyNameLength = 31, /* Max length of Property Name */␊ |
177 | kRegPropertyNameTerminator = 0x00 /* '\0' */␊ |
178 | };␊ |
179 | ␊ |
180 | typedef char RegPropertyNameBuf[32];␊ |
181 | typedef char RegPropertyName;␊ |
182 | typedef char * RegPropertyNamePtr;␊ |
183 | enum {␊ |
184 | kRegMaxPropertyNameLength = kRegMaximumPropertyNameLength␊ |
185 | };␊ |
186 | ␊ |
187 | /*******************************************************************************␊ |
188 | *␊ |
189 | * Iteration Operations␊ |
190 | *␊ |
191 | * These specify direction when traversing the name relationships␊ |
192 | */␊ |
193 | typedef UInt32 RegIterationOp;␊ |
194 | typedef RegIterationOp RegEntryIterationOp;␊ |
195 | enum {␊ |
196 | /* Absolute locations*/␊ |
197 | kRegIterRoot = 0x00000002, /* "Upward" Relationships */␊ |
198 | kRegIterParents = 0x00000003, /* include all parent(s) of entry */␊ |
199 | /* "Downward" Relationships*/␊ |
200 | kRegIterChildren = 0x00000004, /* include all children */␊ |
201 | kRegIterSubTrees = 0x00000005, /* include all sub trees of entry */␊ |
202 | kRegIterDescendants = 0x00000005, /* include all descendants of entry */␊ |
203 | /* "Horizontal" Relationships */␊ |
204 | kRegIterSibling = 0x00000006, /* include all siblings */␊ |
205 | /* Keep doing the same thing*/␊ |
206 | kRegIterContinue = 0x00000001␊ |
207 | };␊ |
208 | ␊ |
209 | /*******************************************************************************␊ |
210 | *␊ |
211 | * Name Entry and Property Modifiers␊ |
212 | *␊ |
213 | *␊ |
214 | *␊ |
215 | * Modifiers describe special characteristics of names␊ |
216 | * and properties. Modifiers might be supported for␊ |
217 | * some names and not others.␊ |
218 | * ␊ |
219 | * Device Drivers should not rely on functionality␊ |
220 | * specified as a modifier.␊ |
221 | */␊ |
222 | typedef UInt32 RegModifiers;␊ |
223 | typedef RegModifiers RegEntryModifiers;␊ |
224 | typedef RegModifiers RegPropertyModifiers;␊ |
225 | enum {␊ |
226 | kRegNoModifiers = 0x00000000, /* no entry modifiers in place */␊ |
227 | kRegUniversalModifierMask = 0x0000FFFF, /* mods to all entries */␊ |
228 | kRegNameSpaceModifierMask = 0x00FF0000, /* mods to all entries within namespace */␊ |
229 | kRegModifierMask = (RegModifiers)0xFF000000 /* mods to just this entry */␊ |
230 | };␊ |
231 | ␊ |
232 | /* Universal Property Modifiers */␊ |
233 | enum {␊ |
234 | kRegPropertyValueIsSavedToNVRAM = 0x00000020, /* property is non-volatile (saved in NVRAM) */␊ |
235 | kRegPropertyValueIsSavedToDisk = 0x00000040 /* property is non-volatile (saved on disk) */␊ |
236 | };␊ |
237 | ␊ |
238 | typedef size_t Size;␊ |
239 | ␊ |
240 | #ifndef _IOKIT_IOREGISTRYENTRY_H␊ |
241 | typedef struct IORegistryIterator IORegistryIterator;␊ |
242 | typedef struct OSIterator OSIterator;␊ |
243 | #endif /* _IOKIT_IOREGISTRYENTRY_H */␊ |
244 | typedef IORegistryIterator * RegEntryIter;␊ |
245 | typedef OSIterator * RegPropertyIter;␊ |
246 | ␊ |
247 | OSStatus RegistryEntryIDCopy( const RegEntryID * entryID, RegEntryID * to );␊ |
248 | ␊ |
249 | OSStatus RegistryEntryIDInit( RegEntryID * entryID );␊ |
250 | ␊ |
251 | Boolean RegistryEntryIDCompare( const RegEntryID * id1, const RegEntryID * id2);␊ |
252 | ␊ |
253 | OSStatus RegistryPropertyGetSize(␊ |
254 | const RegEntryID * entryID,␊ |
255 | const RegPropertyName * propertyName,␊ |
256 | RegPropertyValueSize * propertySize);␊ |
257 | ␊ |
258 | OSStatus RegistryPropertyGet(␊ |
259 | const RegEntryID * entryID,␊ |
260 | const RegPropertyName * propertyName,␊ |
261 | void * propertyValue,␊ |
262 | RegPropertyValueSize * propertySize);␊ |
263 | ␊ |
264 | OSStatus RegistryPropertyCreate(␊ |
265 | const RegEntryID * entryID,␊ |
266 | const RegPropertyName * propertyName,␊ |
267 | const void * propertyValue,␊ |
268 | RegPropertyValueSize propertySize);␊ |
269 | ␊ |
270 | OSStatus RegistryPropertyDelete(␊ |
271 | const RegEntryID * entryID,␊ |
272 | const RegPropertyName * propertyName);␊ |
273 | ␊ |
274 | OSStatus RegistryPropertySet(␊ |
275 | const RegEntryID * entryID,␊ |
276 | const RegPropertyName * propertyName,␊ |
277 | const void * propertyValue,␊ |
278 | RegPropertyValueSize propertySize);␊ |
279 | ␊ |
280 | OSStatus RegistryPropertyGetMod(␊ |
281 | const RegEntryID * entry,␊ |
282 | const RegPropertyName * name,␊ |
283 | RegPropertyModifiers * modifiers);␊ |
284 | ␊ |
285 | OSStatus RegistryPropertySetMod(␊ |
286 | const RegEntryID * entry,␊ |
287 | const RegPropertyName * name,␊ |
288 | RegPropertyModifiers modifiers);␊ |
289 | ␊ |
290 | OSStatus RegistryPropertyIterateCreate(␊ |
291 | const RegEntryID * entry,␊ |
292 | RegPropertyIter * cookie);␊ |
293 | ␊ |
294 | OSStatus RegistryPropertyIterateDispose( RegPropertyIter * cookie);␊ |
295 | ␊ |
296 | OSStatus RegistryPropertyIterate(␊ |
297 | RegPropertyIter * cookie,␊ |
298 | RegPropertyName * foundProperty,␊ |
299 | Boolean * done);␊ |
300 | ␊ |
301 | OSStatus RegistryEntryIterateCreate( RegEntryIter * cookie);␊ |
302 | ␊ |
303 | OSStatus RegistryEntryIterateDispose( RegEntryIter * cookie);␊ |
304 | ␊ |
305 | OSStatus RegistryEntryIterateSet( RegEntryIter * cookie,␊ |
306 | const RegEntryID * startEntryID);␊ |
307 | ␊ |
308 | OSStatus RegistryEntryIterate( RegEntryIter * cookie,␊ |
309 | RegEntryIterationOp relationship,␊ |
310 | RegEntryID * foundEntry,␊ |
311 | Boolean * done);␊ |
312 | ␊ |
313 | OSStatus RegistryCStrEntryToName( const RegEntryID * entryID,␊ |
314 | RegEntryID * parentEntry,␊ |
315 | RegCStrEntryName * nameComponent,␊ |
316 | Boolean * done );␊ |
317 | ␊ |
318 | OSStatus RegistryCStrEntryLookup( const RegEntryID * parentEntry,␊ |
319 | const RegCStrPathName * path,␊ |
320 | RegEntryID * newEntry);␊ |
321 | ␊ |
322 | OSStatus RegistryCStrEntryCreate( const RegEntryID * parentEntry,␊ |
323 | const RegCStrPathName * name,␊ |
324 | RegEntryID * newEntry);␊ |
325 | ␊ |
326 | OSStatus RegistryEntryDelete(const RegEntryID * entryID);␊ |
327 | ␊ |
328 | OSStatus RegistryEntryIDDispose(RegEntryID * entryID);␊ |
329 | ␊ |
330 | //␊ |
331 | ␊ |
332 | OSStatus RegistryEntryCopy(␊ |
333 | RegEntryID * parentEntryID,␊ |
334 | RegEntryID * sourceDevice,␊ |
335 | RegEntryID * destDevice);␊ |
336 | ␊ |
337 | OSStatus RegistryEntrySearch(␊ |
338 | RegEntryIter * cookie,␊ |
339 | RegEntryIterationOp relationship,␊ |
340 | RegEntryID * foundEntry,␊ |
341 | Boolean * done,␊ |
342 | const RegPropertyName * propertyName,␊ |
343 | const void * propertyValue,␊ |
344 | RegPropertyValueSize propertySize);␊ |
345 | ␊ |
346 | OSStatus RegistryEntryToPathSize(␊ |
347 | const RegEntryID * entryID,␊ |
348 | RegPathNameSize * pathSize);␊ |
349 | ␊ |
350 | OSStatus RegistryCStrEntryToPath(␊ |
351 | const RegEntryID * entryID,␊ |
352 | RegCStrPathName * pathName,␊ |
353 | RegPathNameSize pathSize);␊ |
354 | ␊ |
355 | OSStatus RegistryPropertyRename(␊ |
356 | const RegEntryID * entry,␊ |
357 | const RegPropertyName * oldName,␊ |
358 | const RegPropertyName * newName);␊ |
359 | ␊ |
360 | OSStatus RegistryEntryGetMod(␊ |
361 | const RegEntryID * entry,␊ |
362 | RegEntryModifiers * modifiers);␊ |
363 | ␊ |
364 | OSStatus RegistryEntrySetMod(␊ |
365 | const RegEntryID * entry,␊ |
366 | RegEntryModifiers modifiers);␊ |
367 | ␊ |
368 | OSStatus RegistryEntryMod(␊ |
369 | RegEntryIter * cookie,␊ |
370 | RegEntryIterationOp relationship,␊ |
371 | RegEntryID * foundEntry,␊ |
372 | Boolean * done,␊ |
373 | RegEntryModifiers matchingModifiers);␊ |
374 | ␊ |
375 | OSStatus RegistryEntryPropertyMod(␊ |
376 | RegEntryIter * cookie,␊ |
377 | RegEntryIterationOp relationship,␊ |
378 | RegEntryID * foundEntry,␊ |
379 | Boolean * done,␊ |
380 | RegPropertyModifiers matchingModifiers);␊ |
381 | ␊ |
382 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
383 | ␊ |
384 | void SynchronizeIO(void);␊ |
385 | ␊ |
386 | Boolean CompareAndSwap(␊ |
387 | UInt32 oldVvalue,␊ |
388 | UInt32 newValue,␊ |
389 | UInt32 * OldValueAdr);␊ |
390 | ␊ |
391 | UInt32 CStrLen(const char * src);␊ |
392 | ␊ |
393 | char * CStrCopy( char * dst, const char * src);␊ |
394 | ␊ |
395 | SInt16 CStrCmp(␊ |
396 | const char * s1,␊ |
397 | const char * s2);␊ |
398 | ␊ |
399 | char * CStrCat(␊ |
400 | char * dst,␊ |
401 | const char * src);␊ |
402 | char * CStrNCopy(␊ |
403 | char * dst,␊ |
404 | const char * src,␊ |
405 | UInt32 max);␊ |
406 | SInt16 CStrNCmp(␊ |
407 | const char * s1,␊ |
408 | const char * s2,␊ |
409 | UInt32 max);␊ |
410 | char * CStrNCat(␊ |
411 | char * dst,␊ |
412 | const char * src,␊ |
413 | UInt32 max);␊ |
414 | ␊ |
415 | void BlockCopy(␊ |
416 | const void * srcPtr,␊ |
417 | void * destPtr,␊ |
418 | Size byteCount);␊ |
419 | void BlockMove(␊ |
420 | const void * srcPtr,␊ |
421 | void * destPtr,␊ |
422 | Size byteCount);␊ |
423 | void BlockMoveData(␊ |
424 | const void * srcPtr,␊ |
425 | void * destPtr,␊ |
426 | Size byteCount);␊ |
427 | void BlockMoveDataUncached(␊ |
428 | const void * srcPtr,␊ |
429 | void * destPtr,␊ |
430 | Size byteCount);␊ |
431 | void BlockMoveUncached(␊ |
432 | const void * srcPtr,␊ |
433 | void * destPtr,␊ |
434 | Size byteCount);␊ |
435 | void BlockZero(␊ |
436 | const void * srcPtr,␊ |
437 | Size byteCount);␊ |
438 | void BlockZeroUncached(␊ |
439 | const void * srcPtr,␊ |
440 | Size byteCount);␊ |
441 | ␊ |
442 | char * PStrCopy( char *to, const char *from );␊ |
443 | ␊ |
444 | void PStrToCStr( char *to, const char *from );␊ |
445 | ␊ |
446 | void CStrToPStr( char *to, const char *from );␊ |
447 | ␊ |
448 | LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear);␊ |
449 | ␊ |
450 | OSStatus PoolDeallocate( LogicalAddress address );␊ |
451 | ␊ |
452 | UInt32 CurrentExecutionLevel(void);␊ |
453 | ␊ |
454 | UnsignedWide UpTime( void );␊ |
455 | ␊ |
456 | UnsignedWide AddAbsoluteToAbsolute(UnsignedWide left, UnsignedWide right);␊ |
457 | ␊ |
458 | UnsignedWide SubAbsoluteFromAbsolute(UnsignedWide left, UnsignedWide right);␊ |
459 | ␊ |
460 | UnsignedWide DurationToAbsolute( Duration theDuration);␊ |
461 | ␊ |
462 | UnsignedWide AddDurationToAbsolute( Duration duration, UnsignedWide absolute );␊ |
463 | ␊ |
464 | UnsignedWide NanosecondsToAbsolute ( UnsignedWide theNanoseconds);␊ |
465 | ␊ |
466 | UnsignedWide AbsoluteToNanoseconds( UnsignedWide absolute );␊ |
467 | ␊ |
468 | Duration AbsoluteDeltaToDuration( UnsignedWide left, UnsignedWide right );␊ |
469 | ␊ |
470 | Duration AbsoluteToDuration( UnsignedWide result );␊ |
471 | ␊ |
472 | OSStatus DelayForHardware( UnsignedWide time );␊ |
473 | ␊ |
474 | OSStatus DelayUntil( UnsignedWide time );␊ |
475 | ␊ |
476 | OSStatus DelayFor( Duration theDuration );␊ |
477 | ␊ |
478 | void SysDebugStr( const char * from );␊ |
479 | ␊ |
480 | void SysDebug( void );␊ |
481 | ␊ |
482 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
483 | ␊ |
484 | enum {␊ |
485 | paramErr = -50, /*error in user parameter list*/␊ |
486 | noHardwareErr = -200, /*Sound Manager Error Returns*/␊ |
487 | notEnoughHardwareErr = -201, /*Sound Manager Error Returns*/␊ |
488 | userCanceledErr = -128,␊ |
489 | qErr = -1, /*queue element not found during deletion*/␊ |
490 | vTypErr = -2, /*invalid queue element*/␊ |
491 | corErr = -3, /*core routine number out of range*/␊ |
492 | unimpErr = -4, /*unimplemented core routine*/␊ |
493 | SlpTypeErr = -5, /*invalid queue element*/␊ |
494 | seNoDB = -8, /*no debugger installed to handle debugger command*/␊ |
495 | controlErr = -17, /*I/O System Errors*/␊ |
496 | statusErr = -18, /*I/O System Errors*/␊ |
497 | readErr = -19, /*I/O System Errors*/␊ |
498 | writErr = -20, /*I/O System Errors*/␊ |
499 | badUnitErr = -21, /*I/O System Errors*/␊ |
500 | unitEmptyErr = -22, /*I/O System Errors*/␊ |
501 | openErr = -23, /*I/O System Errors*/␊ |
502 | closErr = -24, /*I/O System Errors*/␊ |
503 | dRemovErr = -25, /*tried to remove an open driver*/␊ |
504 | dInstErr = -26, /*DrvrInstall couldn't find driver in resources*/␊ |
505 | ␊ |
506 | badCksmErr = -69, /*addr mark checksum didn't check*/␊ |
507 | };␊ |
508 | enum {␊ |
509 | durationMicrosecond = -1, /* Microseconds are negative*/␊ |
510 | durationMillisecond = 1, /* Milliseconds are positive*/␊ |
511 | durationSecond = 1000, /* 1000 * durationMillisecond*/␊ |
512 | durationMinute = 60000, /* 60 * durationSecond,*/␊ |
513 | durationHour = 3600000, /* 60 * durationMinute,*/␊ |
514 | durationDay = 86400000, /* 24 * durationHour,*/␊ |
515 | durationNoWait = 0, /* don't block*/␊ |
516 | durationForever = 0x7FFFFFFF /* no time limit*/␊ |
517 | };␊ |
518 | #ifndef NULL␊ |
519 | #if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C))␊ |
520 | /* Symantec C compilers (but not C++) want NULL and nil to be (void*)0 */␊ |
521 | #define NULL ((void *) 0)␊ |
522 | #else␊ |
523 | /* in case int is 16-bits, make sure NULL is 32-bits */␊ |
524 | #define NULL 0L␊ |
525 | #endif␊ |
526 | #endif␊ |
527 | ␊ |
528 | #ifndef nil␊ |
529 | #define nil NULL␊ |
530 | #endif␊ |
531 | ␊ |
532 | typedef ResType VSLGestaltType;␊ |
533 | ␊ |
534 | enum {␊ |
535 | clutType = 0, /*0 if lookup table*/␊ |
536 | fixedType = 1, /*1 if fixed table*/␊ |
537 | directType = 2, /*2 if direct values*/␊ |
538 | RGBDirect = 16 /* 16 & 32 bits/pixel pixelType value */␊ |
539 | };␊ |
540 | typedef UInt32 * UInt32Ptr;␊ |
541 | ␊ |
542 | typedef struct IOHardwareCursorDescriptor HardwareCursorDescriptorRec;␊ |
543 | typedef HardwareCursorDescriptorRec * HardwareCursorDescriptorPtr;␊ |
544 | typedef struct IOHardwareCursorInfo HardwareCursorInfoRec;␊ |
545 | typedef HardwareCursorInfoRec * HardwareCursorInfoPtr;␊ |
546 | ␊ |
547 | typedef ResType InterruptServiceType;␊ |
548 | typedef struct _VSLService * InterruptServiceIDType;␊ |
549 | typedef InterruptServiceIDType * InterruptServiceIDPtr;␊ |
550 | ␊ |
551 | enum {␊ |
552 | kVBLInterruptServiceType = 'vbl ',␊ |
553 | kHBLInterruptServiceType = 'hbl ',␊ |
554 | kFrameInterruptServiceType = 'fram',␊ |
555 | kConnectInterruptServiceType = 'dci ', /* Renamed -- Use kFBCheckInterruptServiceType*/␊ |
556 | kFBConnectInterruptServiceType = kConnectInterruptServiceType, /* Demand to check configuration (Hardware unchanged)*/␊ |
557 | kFBChangedInterruptServiceType = 'chng', /* Demand to rebuild (Hardware has reinitialized on dependent change)*/␊ |
558 | kFBOfflineInterruptServiceType = 'remv', /* Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror)*/␊ |
559 | kFBOnlineInterruptServiceType = 'add ' /* Notice that hardware is available (after being removed)*/␊ |
560 | };␊ |
561 | ␊ |
562 | enum {␊ |
563 | kVSLClamshellStateGestaltType = 'clam',␊ |
564 | };␊ |
565 | ␊ |
566 | OSStatus␊ |
567 | VSLGestalt( VSLGestaltType selector, UInt32 * response );␊ |
568 | ␊ |
569 | OSStatus ␊ |
570 | VSLSetDisplayConfiguration(RegEntryID * entryID,␊ |
571 | RegPropertyName * propertyName,␊ |
572 | RegPropertyValue configData,␊ |
573 | RegPropertyValueSize configDataSize);␊ |
574 | OSErr␊ |
575 | VSLNewInterruptService(␊ |
576 | RegEntryID * serviceDevice,␊ |
577 | InterruptServiceType serviceType,␊ |
578 | InterruptServiceIDPtr serviceID);␊ |
579 | ␊ |
580 | OSErr␊ |
581 | VSLWaitOnInterruptService(␊ |
582 | InterruptServiceIDType serviceID,␊ |
583 | Duration timeout);␊ |
584 | ␊ |
585 | OSErr␊ |
586 | VSLDisposeInterruptService(InterruptServiceIDType serviceID);␊ |
587 | ␊ |
588 | OSErr␊ |
589 | VSLDoInterruptService(InterruptServiceIDType serviceID);␊ |
590 | ␊ |
591 | Boolean␊ |
592 | VSLPrepareCursorForHardwareCursor(␊ |
593 | void * cursorRef,␊ |
594 | IOHardwareCursorDescriptor * hardwareDescriptor,␊ |
595 | IOHardwareCursorInfo * hwCursorInfo);␊ |
596 | ␊ |
597 | typedef UnsignedWide Nanoseconds;␊ |
598 | enum {␊ |
599 | /* Version Release Stage Codes */␊ |
600 | developStage = 0x20,␊ |
601 | alphaStage = 0x40,␊ |
602 | betaStage = 0x60,␊ |
603 | finalStage = 0x80␊ |
604 | };␊ |
605 | ␊ |
606 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
607 | ␊ |
608 | typedef struct OpaqueIOCommandID* IOCommandID;␊ |
609 | ␊ |
610 | typedef UInt32 IOCommandKind;␊ |
611 | typedef UInt32 IOCommandCode;␊ |
612 | ␊ |
613 | OSErr IOCommandIsComplete( IOCommandID commandID, OSErr result);␊ |
614 | ␊ |
615 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */␊ |
616 | ␊ |
617 | #ifndef __IONDRV__␊ |
618 | typedef struct OpaqueInterruptSetID* InterruptSetID;␊ |
619 | #else␊ |
620 | typedef class IONDRVInterruptSet * InterruptSetID;␊ |
621 | #endif /* __IONDRV__ */␊ |
622 | ␊ |
623 | typedef long InterruptMemberNumber;␊ |
624 | struct InterruptSetMember {␊ |
625 | InterruptSetID setID;␊ |
626 | InterruptMemberNumber member;␊ |
627 | };␊ |
628 | typedef struct InterruptSetMember InterruptSetMember;␊ |
629 | enum {␊ |
630 | kISTChipInterruptSource = 0,␊ |
631 | kISTOutputDMAInterruptSource = 1,␊ |
632 | kISTInputDMAInterruptSource = 2,␊ |
633 | kISTPropertyMemberCount = 3␊ |
634 | };␊ |
635 | ␊ |
636 | typedef InterruptSetMember ISTProperty[3];␊ |
637 | #define kISTPropertyName "driver-ist" ␊ |
638 | ␊ |
639 | typedef long InterruptReturnValue;␊ |
640 | enum {␊ |
641 | kFirstMemberNumber = 1,␊ |
642 | kIsrIsComplete = 0,␊ |
643 | kIsrIsNotComplete = -1,␊ |
644 | kMemberNumberParent = -2␊ |
645 | };␊ |
646 | ␊ |
647 | typedef Boolean InterruptSourceState;␊ |
648 | enum {␊ |
649 | kSourceWasEnabled = true,␊ |
650 | kSourceWasDisabled = false␊ |
651 | };␊ |
652 | ␊ |
653 | typedef InterruptMemberNumber (*InterruptHandler) (InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount);␊ |
654 | typedef void (*InterruptEnabler) (InterruptSetMember ISTmember, void *refCon);␊ |
655 | typedef InterruptSourceState (*InterruptDisabler)(InterruptSetMember ISTmember, void *refCon);␊ |
656 | ␊ |
657 | enum {␊ |
658 | kReturnToParentWhenComplete = 0x00000001,␊ |
659 | kReturnToParentWhenNotComplete = 0x00000002␊ |
660 | };␊ |
661 | ␊ |
662 | typedef OptionBits InterruptSetOptions;␊ |
663 | ␊ |
664 | ␊ |
665 | OSStatus GetInterruptFunctions(␊ |
666 | InterruptSetID setID,␊ |
667 | InterruptMemberNumber member,␊ |
668 | void ** refCon,␊ |
669 | InterruptHandler * handlerFunction,␊ |
670 | InterruptEnabler * enableFunction,␊ |
671 | InterruptDisabler * disableFunction);␊ |
672 | ␊ |
673 | OSStatus InstallInterruptFunctions(␊ |
674 | InterruptSetID setID,␊ |
675 | InterruptMemberNumber member,␊ |
676 | void * refCon,␊ |
677 | InterruptHandler handlerFunction,␊ |
678 | InterruptEnabler enableFunction,␊ |
679 | InterruptDisabler disableFunction);␊ |
680 | ␊ |
681 | OSStatus CreateInterruptSet(␊ |
682 | InterruptSetID parentSet,␊ |
683 | InterruptMemberNumber parentMember,␊ |
684 | InterruptMemberNumber setSize,␊ |
685 | InterruptSetID * setID,␊ |
686 | InterruptSetOptions options);␊ |
687 | ␊ |
688 | OSStatus DeleteInterruptSet( InterruptSetID setID );␊ |
689 | ␊ |
690 | ␊ |
691 | #ifdef __cplusplus␊ |
692 | }␊ |
693 | #endif␊ |
694 | ␊ |
695 | #endif /* __IONDRVLIBRARIES__ */␊ |
696 | ␊ |
697 |