/* The counter can either count up by 1 or count down by 1. If the physical performance counter counts by a larger increment, then the counter values must be translated. The properties of the counter can be retrieved from  */
UINT64 EFIAPI GetPerformanceCounter(VOID)
/* The counter can either count up by 1 or count down by 1. If the physical performance counter counts by a larger increment, then the counter values must be translated. The properties of the counter can be retrieved from  */
UINT64 EFIAPI GetPerformanceCounter(VOID)
{
  EMU_THUNK_PPI       *ThunkPpi;
  EFI_STATUS          Status;
  EMU_THUNK_PROTOCOL  *Thunk;
  Status = PeiServicesLocatePpi (
             &gEmuThunkPpiGuid,
             0,
             NULL,
             (VOID **)&ThunkPpi
             );
  if (!EFI_ERROR (Status)) {
    Thunk = (EMU_THUNK_PROTOCOL *)ThunkPpi->Thunk ();
    return Thunk->QueryPerformanceCounter ();
  }
  return 0;
}