+struct IODMAMapSpecification
+{
+ uint64_t alignment;
+ IOService * device;
+ uint32_t options;
+ uint8_t numAddressBits;
+ uint8_t resvA[3];
+ uint32_t resvB[4];
+};
+
+struct IODMAMapPageList
+{
+ uint32_t pageOffset;
+ uint32_t pageListCount;
+ const upl_page_info_t * pageList;
+};
+
+// mapOptions for iovmMapMemory
+enum
+{
+ kIODMAMapReadAccess = 0x00000001,
+ kIODMAMapWriteAccess = 0x00000002,
+ kIODMAMapPhysicallyContiguous = 0x00000010,
+ kIODMAMapDeviceMemory = 0x00000020,
+ kIODMAMapPagingPath = 0x00000040,
+ kIODMAMapIdentityMap = 0x00000080,
+
+ kIODMAMapPageListFullyOccupied = 0x00000100,
+ kIODMAMapFixedAddress = 0x00000200,
+};
+
+#ifdef KERNEL_PRIVATE
+
+// Used for dmaCommandOperation communications for IODMACommand and mappers
+
+enum {
+ kIOMDWalkSegments = 0x01000000,
+ kIOMDFirstSegment = 1 | kIOMDWalkSegments,
+ kIOMDGetCharacteristics = 0x02000000,
+ kIOMDGetCharacteristicsMapped = 1 | kIOMDGetCharacteristics,
+ kIOMDDMAActive = 0x03000000,
+ kIOMDSetDMAActive = 1 | kIOMDDMAActive,
+ kIOMDSetDMAInactive = kIOMDDMAActive,
+ kIOMDAddDMAMapSpec = 0x04000000,
+ kIOMDDMAMap = 0x05000000,
+ kIOMDDMAUnmap = 0x06000000,
+ kIOMDDMACommandOperationMask = 0xFF000000,
+};
+struct IOMDDMACharacteristics {
+ UInt64 fLength;
+ UInt32 fSGCount;
+ UInt32 fPages;
+ UInt32 fPageAlign;
+ ppnum_t fHighestPage;
+ IODirection fDirection;
+ UInt8 fIsPrepared;
+};
+
+struct IOMDDMAMapArgs {
+ IOMapper * fMapper;
+ IODMACommand * fCommand;
+ IODMAMapSpecification fMapSpec;
+ uint64_t fOffset;
+ uint64_t fLength;
+ uint64_t fAlloc;
+ uint64_t fAllocLength;
+ uint8_t fMapContig;
+};
+
+struct IOMDDMAWalkSegmentArgs {
+ UInt64 fOffset; // Input/Output offset
+ UInt64 fIOVMAddr, fLength; // Output variables
+ UInt8 fMapped; // Input Variable, Require mapped IOVMA
+ UInt64 fMappedBase; // Input base of mapping
+};
+typedef UInt8 IOMDDMAWalkSegmentState[128];
+// fMapped:
+enum
+{
+ kIOMDDMAWalkMappedLocal = 2
+};
+
+#endif /* KERNEL_PRIVATE */
+