/* This service switches the requested AP to be the BSP since the next SMI. */
EFI_STATUS EFIAPI SmmSwitchBsp(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN UINTN ProcessorNumber)
/* This service switches the requested AP to be the BSP since the next SMI. */
EFI_STATUS EFIAPI SmmSwitchBsp(IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL *This, IN UINTN ProcessorNumber)
{
  if (ProcessorNumber >= mMaxNumberOfCpus) {
    return EFI_INVALID_PARAMETER;
  }
  if (gSmmCpuPrivate->ProcessorInfo[ProcessorNumber].ProcessorId == INVALID_APIC_ID) {
    return EFI_NOT_FOUND;
  }
  if ((gSmmCpuPrivate->Operation[ProcessorNumber] != SmmCpuNone) ||
      (gSmst->CurrentlyExecutingCpu == ProcessorNumber))
  {
    return EFI_UNSUPPORTED;
  }
  gSmmCpuPrivate->Operation[ProcessorNumber] = SmmCpuSwitchBsp;
  return EFI_SUCCESS;
}