|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: File: DriverServices.h ! 27: ! 28: Contains: Driver Services Interfaces. ! 29: ! 30: Version: Technology: PowerSurge 1.0.2 ! 31: Release: Universal Interfaces 3.1 ! 32: ! 33: Copyright: � 1985-1998 by Apple Computer, Inc., all rights reserved ! 34: ! 35: Bugs?: Please include the the file and version information (from above) with ! 36: the problem description. Developers belonging to one of the Apple ! 37: developer programs can submit bug reports to: ! 38: ! 39: [email protected] ! 40: ! 41: */ ! 42: #ifndef __DRIVERSERVICES__ ! 43: #define __DRIVERSERVICES__ ! 44: ! 45: #ifndef __CONDITIONALMACROS__ ! 46: #include "conditionalmacros.h" ! 47: #endif ! 48: #ifndef __MACTYPES__ ! 49: #include "mactypes.h" ! 50: #endif ! 51: #ifndef __ERRORS__ ! 52: #include "errors.h" ! 53: #endif ! 54: #include "OSUtils.h" ! 55: #include "MachineExceptions.h" ! 56: /*naga ! 57: #ifndef __MACHINEEXCEPTIONS__ ! 58: #include "MachineExceptions.h ! 59: #endif ! 60: #ifndef __DEVICES__ ! 61: #include <Devices.h> ! 62: #endif ! 63: #ifndef __DRIVERSYNCHRONIZATION__ ! 64: #include <DriverSynchronization.h> ! 65: #endif ! 66: */ ! 67: ! 68: ! 69: #if PRAGMA_ONCE ! 70: #pragma once ! 71: #endif ! 72: ! 73: #ifdef __cplusplus ! 74: extern "C" { ! 75: #endif ! 76: ! 77: #if PRAGMA_IMPORT ! 78: #pragma import on ! 79: #endif ! 80: ! 81: #if PRAGMA_STRUCT_ALIGN ! 82: #pragma options align=power ! 83: #elif PRAGMA_STRUCT_PACKPUSH ! 84: #pragma pack(push, 2) ! 85: #elif PRAGMA_STRUCT_PACK ! 86: #pragma pack(2) ! 87: #endif ! 88: ! 89: /****************************************************************** ! 90: * ! 91: * Previously in Kernel.h ! 92: * ! 93: ******************************************************************/ ! 94: /* Kernel basics*/ ! 95: //naga ! 96: typedef int AddressSpaceID; ! 97: typedef int IOCommandID; ! 98: typedef struct OpaqueIOPreparationID* IOPreparationID; ! 99: typedef struct OpaqueSoftwareInterruptID* SoftwareInterruptID; ! 100: typedef struct OpaqueTaskID* TaskID; ! 101: typedef struct OpaqueTimerID* TimerID; ! 102: /* OrderedItem stuff*/ ! 103: typedef OSType OrderedItemService; ! 104: typedef OSType OrderedItemSignature; ! 105: ! 106: enum { ! 107: kMatchAnyOrderedItemService = FOUR_CHAR_CODE('****'), ! 108: kMatchAnyOrderedItemSignature = FOUR_CHAR_CODE('****'), ! 109: kDoNotMatchAnyOrderedItemService = FOUR_CHAR_CODE('----'), ! 110: kDoNotMatchAnyOrderedItemSignature = FOUR_CHAR_CODE('----') ! 111: }; ! 112: ! 113: ! 114: struct OrderedItemName { ! 115: OrderedItemService service; ! 116: OrderedItemSignature signature; ! 117: }; ! 118: typedef struct OrderedItemName OrderedItemName; ! 119: typedef OrderedItemName * OrderedItemNamePtr; ! 120: ! 121: typedef OptionBits OrderedItemOptions; ! 122: ! 123: enum { ! 124: kOrderedItemIsRightBefore = 0x00000001, ! 125: kOrderedItemIsRightAfter = 0x00000002 ! 126: }; ! 127: ! 128: ! 129: struct OrderRequirements { ! 130: OrderedItemOptions options; ! 131: OrderedItemName itemBefore; ! 132: OrderedItemName itemAfter; ! 133: }; ! 134: typedef struct OrderRequirements OrderRequirements; ! 135: typedef OrderRequirements * OrderRequirementsPtr; ! 136: /* Tasking*/ ! 137: ! 138: typedef UInt32 ExecutionLevel; ! 139: ! 140: enum { ! 141: kTaskLevel = 0, ! 142: kSoftwareInterruptLevel = 1, ! 143: kAcceptFunctionLevel = 2, ! 144: kKernelLevel = 3, ! 145: kSIHAcceptFunctionLevel = 4, ! 146: kSecondaryInterruptLevel = 5, ! 147: kHardwareInterruptLevel = 6 ! 148: }; ! 149: ! 150: typedef CALLBACK_API_C( void , SoftwareInterruptHandler )(void *p1, void *p2); ! 151: typedef CALLBACK_API_C( OSStatus , SecondaryInterruptHandler2 )(void *p1, void *p2); ! 152: #define kCurrentAddressSpaceID ((AddressSpaceID) -1) ! 153: ! 154: /* Memory System basics*/ ! 155: ! 156: struct LogicalAddressRange { ! 157: LogicalAddress address; ! 158: ByteCount count; ! 159: }; ! 160: typedef struct LogicalAddressRange LogicalAddressRange; ! 161: typedef LogicalAddressRange * LogicalAddressRangePtr; ! 162: ! 163: struct PhysicalAddressRange { ! 164: PhysicalAddress address; ! 165: ByteCount count; ! 166: }; ! 167: typedef struct PhysicalAddressRange PhysicalAddressRange; ! 168: typedef PhysicalAddressRange * PhysicalAddressRangePtr; ! 169: /* For PrepareMemoryForIO and CheckpointIO*/ ! 170: ! 171: typedef OptionBits IOPreparationOptions; ! 172: ! 173: enum { ! 174: kIOMultipleRanges = 0x00000001, ! 175: kIOLogicalRanges = 0x00000002, ! 176: kIOMinimalLogicalMapping = 0x00000004, ! 177: kIOShareMappingTables = 0x00000008, ! 178: kIOIsInput = 0x00000010, ! 179: kIOIsOutput = 0x00000020, ! 180: kIOCoherentDataPath = 0x00000040, ! 181: kIOTransferIsLogical = 0x00000080, ! 182: kIOClientIsUserMode = 0x00000080 ! 183: }; ! 184: ! 185: typedef OptionBits IOPreparationState; ! 186: ! 187: enum { ! 188: kIOStateDone = 0x00000001 ! 189: }; ! 190: ! 191: ! 192: enum { ! 193: kInvalidPageAddress = (-1) ! 194: }; ! 195: ! 196: ! 197: struct AddressRange { ! 198: void * base; ! 199: ByteCount length; ! 200: }; ! 201: typedef struct AddressRange AddressRange; ! 202: /* C's treatment of arrays and array pointers is atypical*/ ! 203: ! 204: typedef LogicalAddress * LogicalMappingTablePtr; ! 205: typedef PhysicalAddress * PhysicalMappingTablePtr; ! 206: typedef AddressRange * AddressRangeTablePtr; ! 207: ! 208: struct MultipleAddressRange { ! 209: ItemCount entryCount; ! 210: AddressRangeTablePtr rangeTable; ! 211: }; ! 212: typedef struct MultipleAddressRange MultipleAddressRange; ! 213: /* ! 214: Separate C definition so that union has a name. A future version of the interfacer ! 215: tool will allow a name (that gets thrown out in Pascal and Asm). ! 216: */ ! 217: ! 218: struct IOPreparationTable { ! 219: IOPreparationOptions options; ! 220: IOPreparationState state; ! 221: IOPreparationID preparationID; ! 222: AddressSpaceID addressSpace; ! 223: ByteCount granularity; ! 224: ByteCount firstPrepared; ! 225: ByteCount lengthPrepared; ! 226: ItemCount mappingEntryCount; ! 227: LogicalMappingTablePtr logicalMapping; ! 228: PhysicalMappingTablePtr physicalMapping; ! 229: union { ! 230: AddressRange range; ! 231: MultipleAddressRange multipleRanges; ! 232: } rangeInfo; ! 233: }; ! 234: typedef struct IOPreparationTable IOPreparationTable; ! 235: ! 236: typedef OptionBits IOCheckpointOptions; ! 237: ! 238: enum { ! 239: kNextIOIsInput = 0x00000001, ! 240: kNextIOIsOutput = 0x00000002, ! 241: kMoreIOTransfers = 0x00000004 ! 242: }; ! 243: ! 244: /* For SetProcessorCacheMode*/ ! 245: ! 246: typedef UInt32 ProcessorCacheMode; ! 247: ! 248: enum { ! 249: kProcessorCacheModeDefault = 0, ! 250: kProcessorCacheModeInhibited = 1, ! 251: kProcessorCacheModeWriteThrough = 2, ! 252: kProcessorCacheModeCopyBack = 3 ! 253: }; ! 254: ! 255: /* For GetPageInformation*/ ! 256: ! 257: ! 258: enum { ! 259: kPageInformationVersion = 1 ! 260: }; ! 261: ! 262: typedef UInt32 PageStateInformation; ! 263: ! 264: enum { ! 265: kPageIsProtected = 0x00000001, ! 266: kPageIsProtectedPrivileged = 0x00000002, ! 267: kPageIsModified = 0x00000004, ! 268: kPageIsReferenced = 0x00000008, ! 269: kPageIsLockedResident = 0x00000010, ! 270: kPageIsInMemory = 0x00000020, ! 271: kPageIsShared = 0x00000040, ! 272: kPageIsWriteThroughCached = 0x00000080, ! 273: kPageIsCopyBackCached = 0x00000100, ! 274: kPageIsLocked = kPageIsLockedResident, /* Deprecated*/ ! 275: kPageIsResident = kPageIsInMemory /* Deprecated*/ ! 276: }; ! 277: ! 278: struct PageInformation { ! 279: AreaID area; ! 280: ItemCount count; ! 281: PageStateInformation information[1]; ! 282: }; ! 283: typedef struct PageInformation PageInformation; ! 284: typedef PageInformation * PageInformationPtr; ! 285: ! 286: /* Tasks */ ! 287: EXTERN_API_C( ExecutionLevel ) ! 288: CurrentExecutionLevel (void); ! 289: ! 290: EXTERN_API_C( TaskID ) ! 291: CurrentTaskID (void); ! 292: ! 293: EXTERN_API_C( OSStatus ) ! 294: DelayFor (Duration delayDuration); ! 295: ! 296: EXTERN_API_C( Boolean ) ! 297: InPrivilegedMode (void); ! 298: ! 299: ! 300: /* Software Interrupts */ ! 301: EXTERN_API_C( OSStatus ) ! 302: CreateSoftwareInterrupt (SoftwareInterruptHandler handler, ! 303: TaskID task, ! 304: void * p1, ! 305: Boolean persistent, ! 306: SoftwareInterruptID * theSoftwareInterrupt); ! 307: ! 308: ! 309: EXTERN_API_C( OSStatus ) ! 310: SendSoftwareInterrupt (SoftwareInterruptID theSoftwareInterrupt, ! 311: void * p2); ! 312: ! 313: EXTERN_API_C( OSStatus ) ! 314: DeleteSoftwareInterrupt (SoftwareInterruptID theSoftwareInterrupt); ! 315: ! 316: //naga#if TARGET_OS_MAC ! 317: /* Secondary Interrupts */ ! 318: EXTERN_API_C( OSStatus ) ! 319: CallSecondaryInterruptHandler2 (SecondaryInterruptHandler2 theHandler, ! 320: ExceptionHandler exceptionHandler, ! 321: void * p1, ! 322: void * p2); ! 323: ! 324: EXTERN_API_C( OSStatus ) ! 325: QueueSecondaryInterruptHandler (SecondaryInterruptHandler2 theHandler, ! 326: ExceptionHandler exceptionHandler, ! 327: void * p1, ! 328: void * p2); ! 329: ! 330: //#endif /* TARGET_OS_MAC */ ! 331: ! 332: /* Timers */ ! 333: EXTERN_API_C( OSStatus ) ! 334: SetInterruptTimer (const AbsoluteTime * expirationTime, ! 335: SecondaryInterruptHandler2 handler, ! 336: void * p1, ! 337: TimerID * theTimer); ! 338: ! 339: EXTERN_API_C( OSStatus ) ! 340: CancelTimer (TimerID theTimer, ! 341: AbsoluteTime * timeRemaining); ! 342: ! 343: ! 344: /* I/O related Operations */ ! 345: EXTERN_API_C( OSStatus ) ! 346: PrepareMemoryForIO (IOPreparationTable * theIOPreparationTable); ! 347: ! 348: EXTERN_API_C( OSStatus ) ! 349: CheckpointIO (IOPreparationID theIOPreparation, ! 350: IOCheckpointOptions options); ! 351: ! 352: ! 353: /* Memory Operations */ ! 354: EXTERN_API_C( OSStatus ) ! 355: GetPageInformation (AddressSpaceID addressSpace, ! 356: ConstLogicalAddress base, ! 357: ItemCount requestedPages, ! 358: PBVersion version, ! 359: PageInformation * thePageInfo); ! 360: ! 361: /* Processor Cache Related */ ! 362: EXTERN_API_C( OSStatus ) ! 363: SetProcessorCacheMode (AddressSpaceID addressSpace, ! 364: ConstLogicalAddress base, ! 365: ByteCount length, ! 366: ProcessorCacheMode cacheMode); ! 367: ! 368: /****************************************************************** ! 369: * ! 370: * Was in DriverSupport.h or DriverServices.h ! 371: * ! 372: ******************************************************************/ ! 373: #define kAAPLDeviceLogicalAddress "AAPL,address" ! 374: ! 375: typedef LogicalAddress * DeviceLogicalAddressPtr; ! 376: ! 377: enum { ! 378: durationMicrosecond = -1L, /* Microseconds are negative*/ ! 379: durationMillisecond = 1L, /* Milliseconds are positive*/ ! 380: durationSecond = 1000L, /* 1000 * durationMillisecond*/ ! 381: durationMinute = 60000L, /* 60 * durationSecond,*/ ! 382: durationHour = 3600000L, /* 60 * durationMinute,*/ ! 383: durationDay = 86400000L, /* 24 * durationHour,*/ ! 384: durationNoWait = 0L, /* don't block*/ ! 385: durationForever = 0x7FFFFFFF /* no time limit*/ ! 386: }; ! 387: ! 388: ! 389: enum { ! 390: k8BitAccess = 0, /* access as 8 bit*/ ! 391: k16BitAccess = 1, /* access as 16 bit*/ ! 392: k32BitAccess = 2 /* access as 32 bit*/ ! 393: }; ! 394: ! 395: typedef UnsignedWide Nanoseconds; ! 396: ! 397: EXTERN_API_C( OSErr ) ! 398: IOCommandIsComplete (IOCommandID theID, ! 399: OSErr theResult); ! 400: /*naga ! 401: EXTERN_API_C( OSErr ) ! 402: GetIOCommandInfo (IOCommandID theID, ! 403: IOCommandContents * theContents, ! 404: IOCommandCode * theCommand, ! 405: IOCommandKind * theKind); ! 406: EXTERN_API_C( void ) ! 407: UpdateDeviceActivity (RegEntryID * deviceEntry); ! 408: naga */ ! 409: ! 410: EXTERN_API_C( void ) ! 411: BlockCopy (const void * srcPtr, ! 412: void * destPtr, ! 413: Size byteCount); ! 414: ! 415: EXTERN_API_C( LogicalAddress ) ! 416: PoolAllocateResident (ByteCount byteSize, ! 417: Boolean clear); ! 418: ! 419: EXTERN_API_C( OSStatus ) ! 420: PoolDeallocate (LogicalAddress address); ! 421: ! 422: ! 423: EXTERN_API_C( ByteCount ) ! 424: GetDataCacheLineSize (void); ! 425: ! 426: EXTERN_API_C( OSStatus ) ! 427: FlushProcessorCache (AddressSpaceID spaceID, ! 428: LogicalAddress base, ! 429: ByteCount length); ! 430: ! 431: EXTERN_API_C( LogicalAddress ) ! 432: MemAllocatePhysicallyContiguous (ByteCount byteSize, ! 433: Boolean clear); ! 434: ! 435: EXTERN_API_C( OSStatus ) ! 436: MemDeallocatePhysicallyContiguous (LogicalAddress address); ! 437: ! 438: ! 439: EXTERN_API_C( AbsoluteTime ) ! 440: UpTime (void); ! 441: ! 442: EXTERN_API_C( void ) ! 443: GetTimeBaseInfo (UInt32 * minAbsoluteTimeDelta, ! 444: UInt32 * theAbsoluteTimeToNanosecondNumerator, ! 445: UInt32 * theAbsoluteTimeToNanosecondDenominator, ! 446: UInt32 * theProcessorToAbsoluteTimeNumerator, ! 447: UInt32 * theProcessorToAbsoluteTimeDenominator); ! 448: ! 449: ! 450: EXTERN_API_C( Nanoseconds ) ! 451: AbsoluteToNanoseconds (AbsoluteTime absoluteTime); ! 452: ! 453: EXTERN_API_C( Duration ) ! 454: AbsoluteToDuration (AbsoluteTime absoluteTime); ! 455: ! 456: EXTERN_API_C( AbsoluteTime ) ! 457: NanosecondsToAbsolute (Nanoseconds nanoseconds); ! 458: ! 459: EXTERN_API_C( AbsoluteTime ) ! 460: DurationToAbsolute (Duration duration); ! 461: ! 462: EXTERN_API_C( AbsoluteTime ) ! 463: AddAbsoluteToAbsolute (AbsoluteTime absoluteTime1, ! 464: AbsoluteTime absoluteTime2); ! 465: ! 466: EXTERN_API_C( AbsoluteTime ) ! 467: SubAbsoluteFromAbsolute (AbsoluteTime leftAbsoluteTime, ! 468: AbsoluteTime rightAbsoluteTime); ! 469: ! 470: EXTERN_API_C( AbsoluteTime ) ! 471: AddNanosecondsToAbsolute (Nanoseconds nanoseconds, ! 472: AbsoluteTime absoluteTime); ! 473: ! 474: EXTERN_API_C( AbsoluteTime ) ! 475: AddDurationToAbsolute (Duration duration, ! 476: AbsoluteTime absoluteTime); ! 477: ! 478: EXTERN_API_C( AbsoluteTime ) ! 479: SubNanosecondsFromAbsolute (Nanoseconds nanoseconds, ! 480: AbsoluteTime absoluteTime); ! 481: ! 482: EXTERN_API_C( AbsoluteTime ) ! 483: SubDurationFromAbsolute (Duration duration, ! 484: AbsoluteTime absoluteTime); ! 485: ! 486: EXTERN_API_C( Nanoseconds ) ! 487: AbsoluteDeltaToNanoseconds (AbsoluteTime leftAbsoluteTime, ! 488: AbsoluteTime rightAbsoluteTime); ! 489: ! 490: EXTERN_API_C( Duration ) ! 491: AbsoluteDeltaToDuration (AbsoluteTime leftAbsoluteTime, ! 492: AbsoluteTime rightAbsoluteTime); ! 493: ! 494: EXTERN_API_C( Nanoseconds ) ! 495: DurationToNanoseconds (Duration theDuration); ! 496: ! 497: EXTERN_API_C( Duration ) ! 498: NanosecondsToDuration (Nanoseconds theNanoseconds); ! 499: ! 500: EXTERN_API_C( OSErr ) ! 501: PBQueueInit (QHdrPtr qHeader); ! 502: ! 503: EXTERN_API_C( OSErr ) ! 504: PBQueueCreate (QHdrPtr * qHeader); ! 505: ! 506: EXTERN_API_C( OSErr ) ! 507: PBQueueDelete (QHdrPtr qHeader); ! 508: ! 509: EXTERN_API_C( void ) ! 510: PBEnqueue (QElemPtr qElement, ! 511: QHdrPtr qHeader); ! 512: ! 513: EXTERN_API_C( OSErr ) ! 514: PBEnqueueLast (QElemPtr qElement, ! 515: QHdrPtr qHeader); ! 516: ! 517: EXTERN_API_C( OSErr ) ! 518: PBDequeue (QElemPtr qElement, ! 519: QHdrPtr qHeader); ! 520: ! 521: EXTERN_API_C( OSErr ) ! 522: PBDequeueFirst (QHdrPtr qHeader, ! 523: QElemPtr * theFirstqElem); ! 524: ! 525: EXTERN_API_C( OSErr ) ! 526: PBDequeueLast (QHdrPtr qHeader, ! 527: QElemPtr * theLastqElem); ! 528: ! 529: EXTERN_API_C( char *) ! 530: CStrCopy (char * dst, ! 531: const char * src); ! 532: ! 533: EXTERN_API_C( StringPtr ) ! 534: PStrCopy (StringPtr dst, ! 535: ConstStr255Param src); ! 536: ! 537: EXTERN_API_C( char *) ! 538: CStrNCopy (char * dst, ! 539: const char * src, ! 540: UInt32 max); ! 541: ! 542: EXTERN_API_C( StringPtr ) ! 543: PStrNCopy (StringPtr dst, ! 544: ConstStr255Param src, ! 545: UInt32 max); ! 546: ! 547: EXTERN_API_C( char *) ! 548: CStrCat (char * dst, ! 549: const char * src); ! 550: ! 551: EXTERN_API_C( StringPtr ) ! 552: PStrCat (StringPtr dst, ! 553: ConstStr255Param src); ! 554: ! 555: EXTERN_API_C( char *) ! 556: CStrNCat (char * dst, ! 557: const char * src, ! 558: UInt32 max); ! 559: ! 560: EXTERN_API_C( StringPtr ) ! 561: PStrNCat (StringPtr dst, ! 562: ConstStr255Param src, ! 563: UInt32 max); ! 564: ! 565: EXTERN_API_C( void ) ! 566: PStrToCStr (char * dst, ! 567: ConstStr255Param src); ! 568: ! 569: EXTERN_API_C( void ) ! 570: CStrToPStr (Str255 dst, ! 571: const char * src); ! 572: ! 573: EXTERN_API_C( SInt16 ) ! 574: CStrCmp (const char * s1, ! 575: const char * s2); ! 576: ! 577: EXTERN_API_C( SInt16 ) ! 578: PStrCmp (ConstStr255Param str1, ! 579: ConstStr255Param str2); ! 580: ! 581: EXTERN_API_C( SInt16 ) ! 582: CStrNCmp (const char * s1, ! 583: const char * s2, ! 584: UInt32 max); ! 585: ! 586: EXTERN_API_C( SInt16 ) ! 587: PStrNCmp (ConstStr255Param str1, ! 588: ConstStr255Param str2, ! 589: UInt32 max); ! 590: ! 591: EXTERN_API_C( UInt32 ) ! 592: CStrLen (const char * src); ! 593: ! 594: EXTERN_API_C( UInt32 ) ! 595: PStrLen (ConstStr255Param src); ! 596: ! 597: EXTERN_API_C( OSStatus ) ! 598: DeviceProbe (void * theSrc, ! 599: void * theDest, ! 600: UInt32 AccessType); ! 601: ! 602: EXTERN_API_C( OSStatus ) ! 603: DelayForHardware (AbsoluteTime absoluteTime); ! 604: ! 605: ! 606: ! 607: /****************************************************************** ! 608: * ! 609: * Was in Interrupts.h ! 610: * ! 611: ******************************************************************/ ! 612: /* Interrupt types */ ! 613: typedef struct OpaqueInterruptSetID* InterruptSetID; ! 614: typedef long InterruptMemberNumber; ! 615: ! 616: struct InterruptSetMember { ! 617: InterruptSetID setID; ! 618: InterruptMemberNumber member; ! 619: }; ! 620: typedef struct InterruptSetMember InterruptSetMember; ! 621: ! 622: enum { ! 623: kISTChipInterruptSource = 0, ! 624: kISTOutputDMAInterruptSource = 1, ! 625: kISTInputDMAInterruptSource = 2, ! 626: kISTPropertyMemberCount = 3 ! 627: }; ! 628: ! 629: ! 630: typedef InterruptSetMember ISTProperty[3]; ! 631: #define kISTPropertyName "driver-ist" ! 632: ! 633: typedef long InterruptReturnValue; ! 634: ! 635: enum { ! 636: kFirstMemberNumber = 1, ! 637: kIsrIsComplete = 0, ! 638: kIsrIsNotComplete = -1, ! 639: kMemberNumberParent = -2 ! 640: }; ! 641: ! 642: typedef Boolean InterruptSourceState; ! 643: ! 644: enum { ! 645: kSourceWasEnabled = true, ! 646: kSourceWasDisabled = false ! 647: }; ! 648: ! 649: ! 650: typedef CALLBACK_API_C( InterruptMemberNumber , InterruptHandler )(InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount); ! 651: typedef CALLBACK_API_C( void , InterruptEnabler )(InterruptSetMember ISTmember, void *refCon); ! 652: typedef CALLBACK_API_C( InterruptSourceState , InterruptDisabler )(InterruptSetMember ISTmember, void *refCon); ! 653: ! 654: enum { ! 655: kReturnToParentWhenComplete = 0x00000001, ! 656: kReturnToParentWhenNotComplete = 0x00000002 ! 657: }; ! 658: ! 659: typedef OptionBits InterruptSetOptions; ! 660: /* Interrupt Services */ ! 661: EXTERN_API_C( OSStatus ) ! 662: CreateInterruptSet (InterruptSetID parentSet, ! 663: InterruptMemberNumber parentMember, ! 664: InterruptMemberNumber setSize, ! 665: InterruptSetID * setID, ! 666: InterruptSetOptions options); ! 667: ! 668: ! 669: EXTERN_API_C( OSStatus ) ! 670: InstallInterruptFunctions (InterruptSetID setID, ! 671: InterruptMemberNumber member, ! 672: void * refCon, ! 673: InterruptHandler handlerFunction, ! 674: InterruptEnabler enableFunction, ! 675: InterruptDisabler disableFunction); ! 676: ! 677: ! 678: EXTERN_API_C( OSStatus ) ! 679: GetInterruptFunctions (InterruptSetID setID, ! 680: InterruptMemberNumber member, ! 681: void ** refCon, ! 682: InterruptHandler * handlerFunction, ! 683: InterruptEnabler * enableFunction, ! 684: InterruptDisabler * disableFunction); ! 685: ! 686: EXTERN_API_C( OSStatus ) ! 687: ChangeInterruptSetOptions (InterruptSetID setID, ! 688: InterruptSetOptions options); ! 689: ! 690: EXTERN_API_C( OSStatus ) ! 691: GetInterruptSetOptions (InterruptSetID setID, ! 692: InterruptSetOptions * options); ! 693: ! 694: void usb_BlockMoveData(void *src, void *tgt, UInt32 size); //naga added ! 695: OSStatus CompareAndSwap(UInt32,UInt32,UInt32 *); ! 696: ! 697: ! 698: #if PRAGMA_STRUCT_ALIGN ! 699: #pragma options align=reset ! 700: #elif PRAGMA_STRUCT_PACKPUSH ! 701: #pragma pack(pop) ! 702: #elif PRAGMA_STRUCT_PACK ! 703: #pragma pack() ! 704: #endif ! 705: ! 706: #ifdef PRAGMA_IMPORT_OFF ! 707: #pragma import off ! 708: #elif PRAGMA_IMPORT ! 709: #pragma import reset ! 710: #endif ! 711: ! 712: #ifdef __cplusplus ! 713: } ! 714: #endif ! 715: ! 716: #endif /* __DRIVERSERVICES__ */ ! 717:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.