genIOVMSegments

Generates a physical scatter/gather for the current DMA command

Declaration

virtual IOReturn genIOVMSegments(
 UInt64 *offset, 
 void *segments, 
 UInt32 *numSegments); 

Parameters

offset

input/output parameter, defines the starting and ending offset in the memory descriptor, relative to any offset passed to the prepare() method.

segments

Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction.

numSegments

Input/output parameter Number of segments that can fit in the segment array and returns number of segments generated.

Return Value

kIOReturnSuccess on success, kIOReturnOverrun if the memory descriptor is exhausted, kIOReturnMessageTooLarge if the output segment function's address bits has insufficient resolution for a segment, kIOReturnNotReady if the DMA command has not be prepared, kIOReturnBadArgument if the DMA command doesn't have a memory descriptor yet or some of the parameters are NULL and kIOReturnNotReady if the DMA command is not prepared.

Overview

Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. The constraints that are set during initialisation will be respected. This function maintains the state across multiple calls for efficiency. However the state is discarded if the new offset is not the expected one.

See Also

Miscellaneous

- clearMemoryDescriptor

Clears the DMACommand's current memory descriptor

- cloneCommand

Creates a new command based on the specification of the current one.

- complete

Complete processing of DMA mappings after an I/O transfer is finished.

- gen32IOVMSegments

Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost32, kIODMACommandOutputBig32, or kIODMACommandOutputLittle32. If the output function of the IODMACommand is not a 32 bit function, results will be incorrect.

- gen64IOVMSegments

Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost64, kIODMACommandOutputBig64, or kIODMACommandOutputLittle64. If the output function of the IODMACommand is not a 64 bit function, results will be incorrect.

- getMemoryDescriptor

Get the current memory descriptor

- getPreparedOffsetAndLength

Returns the offset and length into the target IOMemoryDescriptor of a prepared IODDMACommand.

- initWithSpecification

Primary initializer for the IODMACommand class.

- OutputBig32

Output big-endian Segment32 output segment function.

- OutputBig64

Output big-endian Segment64 output segment function.

- OutputHost32

Output host natural Segment32 output segment function.

- OutputHost64

Output host natural Segment64 output segment function.

- OutputLittle32

Output little-endian Segment32 output segment function.

- OutputLittle64

Output little-endian Segment64 output segment function.

- prepare

Prepare the memory for an I/O transfer.

- prepareWithSpecification

Prepare the memory for an I/O transfer with a new specification.

- readBytes

Copy data from the IODMACommand's buffer to the specified buffer.

- setMemoryDescriptor

Sets and resets the DMACommand's current memory descriptor

- synchronize

Bring IOMemoryDescriptor and IODMACommand buffers into sync.

- weakWithSpecification

Creates and initialises an IODMACommand in one operation if this version of the operating system supports it.

- withSpecification

Creates and initializes an IODMACommand in one operation.

- writeBytes

Copy data to the IODMACommand's buffer from the specified buffer.