/* Check if the SMM AP Sync timer is timeout. */
BOOLEAN EFIAPI IsSyncTimerTimeout(IN UINT64 Timer)
/* Check if the SMM AP Sync timer is timeout. */
BOOLEAN EFIAPI IsSyncTimerTimeout(IN UINT64 Timer)
{
  UINT64  CurrentTimer;
  UINT64  Delta;
  CurrentTimer = GetPerformanceCounter ();
  if (mCountDown) {
    if (CurrentTimer <= Timer) {
      Delta = Timer - CurrentTimer;
    } else {
      Delta = mCycle - (CurrentTimer - Timer) + 1;
    }
  } else {
    if (CurrentTimer >= Timer) {
      Delta = CurrentTimer - Timer;
    } else {
      Delta = mCycle - (Timer - CurrentTimer) + 1;
    }
  }
  return (BOOLEAN)(Delta >= mTimeoutTicker);
}