diff options
Diffstat (limited to 'EmulatorPkg/Library/DxeCoreTimerLib/DxeCoreTimerLib.c')
-rw-r--r-- | EmulatorPkg/Library/DxeCoreTimerLib/DxeCoreTimerLib.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/EmulatorPkg/Library/DxeCoreTimerLib/DxeCoreTimerLib.c b/EmulatorPkg/Library/DxeCoreTimerLib/DxeCoreTimerLib.c index 513a5aaa7c..d14a2011b0 100644 --- a/EmulatorPkg/Library/DxeCoreTimerLib/DxeCoreTimerLib.c +++ b/EmulatorPkg/Library/DxeCoreTimerLib/DxeCoreTimerLib.c @@ -16,8 +16,6 @@ #include <Protocol/Timer.h>
-
-
/**
Stalls the CPU for at least the given number of microseconds.
@@ -31,13 +29,12 @@ UINTN
EFIAPI
MicroSecondDelay (
- IN UINTN MicroSeconds
+ IN UINTN MicroSeconds
)
{
return NanoSecondDelay (MicroSeconds * 1000);
}
-
/**
Stalls the CPU for at least the given number of nanoseconds.
@@ -51,14 +48,13 @@ MicroSecondDelay ( UINTN
EFIAPI
NanoSecondDelay (
- IN UINTN NanoSeconds
+ IN UINTN NanoSeconds
)
{
gEmuThunk->Sleep (NanoSeconds);
return NanoSeconds;
}
-
/**
Retrieves the current value of a 64-bit free running performance counter.
@@ -105,14 +101,14 @@ GetPerformanceCounter ( UINT64
EFIAPI
GetPerformanceCounterProperties (
- OUT UINT64 *StartValue OPTIONAL,
- OUT UINT64 *EndValue OPTIONAL
+ OUT UINT64 *StartValue OPTIONAL,
+ OUT UINT64 *EndValue OPTIONAL
)
{
-
if (StartValue != NULL) {
*StartValue = 0ULL;
}
+
if (EndValue != NULL) {
*EndValue = (UINT64)-1LL;
}
@@ -156,9 +152,9 @@ GetTimeInNanoSecond ( // Since 2^29 < 1,000,000,000 = 0x3B9ACA00 < 2^30, Remainder should < 2^(64-30) = 2^34,
// i.e. highest bit set in Remainder should <= 33.
//
- Shift = MAX (0, HighBitSet64 (Remainder) - 33);
- Remainder = RShiftU64 (Remainder, (UINTN) Shift);
- Frequency = RShiftU64 (Frequency, (UINTN) Shift);
+ Shift = MAX (0, HighBitSet64 (Remainder) - 33);
+ Remainder = RShiftU64 (Remainder, (UINTN)Shift);
+ Frequency = RShiftU64 (Frequency, (UINTN)Shift);
NanoSeconds += DivU64x64Remainder (MultU64x32 (Remainder, 1000000000u), Frequency, NULL);
return NanoSeconds;
|