/* Wait for all root PCI Hot Plug controller finished initializing. */
EFI_STATUS AllRootHPCInitialized(IN UINTN TimeoutInMicroSeconds)
/* Wait for all root PCI Hot Plug controller finished initializing. */
EFI_STATUS AllRootHPCInitialized(IN UINTN TimeoutInMicroSeconds)
{
  UINT32  Delay;
  UINTN   Index;
  Delay = (UINT32)((TimeoutInMicroSeconds / 30) + 1);
  do {
    for (Index = 0; Index < gPciRootHpcCount; Index++) {
      if (gPciRootHpcData[Index].Found && !gPciRootHpcData[Index].Initialized) {
        break;
      }
    }
    if (Index == gPciRootHpcCount) {
      return EFI_SUCCESS;
    }
    gBS->Stall (30);
    Delay--;
  } while (Delay > 0);
  return EFI_TIMEOUT;
}