/* Note: This function is blocking mode, and it will return only after the number of APs released by calling  */
VOID EFIAPI SmmCpuSyncWaitForAPs(IN OUT SMM_CPU_SYNC_CONTEXT *Context, IN UINTN NumberOfAPs, IN UINTN BspIndex)
/* Note: This function is blocking mode, and it will return only after the number of APs released by calling  */
VOID EFIAPI SmmCpuSyncWaitForAPs(IN OUT SMM_CPU_SYNC_CONTEXT *Context, IN UINTN NumberOfAPs, IN UINTN BspIndex)
{
  UINTN  Arrived;
  ASSERT (Context != NULL);
  ASSERT (NumberOfAPs < Context->NumberOfCpus);
  ASSERT (BspIndex < Context->NumberOfCpus);
  for (Arrived = 0; Arrived < NumberOfAPs; Arrived++) {
    InternalWaitForSemaphore (Context->CpuSem[BspIndex].Run);
  }
}