]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseTimerLibNullTemplate / TimerLibNull.c
... / ...
CommitLineData
1/** @file\r
2 A non-functional instance of the Timer Library.\r
3\r
4 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#include <Base.h>\r
10#include <Library/TimerLib.h>\r
11#include <Library/DebugLib.h>\r
12\r
13/**\r
14 Stalls the CPU for at least the given number of microseconds.\r
15\r
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
20 @return The value of MicroSeconds inputted.\r
21\r
22**/\r
23UINTN\r
24EFIAPI\r
25MicroSecondDelay (\r
26 IN UINTN MicroSeconds\r
27 )\r
28{\r
29 ASSERT (FALSE);\r
30 return MicroSeconds;\r
31}\r
32\r
33/**\r
34 Stalls the CPU for at least the given number of nanoseconds.\r
35\r
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
40 @return The value of NanoSeconds inputted.\r
41\r
42**/\r
43UINTN\r
44EFIAPI\r
45NanoSecondDelay (\r
46 IN UINTN NanoSeconds\r
47 )\r
48{\r
49 ASSERT (FALSE);\r
50 return 0;\r
51}\r
52\r
53/**\r
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
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
64UINT64\r
65EFIAPI\r
66GetPerformanceCounter (\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
97UINT64\r
98EFIAPI\r
99GetPerformanceCounterProperties (\r
100 OUT UINT64 *StartValue OPTIONAL,\r
101 OUT UINT64 *EndValue OPTIONAL\r
102 )\r
103{\r
104 ASSERT (FALSE);\r
105\r
106 return (UINT64)(-1);\r
107}\r
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
120UINT64\r
121EFIAPI\r
122GetTimeInNanoSecond (\r
123 IN UINT64 Ticks\r
124 )\r
125{\r
126 ASSERT (FALSE);\r
127 return 0;\r
128}\r