+// Used for dedicated communications for IODMACommand
+enum {
+ kIOMDWalkSegments = 0x00000001,
+ kIOMDFirstSegment = 0x00000002 | kIOMDWalkSegments,
+ kIOMDGetCharacteristics = 0x00000004,
+ kIOMDSetDMAActive = 0x00000005,
+ kIOMDSetDMAInactive = 0x00000006,
+ kIOMDLastDMACommandOperation
+};
+struct IOMDDMACharacteristics {
+ UInt64 fLength;
+ UInt32 fSGCount;
+ UInt32 fPages;
+ UInt32 fPageAlign;
+ ppnum_t fHighestPage;
+ IODirection fDirection;
+ UInt8 fIsMapped, fIsPrepared;
+};
+struct IOMDDMAWalkSegmentArgs {
+ UInt64 fOffset; // Input/Output offset
+ UInt64 fIOVMAddr, fLength; // Output variables
+ UInt8 fMapped; // Input Variable, Require mapped IOVMA
+};
+typedef UInt8 IOMDDMAWalkSegmentState[128];
+
+struct IODMACommandInternal
+{
+ IOMDDMAWalkSegmentState fState;
+ IOMDDMACharacteristics fMDSummary;
+
+ UInt64 fPreparedOffset;
+ UInt64 fPreparedLength;
+
+ UInt32 fSourceAlignMask;
+
+ UInt8 fCursor;
+ UInt8 fCheckAddressing;
+ UInt8 fIterateOnly;
+ UInt8 fMisaligned;
+ UInt8 fMapContig;
+ UInt8 fPrepared;
+ UInt8 fDoubleBuffer;
+ UInt8 fNewMD;
+ UInt8 fLocalMapper;
+
+ ppnum_t fCopyMapperPageAlloc;
+ ppnum_t fCopyPageCount;
+ ppnum_t fNextRemapIndex;
+ addr64_t fCopyNext;
+
+ ppnum_t fLocalMapperPageAlloc;
+ ppnum_t fLocalMapperPageCount;
+
+ class IOBufferMemoryDescriptor * fCopyMD;
+
+ // IODMAEventSource use
+ IOReturn fStatus;
+ UInt64 fActualByteCount;
+};
+
+extern "C" struct timeval gIOLastSleepTime;
+extern "C" struct timeval gIOLastWakeTime;
+
+extern "C" void IOKitResetTime( void );
+extern "C" void IOKitInitializeTime( void );
+
+extern "C" OSString * IOCopyLogNameForPID(int pid);
+