/* Determin the memory cache type for the Range. */
VOID DetermineMemoryCacheType(IN MTRR_MEMORY_CACHE_TYPE DefaultType, IN OUT MTRR_MEMORY_RANGE *Range, IN MTRR_MEMORY_RANGE *Ranges, IN UINT32 RangeCount)
/* Determin the memory cache type for the Range. */
VOID DetermineMemoryCacheType(IN MTRR_MEMORY_CACHE_TYPE DefaultType, IN OUT MTRR_MEMORY_RANGE *Range, IN MTRR_MEMORY_RANGE *Ranges, IN UINT32 RangeCount)
{
  UINT32  Index;
  Range->Type = CacheInvalid;
  for (Index = 0; Index < RangeCount; Index++) {
    if (RangesOverlap (Range, &Ranges[Index], 1)) {
      if (Ranges[Index].Type < Range->Type) {
        Range->Type = Ranges[Index].Type;
      }
    }
  }
  if (Range->Type == CacheInvalid) {
    Range->Type = DefaultType;
  }
}