/* Returns the index of the next processor that is blocked. */
STATIC EFI_STATUS GetNextBlockedNumber(OUT UINTN *NextNumber)
/* Returns the index of the next processor that is blocked. */
STATIC EFI_STATUS GetNextBlockedNumber(OUT UINTN *NextNumber)
{
  UINTN        Index;
  CPU_STATE    State;
  CPU_AP_DATA  *CpuData;
  for (Index = 0; Index < mCpuMpData.NumberOfProcessors; Index++) {
    CpuData = &mCpuMpData.CpuData[Index];
    if (IsProcessorBSP (Index)) {
      continue;
    }
    State = CpuData->State;
    if (State == CpuStateBlocked) {
      *NextNumber = Index;
      return EFI_SUCCESS;
    }
  }
  return EFI_NOT_FOUND;
}