18#define TICKS_PER_MICRO_SEC (ArmGenericTimerGetTimerFreq ()/1000000U)
35 TimerFreq = ArmGenericTimerGetTimerFreq ();
37 ASSERT (TimerFreq != 0);
57 UINT64 SystemCounterVal;
58 UINT64 PreviousSystemCounterVal;
59 UINT64 DeltaCounterVal;
73 PreviousSystemCounterVal = ArmGenericTimerGetSystemCount ();
76 while (TimerTicks64 > 0) {
77 SystemCounterVal = ArmGenericTimerGetSystemCount ();
79 DeltaCounterVal = (SystemCounterVal - PreviousSystemCounterVal)
82 TimerTicks64 -=
MIN (TimerTicks64, DeltaCounterVal);
83 PreviousSystemCounterVal = SystemCounterVal;
111 MicroSeconds = NanoSeconds / 1000;
112 MicroSeconds += ((NanoSeconds % 1000) == 0) ? 0 : 1;
137 return ArmGenericTimerGetSystemCount ();
166 OUT UINT64 *StartValue OPTIONAL,
167 OUT UINT64 *EndValue OPTIONAL
170 if (StartValue !=
NULL) {
172 *StartValue = (UINT64)0ULL;
175 if (EndValue !=
NULL) {
177 *EndValue = 0xFFFFFFFFFFFFFFFFUL;
180 return (UINT64)ArmGenericTimerGetTimerFreq ();
UINT64 EFIAPI GetPerformanceCounterProperties(OUT UINT64 *StartValue OPTIONAL, OUT UINT64 *EndValue OPTIONAL)
UINT64 EFIAPI GetTimeInNanoSecond(IN UINT64 Ticks)
STATIC UINTN EFIAPI GetPlatformTimerFreq()
UINT64 EFIAPI GetPerformanceCounter(VOID)
UINTN EFIAPI MicroSecondDelay(IN UINTN MicroSeconds)
UINTN EFIAPI NanoSecondDelay(IN UINTN NanoSeconds)
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
UINT64 EFIAPI MultU64x64(IN UINT64 Multiplicand, IN UINT64 Multiplier)
UINT64 EFIAPI DivU64x64Remainder(IN UINT64 Dividend, IN UINT64 Divisor, OUT UINT64 *Remainder OPTIONAL)