/* Generate random count of MTRRs for each cache type. */
VOID GenerateRandomMemoryTypeCombination(IN UINT32 TotalCount, OUT UINT32 *UcCount, OUT UINT32 *WtCount, OUT UINT32 *WbCount, OUT UINT32 *WpCount, OUT UINT32 *WcCount)
/* Generate random count of MTRRs for each cache type. */
VOID GenerateRandomMemoryTypeCombination(IN UINT32 TotalCount, OUT UINT32 *UcCount, OUT UINT32 *WtCount, OUT UINT32 *WbCount, OUT UINT32 *WpCount, OUT UINT32 *WcCount)
{
  UINTN   Index;
  UINT32  TotalMtrrCount;
  UINT32  *CountPerType[5];
  CountPerType[0] = UcCount;
  CountPerType[1] = WtCount;
  CountPerType[2] = WbCount;
  CountPerType[3] = WpCount;
  CountPerType[4] = WcCount;
  for (Index = 0; Index < ARRAY_SIZE (CountPerType); Index++) {
    *(CountPerType[Index]) = 0;
  }
  TotalMtrrCount = Random32 (1, TotalCount);
  for (Index = 0; Index < TotalMtrrCount; Index++) {
    (*(CountPerType[Random32 (0, ARRAY_SIZE (CountPerType) - 1)]))++;
  }
}