Functions



getPhysicalSegments

Abstract: Generate a cpu natural physical scatter/gather list given a memory descriptor.
public:

virtual UInt32 getPhysicalSegments(IOMemoryDescriptor *descriptor, IOByteCount fromPosition, PhysicalSegment *segments, UInt32 maxSegments, UInt32 maxTransferSize = 0, IOByteCount *transferSize = 0) { return genPhysicalSegments(descriptor, fromPosition, segments, maxSegments, maxTransferSize, transferSize);

Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps $link IOMemoryCursor::genPhysicalSegments.

Parameters

NameDescription
descriptorIOMemoryDescriptor that describes the data associated with an I/O request.
fromPositionStarting location of the I/O within a memory descriptor.
segmentsPointer to an array of $link IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list.
maxSegmentsMaximum number of segments that can be written to segments array.
maxTransferSizeMaximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized.
transferSizePointer to a IOByteCount variable that can contain the total size of the transfer being described. Default to 0 indicating that no transfer size need be returned.
Result: If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned.

initWithSpecification

Abstract: Primary initialiser for the IONaturalMemoryCursor class.
public:

virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, IOPhysicalLength maxTransferSize, IOPhysicalLength alignment = 1);

Parameters

NameDescription
maxSegmentSizeMaximum allowable size for one segment. Defaults to 0.
maxTransferSizeMaximum size of an entire transfer. Default to 0 indicating no maximum.
alignmentAlligment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment.
Result: true if the inherited classes and this instance initialise successfully.

withSpecification

Abstract: Factory function to create and initialise an IONaturalMemoryCursor in one operation, see $link IONaturalMemoryCursor::initWithSpecification.
public:

static IONaturalMemoryCursor * withSpecification(IOPhysicalLength maxSegmentSize, IOPhysicalLength maxTransferSize, IOPhysicalLength alignment = 1);

Parameters

NameDescription
maxSegmentSizeMaximum allowable size for one segment. Defaults to 0.
maxTransferSizeMaximum size of an entire transfer. Default to 0 indicating no maximum.
alignmentAlligment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment.
Result: A new memory cursor if successfully created and initialised, 0 otherwise.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)