]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | A non-functional instance of the Timer Library.\r | |
3 | \r | |
b9610b9c | 4 | Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
e1f414b6 | 6 | \r |
e1f414b6 | 7 | **/\r |
8 | \r | |
c7d265a9 | 9 | #include <Base.h>\r |
c7d265a9 | 10 | #include <Library/TimerLib.h>\r |
11 | #include <Library/DebugLib.h>\r | |
e1f414b6 | 12 | \r |
13 | /**\r | |
71871514 | 14 | Stalls the CPU for at least the given number of microseconds.\r |
15 | \r | |
e1f414b6 | 16 | Stalls the CPU for the number of microseconds specified by MicroSeconds.\r |
17 | \r | |
18 | @param MicroSeconds The minimum number of microseconds to delay.\r | |
19 | \r | |
8cefc2ee | 20 | @return The value of MicroSeconds inputted.\r |
e1f414b6 | 21 | \r |
22 | **/\r | |
23 | UINTN\r | |
24 | EFIAPI\r | |
25 | MicroSecondDelay (\r | |
2f88bd3a | 26 | IN UINTN MicroSeconds\r |
e1f414b6 | 27 | )\r |
28 | {\r | |
29 | ASSERT (FALSE);\r | |
30 | return MicroSeconds;\r | |
31 | }\r | |
32 | \r | |
33 | /**\r | |
71871514 | 34 | Stalls the CPU for at least the given number of nanoseconds.\r |
35 | \r | |
e1f414b6 | 36 | Stalls the CPU for the number of nanoseconds specified by NanoSeconds.\r |
37 | \r | |
38 | @param NanoSeconds The minimum number of nanoseconds to delay.\r | |
39 | \r | |
8cefc2ee | 40 | @return The value of NanoSeconds inputted.\r |
e1f414b6 | 41 | \r |
42 | **/\r | |
43 | UINTN\r | |
44 | EFIAPI\r | |
45 | NanoSecondDelay (\r | |
2f88bd3a | 46 | IN UINTN NanoSeconds\r |
e1f414b6 | 47 | )\r |
48 | {\r | |
49 | ASSERT (FALSE);\r | |
50 | return 0;\r | |
51 | }\r | |
52 | \r | |
53 | /**\r | |
71871514 | 54 | Retrieves the current value of a 64-bit free running performance counter.\r |
55 | \r | |
56 | The counter can either count up by 1 or count down by 1. If the physical\r | |
e1f414b6 | 57 | performance counter counts by a larger increment, then the counter values\r |
58 | must be translated. The properties of the counter can be retrieved from\r | |
59 | GetPerformanceCounterProperties().\r | |
60 | \r | |
61 | @return The current value of the free running performance counter.\r | |
62 | \r | |
63 | **/\r | |
64 | UINT64\r | |
65 | EFIAPI\r | |
66 | GetPerformanceCounter (\r | |
67 | VOID\r | |
68 | )\r | |
69 | {\r | |
70 | ASSERT (FALSE);\r | |
71 | return 0;\r | |
72 | }\r | |
73 | \r | |
74 | /**\r | |
75 | Retrieves the 64-bit frequency in Hz and the range of performance counter\r | |
76 | values.\r | |
77 | \r | |
78 | If StartValue is not NULL, then the value that the performance counter starts\r | |
79 | with immediately after is it rolls over is returned in StartValue. If\r | |
80 | EndValue is not NULL, then the value that the performance counter end with\r | |
81 | immediately before it rolls over is returned in EndValue. The 64-bit\r | |
82 | frequency of the performance counter in Hz is always returned. If StartValue\r | |
83 | is less than EndValue, then the performance counter counts up. If StartValue\r | |
84 | is greater than EndValue, then the performance counter counts down. For\r | |
85 | example, a 64-bit free running counter that counts up would have a StartValue\r | |
86 | of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter\r | |
87 | that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.\r | |
88 | \r | |
89 | @param StartValue The value the performance counter starts with when it\r | |
90 | rolls over.\r | |
91 | @param EndValue The value that the performance counter ends with before\r | |
92 | it rolls over.\r | |
93 | \r | |
94 | @return The frequency in Hz.\r | |
95 | \r | |
96 | **/\r | |
97 | UINT64\r | |
98 | EFIAPI\r | |
99 | GetPerformanceCounterProperties (\r | |
2f88bd3a MK |
100 | OUT UINT64 *StartValue OPTIONAL,\r |
101 | OUT UINT64 *EndValue OPTIONAL\r | |
e1f414b6 | 102 | )\r |
103 | {\r | |
104 | ASSERT (FALSE);\r | |
e19c2c4a | 105 | \r |
106 | return (UINT64)(-1);\r | |
e1f414b6 | 107 | }\r |
b9610b9c | 108 | \r |
109 | /**\r | |
110 | Converts elapsed ticks of performance counter to time in nanoseconds.\r | |
111 | \r | |
112 | This function converts the elapsed ticks of running performance counter to\r | |
113 | time value in unit of nanoseconds.\r | |
114 | \r | |
115 | @param Ticks The number of elapsed ticks of running performance counter.\r | |
116 | \r | |
117 | @return The elapsed time in nanoseconds.\r | |
118 | \r | |
119 | **/\r | |
120 | UINT64\r | |
121 | EFIAPI\r | |
122 | GetTimeInNanoSecond (\r | |
2f88bd3a | 123 | IN UINT64 Ticks\r |
b9610b9c | 124 | )\r |
125 | {\r | |
126 | ASSERT (FALSE);\r | |
127 | return 0;\r | |
128 | }\r |