- if (highestMask && !IOMapper::gSystem)
- {
- IOMDDMACharacteristics mdSummary;
-
- bzero(&mdSummary, sizeof(mdSummary));
- IOReturn rtn = dmaCommandOperation(
- kIOMDGetCharacteristics,
- &mdSummary, sizeof(mdSummary));
- if (rtn)
- return false;
-
- if (mdSummary.fHighestPage)
- {
- ppnum_t highest;
- while (mdSummary.fHighestPage > (highest = gIOHighestAllocatedPage))
- {
- if (OSCompareAndSwap(highest, mdSummary.fHighestPage,
- (UInt32 *) &gIOHighestAllocatedPage))
- break;
- }
- lastIOAddr = ptoa_64(mdSummary.fHighestPage);
- }
- else
- lastIOAddr = ptoa_64(gIOLastPage);
-
- if (lastIOAddr != (lastIOAddr & highestMask))
- {
- if (kIOMemoryTypePhysical64 != (_flags & kIOMemoryTypeMask))
- {
- // flag a retry
- _internalFlags |= kInternalFlagRealloc;
- }
- return false;
- }
- }
-