/* Adds the specified processor the list of failed processors. */
STATIC VOID AddProcessorToFailedList(UINTN ProcessorIndex, CPU_STATE ApState)
/* Adds the specified processor the list of failed processors. */
STATIC VOID AddProcessorToFailedList(UINTN ProcessorIndex, CPU_STATE ApState)
{
  UINTN    Index;
  BOOLEAN  Found;
  Found = FALSE;
  if ((mCpuMpData.FailedList == NULL) ||
      (ApState == CpuStateIdle) ||
      (ApState == CpuStateFinished) ||
      IsProcessorBSP (ProcessorIndex))
  {
    return;
  }
  for (Index = 0; Index < mCpuMpData.FailedListIndex; Index++) {
    if (mCpuMpData.FailedList[Index] == ProcessorIndex) {
      Found = TRUE;
      break;
    }
  }
  if (!Found) {
    mCpuMpData.FailedList[mCpuMpData.FailedListIndex++] = ProcessorIndex;
  }
}