/* Any task being executed by the AP will be aborted and the AP will be waiting for a new task in Wait-For-SIPI state. */
VOID ResetProcessorToIdleState(IN UINTN ProcessorNumber)
/* Any task being executed by the AP will be aborted and the AP will be waiting for a new task in Wait-For-SIPI state. */
VOID ResetProcessorToIdleState(IN UINTN ProcessorNumber)
{
  CPU_MP_DATA  *CpuMpData;
  CpuMpData = GetCpuMpData ();
  CpuMpData->InitFlag = ApInitReconfig;
  WakeUpAP (CpuMpData, FALSE, ProcessorNumber, NULL, NULL, TRUE);
  while (CpuMpData->FinishedCount < 1) {
    CpuPause ();
  }
  CpuMpData->InitFlag = ApInitDone;
  SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);
}