/* The function is invoked after SMBASE relocation in S3 path. It restores configuration according to data saved by normal boot path for both BSP and APs. */
VOID InitializeCpuAfterRebase(IN BOOLEAN IsBsp)
/* The function is invoked after SMBASE relocation in S3 path. It restores configuration according to data saved by normal boot path for both BSP and APs. */
VOID InitializeCpuAfterRebase(IN BOOLEAN IsBsp)
{
  UINTN  TopOfStack;
  UINT8  Stack[128];
  SetRegister (FALSE);
  if (mSmmS3ResumeState->MpService2Ppi == 0) {
    if (IsBsp) {
      while (mNumberToFinish > 0) {
        CpuPause ();
      }
    } else {
      TopOfStack  = (UINTN)Stack + sizeof (Stack);
      TopOfStack &= ~(UINTN)(CPU_STACK_ALIGNMENT - 1);
      CopyMem ((VOID *)(UINTN)mApHltLoopCode, mApHltLoopCodeTemplate, sizeof (mApHltLoopCodeTemplate));
      TransferApToSafeState ((UINTN)mApHltLoopCode, TopOfStack, (UINTN)&mNumberToFinish);
    }
  }
}