-// Used for dedicated communications for IODMACommand
-enum {
- kIOMDWalkSegments = 0x00000001,
- kIOMDFirstSegment = 0x00000002 | kIOMDWalkSegments,
- kIOMDGetCharacteristics = 0x00000004,
- kIOMDLastDMACommandOperation
+#define __IODEQUALIFY(type, expr) \
+ ({ typeof(expr) expr_ = (type)(uintptr_t)(expr); \
+ (type)(uintptr_t)(expr_); })
+
+
+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 fLocalMapperAllocValid;
+ UInt8 fIOVMAddrValid;
+ UInt8 fForceDoubleBuffer;
+ UInt8 fSetActiveNoMapper;
+
+ vm_page_t fCopyPageAlloc;
+ vm_page_t fCopyNext;
+ vm_page_t fNextRemapPage;
+
+ ppnum_t fCopyPageCount;
+
+ uint64_t fLocalMapperAlloc;
+ uint64_t fLocalMapperAllocLength;
+
+ class IOBufferMemoryDescriptor * fCopyMD;
+
+ IOService * fDevice;
+
+ // IODMAEventSource use
+ IOReturn fStatus;
+ UInt64 fActualByteCount;
+ AbsoluteTime fTimeStamp;
+};
+
+struct IOMemoryDescriptorDevicePager {
+ void * devicePager;
+ unsigned int pagerContig:1;
+ unsigned int unused:31;
+ IOMemoryDescriptor * memory;