Omap35xxPkg: add GetTimeInNanoSecond implementation

Commit a63be426f8 ("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>
This commit is contained in:
Leif Lindholm 2017-11-30 13:55:59 +00:00
parent ef1b70ff08
commit 7d976f279e
1 changed files with 24 additions and 0 deletions

View File

@ -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);
}