+/*! @function initWithOptions
+ @abstract Master initialiser for all variants of memory descriptors. For a more complete description see IOMemoryDescriptor::withOptions.
+ @discussion Note this function can be used to re-init a previously created memory descriptor.
+ @result true on success, false on failure. */
+ virtual bool initWithOptions(void * buffers,
+ UInt32 count,
+ UInt32 offset,
+ task_t task,
+ IOOptionBits options,
+ IOMapper * mapper = kIOMapperSystem);
+
+#ifndef __LP64__
+ virtual addr64_t getPhysicalSegment64( IOByteCount offset,
+ IOByteCount * length ) APPLE_KEXT_DEPRECATED; /* use getPhysicalSegment() and kIOMemoryMapperNone instead */
+#endif /* !__LP64__ */
+
+/*! @function setPurgeable
+ @abstract Control the purgeable status of a memory descriptors memory.
+ @discussion Buffers may be allocated with the ability to have their purgeable status changed - IOBufferMemoryDescriptor with the kIOMemoryPurgeable option, VM_FLAGS_PURGEABLE may be passed to vm_allocate() in user space to allocate such buffers. The purgeable status of such a buffer may be controlled with setPurgeable(). The process of making a purgeable memory descriptor non-volatile and determining its previous state is atomic - if a purgeable memory descriptor is made nonvolatile and the old state is returned as kIOMemoryPurgeableVolatile, then the memory's previous contents are completely intact and will remain so until the memory is made volatile again. If the old state is returned as kIOMemoryPurgeableEmpty then the memory was reclaimed while it was in a volatile state and its previous contents have been lost.
+ @param newState - the desired new purgeable state of the memory:<br>
+ kIOMemoryPurgeableKeepCurrent - make no changes to the memory's purgeable state.<br>
+ kIOMemoryPurgeableVolatile - make the memory volatile - the memory may be reclaimed by the VM system without saving its contents to backing store.<br>
+ kIOMemoryPurgeableNonVolatile - make the memory nonvolatile - the memory is treated as with usual allocations and must be saved to backing store if paged.<br>
+ kIOMemoryPurgeableEmpty - make the memory volatile, and discard any pages allocated to it.
+ @param oldState - if non-NULL, the previous purgeable state of the memory is returned here:<br>
+ kIOMemoryPurgeableNonVolatile - the memory was nonvolatile.<br>
+ kIOMemoryPurgeableVolatile - the memory was volatile but its content has not been discarded by the VM system.<br>
+ kIOMemoryPurgeableEmpty - the memory was volatile and has been discarded by the VM system.<br>
+ @result An IOReturn code. */
+
+ virtual IOReturn setPurgeable( IOOptionBits newState,
+ IOOptionBits * oldState );
+
+/*! @function performOperation
+ @abstract Perform an operation on the memory descriptor's memory.
+ @discussion This method performs some operation on a range of the memory descriptor's memory. When a memory descriptor's memory is not mapped, it should be more efficient to use this method than mapping the memory to perform the operation virtually.
+ @param options The operation to perform on the memory:<br>
+ kIOMemoryIncoherentIOFlush - pass this option to store to memory and flush any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared.<br>
+ kIOMemoryIncoherentIOStore - pass this option to store to memory any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared.
+ @param offset A byte offset into the memory descriptor's memory.
+ @param length The length of the data range.
+ @result An IOReturn code. */
+
+ virtual IOReturn performOperation( IOOptionBits options,
+ IOByteCount offset, IOByteCount length );
+
+ // Used for dedicated communications for IODMACommand
+ virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const;
+
+/*! @function getPhysicalSegment
+ @abstract Break a memory descriptor into its physically contiguous segments.
+ @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset.
+ @param offset A byte offset into the memory whose physical address to return.
+ @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset.
+ @result A physical address, or zero if the offset is beyond the length of the memory. */
+
+#ifdef __LP64__
+ virtual addr64_t getPhysicalSegment( IOByteCount offset,
+ IOByteCount * length,
+ IOOptionBits options = 0 ) = 0;
+#else /* !__LP64__ */
+ virtual addr64_t getPhysicalSegment( IOByteCount offset,
+ IOByteCount * length,
+ IOOptionBits options );
+#endif /* !__LP64__ */
+
+ virtual uint64_t getPreparationID( void );
+ void setPreparationID( void );
+
+#ifdef XNU_KERNEL_PRIVATE
+ IOMemoryDescriptorReserved * getKernelReserved( void );
+ IOReturn dmaMap(
+ IOMapper * mapper,
+ const IODMAMapSpecification * mapSpec,
+ uint64_t offset,
+ uint64_t length,
+ uint64_t * address,
+ ppnum_t * mapPages);
+#endif
+