static bool OutputBig64(IODMACommand *target,
Segment64 seg, void *segs, UInt32 ind);
-/*! @defined kIODMACommandOutputLittle64
- @abstract Output little-endian Segment64 output segment function.
+/*! @defined kIODMACommandOutputBig64
+ @abstract Output big-endian Segment64 output segment function.
*/
#define kIODMACommandOutputBig64 (IODMACommand::OutputBig64)
static bool OutputLittle64(IODMACommand *target,
Segment64 seg, void *segs, UInt32 ind);
-/*! @defined kIODMACommandOutputBig64
- @abstract Output big-endian Segment64 output segment function.
+/*! @defined kIODMACommandOutputLittle64
+ @abstract Output little-endian Segment64 output segment function.
*/
#define kIODMACommandOutputLittle64 (IODMACommand::OutputLittle64)
/*! @function setMemoryDescriptor
@abstract Sets and resets the DMACommand's current memory descriptor
- @discussion The DMA command will configure itself based on the information that it finds in the memory descriptor. It looks for things like the direction of the memory descriptor and whether the current memory descriptor is already mapped into some IOMMU. As a programmer convenience it can also prepare the memory descriptor immediately. See prepare(). Note the IODMACommand is designed to used multiple times with a succession of memory descriptors, making the pooling of commands possible. It is an error though to attempt to reset a currently prepared() DMA command. Warning: This routine may block so never try to autoprepare an IODMACommand while in a gated context, i.e. one of the WorkLoops action call outs.
+ @discussion The DMA command will configure itself based on the information that it finds in the memory descriptor. It looks for things like the direction of the memory descriptor and whether the current memory descriptor is already mapped into some IOMMU. As a programmer convenience it can also prepare the DMA command immediately. See prepare(). Note the IODMACommand is designed to used multiple times with a succession of memory descriptors, making the pooling of commands possible. It is an error though to attempt to reset a currently prepared() DMA command. Warning: This routine may block so never try to autoprepare an IODMACommand while in a gated context, i.e. one of the WorkLoops action call outs.
@param mem A pointer to the current I/Os memory descriptor.
@param autoPrepare An optional boolean variable that will call the prepare() function automatically after the memory descriptor is processed. Defaults to true.
@result Returns kIOReturnSuccess, kIOReturnBusy if currently prepared, kIOReturnNoSpace if the length(mem) >= Maximum Transfer Size or the error codes returned by prepare() (qv).
UInt32 *numSegments)
{ return genIOVMSegments(offset, segments, numSegments); };
+ IOReturn
+ genIOVMSegments(SegmentFunction segmentFunction,
+ UInt64 *offsetP,
+ void *segmentsP,
+ UInt32 *numSegmentsP);
+
virtual void free();
private:
void *segments,
UInt32 segmentIndex);
- IOReturn genIOVMSegments(InternalSegmentFunction outSegFunc,
+ IOReturn genIOVMSegments(uint32_t op,
+ InternalSegmentFunction outSegFunc,
void *reference,
UInt64 *offsetP,
void *segmentsP,
static IOReturn clientOutputSegment(
void *reference, IODMACommand *target,
Segment64 segment, void *vSegList, UInt32 outSegIndex);
-
+
static IOReturn segmentOp(
void *reference,
IODMACommand *target,
Segment64 segment,
void *segments,
UInt32 segmentIndex);
- IOReturn IODMACommand::walkAll(UInt8 op);
+ IOReturn walkAll(UInt8 op);
public:
void *segments,
UInt32 segmentIndex);
+/*! @function getPreparedOffsetAndLength
+ @abstract Returns the offset and length into the target IOMemoryDescriptor of a prepared IODDMACommand.
+ @discussion If successfully prepared, returns the offset and length into the IOMemoryDescriptor. Will fail for an unprepared IODMACommand.
+ @param offset returns the starting offset in the memory descriptor the DMA command was prepared with. Pass NULL for don't care.
+ @param length returns the length in the memory descriptor the DMA command was prepared with. Pass NULL for don't care.
+ @result An IOReturn code. kIOReturnNotReady if the IODMACommand is not prepared. */
+
+ virtual IOReturn getPreparedOffsetAndLength(UInt64 * offset, UInt64 * length);
+
+ UInt8 getNumAddressBits(void);
+ UInt32 getAlignment(void);
+
private:
OSMetaClassDeclareReservedUsed(IODMACommand, 0);
OSMetaClassDeclareReservedUsed(IODMACommand, 1);
- OSMetaClassDeclareReservedUnused(IODMACommand, 2);
+ OSMetaClassDeclareReservedUsed(IODMACommand, 2);
OSMetaClassDeclareReservedUnused(IODMACommand, 3);
OSMetaClassDeclareReservedUnused(IODMACommand, 4);
OSMetaClassDeclareReservedUnused(IODMACommand, 5);