diff options
author | Leif Lindholm <leif.lindholm@linaro.org> | 2017-11-30 13:55:59 +0000 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2017-11-30 14:32:30 +0000 |
commit | 7d976f279e49bc4897715e3c9c23781812341d51 (patch) | |
tree | a9bbafbccaceb3cf2001356adbb96029f67b6db7 /Omap35xxPkg | |
parent | ef1b70ff08ed956da52691f277635b3c2dc124a2 (diff) | |
download | edk2-7d976f279e49bc4897715e3c9c23781812341d51.tar.gz edk2-7d976f279e49bc4897715e3c9c23781812341d51.tar.bz2 edk2-7d976f279e49bc4897715e3c9c23781812341d51.zip |
Omap35xxPkg: add GetTimeInNanoSecond implementation
Commit a63be426f8e3 ("ArmPlatformPkg: Store initial timer value") caused
BeagleBoard to stop building, due to Omap35xxTimerLib lacking an
implementation of GetTimeInNanoSecond (). So add one.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'Omap35xxPkg')
-rw-r--r-- | Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c b/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c index 652c47b6f6..a6f79ddd57 100644 --- a/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c +++ b/Omap35xxPkg/Library/Omap35xxTimerLib/TimerLib.c @@ -131,3 +131,27 @@ GetPerformanceCounterProperties ( return PcdGet64(PcdEmbeddedPerformanceCounterFrequencyInHz);
}
+
+/**
+ Converts elapsed ticks of performance counter to time in nanoseconds.
+
+ This function converts the elapsed ticks of running performance counter to
+ time value in unit of nanoseconds.
+
+ @param Ticks The number of elapsed ticks of running performance counter.
+
+ @return The elapsed time in nanoseconds.
+
+**/
+UINT64
+EFIAPI
+GetTimeInNanoSecond (
+ IN UINT64 Ticks
+ )
+{
+ UINT32 Period;
+
+ Period = PcdGet32 (PcdEmbeddedPerformanceCounterPeriodInNanoseconds);
+
+ return (Ticks * Period);
+}
|