X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Omap35xxPkg%2FLibrary%2FOmap35xxTimerLib%2FTimerLib.c;h=a6f79ddd57f62ab07bf7f6059498bf2ab9355b9c;hp=652c47b6f61a8b737bf9c75feb8636bae83d8918;hb=7d976f279e49bc4897715e3c9c23781812341d51;hpb=ef1b70ff08ed956da52691f277635b3c2dc124a2 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); +}