-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-addr64_t IOInterleavedMemoryDescriptor::getPhysicalSegment64(
- IOByteCount offset, IOByteCount * length )
-{
- //
- // 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.
- //
-
- addr64_t pa;
-
- assert(offset <= _length);
-
- for ( unsigned index = 0; index < _descriptorCount; index++ )
- {
- if ( offset < _descriptorLengths[index] )
- {
- pa = _descriptors[index]->getPhysicalSegment64(_descriptorOffsets[index] + offset, length);
- if ((_descriptorLengths[index] - offset) < *length) *length = _descriptorLengths[index] - offset;
- return pa;
- }
- offset -= _descriptorLengths[index];
- }
-
- if ( length ) *length = 0;
-
- return 0;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-IOPhysicalAddress IOInterleavedMemoryDescriptor::getPhysicalSegment(
- IOByteCount offset, IOByteCount * length )
-{
- //
- // 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.
- //
-
- IOPhysicalAddress pa;
-
- assert(offset <= _length);
-
- for ( unsigned index = 0; index < _descriptorCount; index++ )
- {
- if ( offset < _descriptorLengths[index] )
- {
- pa = _descriptors[index]->getPhysicalSegment(_descriptorOffsets[index] + offset, length);
- if ((_descriptorLengths[index] - offset) < *length) *length = _descriptorLengths[index] - offset;
- return pa;
- }
- offset -= _descriptorLengths[index];
- }
-
- if ( length ) *length = 0;
-
- return 0;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-IOPhysicalAddress IOInterleavedMemoryDescriptor::getSourceSegment(
- IOByteCount offset,
- IOByteCount * length )
-{
- //
- // 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.
- //
-
- IOPhysicalAddress pa;
-
- assert(offset <= _length);
-
- for ( unsigned index = 0; index < _descriptorCount; index++ )
- {
- if ( offset < _descriptorLengths[index] )
- {
- pa = _descriptors[index]->getSourceSegment(_descriptorOffsets[index] + offset, length);
- if ((_descriptorLengths[index] - offset) < *length) *length = _descriptorLengths[index] - offset;
- return pa;
- }
- offset -= _descriptorLengths[index];
- }
-
- if ( length ) *length = 0;
-
- return 0;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-void * IOInterleavedMemoryDescriptor::getVirtualSegment( IOByteCount /* offset */ ,
- IOByteCount * /* length */ )