]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c
2 A non-functional instance of the Timer Library.
4 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/TimerLib.h>
11 #include <Library/DebugLib.h>
14 Stalls the CPU for at least the given number of microseconds.
16 Stalls the CPU for the number of microseconds specified by MicroSeconds.
18 @param MicroSeconds The minimum number of microseconds to delay.
20 @return The value of MicroSeconds inputted.
34 Stalls the CPU for at least the given number of nanoseconds.
36 Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
38 @param NanoSeconds The minimum number of nanoseconds to delay.
40 @return The value of NanoSeconds inputted.
54 Retrieves the current value of a 64-bit free running performance counter.
56 The counter can either count up by 1 or count down by 1. If the physical
57 performance counter counts by a larger increment, then the counter values
58 must be translated. The properties of the counter can be retrieved from
59 GetPerformanceCounterProperties().
61 @return The current value of the free running performance counter.
66 GetPerformanceCounter (
75 Retrieves the 64-bit frequency in Hz and the range of performance counter
78 If StartValue is not NULL, then the value that the performance counter starts
79 with immediately after is it rolls over is returned in StartValue. If
80 EndValue is not NULL, then the value that the performance counter end with
81 immediately before it rolls over is returned in EndValue. The 64-bit
82 frequency of the performance counter in Hz is always returned. If StartValue
83 is less than EndValue, then the performance counter counts up. If StartValue
84 is greater than EndValue, then the performance counter counts down. For
85 example, a 64-bit free running counter that counts up would have a StartValue
86 of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
87 that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
89 @param StartValue The value the performance counter starts with when it
91 @param EndValue The value that the performance counter ends with before
94 @return The frequency in Hz.
99 GetPerformanceCounterProperties (
100 OUT UINT64
*StartValue
, OPTIONAL
101 OUT UINT64
*EndValue OPTIONAL
110 Converts elapsed ticks of performance counter to time in nanoseconds.
112 This function converts the elapsed ticks of running performance counter to
113 time value in unit of nanoseconds.
115 @param Ticks The number of elapsed ticks of running performance counter.
117 @return The elapsed time in nanoseconds.
122 GetTimeInNanoSecond (