]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c
Clean up code according to code review.
[mirror_edk2.git] / MdePkg / Library / BaseTimerLibNullTemplate / TimerLibNull.c
CommitLineData
e1f414b6 1/** @file\r
2 A non-functional instance of the Timer Library.\r
3\r
d0b494ed 4 Copyright (c) 2007 - 2008, Intel Corporation<BR>\r
e1f414b6 5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
e1f414b6 13**/\r
14\r
c7d265a9 15#include <Base.h>\r
c7d265a9 16#include <Library/TimerLib.h>\r
17#include <Library/DebugLib.h>\r
e1f414b6 18\r
19/**\r
e1f414b6 20 Stalls the CPU for the number of microseconds specified by MicroSeconds.\r
21\r
22 @param MicroSeconds The minimum number of microseconds to delay.\r
23\r
8cefc2ee 24 @return The value of MicroSeconds inputted.\r
e1f414b6 25\r
26**/\r
27UINTN\r
28EFIAPI\r
29MicroSecondDelay (\r
30 IN UINTN MicroSeconds\r
31 )\r
32{\r
33 ASSERT (FALSE);\r
34 return MicroSeconds;\r
35}\r
36\r
37/**\r
e1f414b6 38 Stalls the CPU for the number of nanoseconds specified by NanoSeconds.\r
39\r
40 @param NanoSeconds The minimum number of nanoseconds to delay.\r
41\r
8cefc2ee 42 @return The value of NanoSeconds inputted.\r
e1f414b6 43\r
44**/\r
45UINTN\r
46EFIAPI\r
47NanoSecondDelay (\r
48 IN UINTN NanoSeconds\r
49 )\r
50{\r
51 ASSERT (FALSE);\r
52 return 0;\r
53}\r
54\r
55/**\r
e1f414b6 56 Retrieves the current value of a 64-bit free running performance counter. The\r
57 counter can either count up by 1 or count down by 1. If the physical\r
58 performance counter counts by a larger increment, then the counter values\r
59 must be translated. The properties of the counter can be retrieved from\r
60 GetPerformanceCounterProperties().\r
61\r
62 @return The current value of the free running performance counter.\r
63\r
64**/\r
65UINT64\r
66EFIAPI\r
67GetPerformanceCounter (\r
68 VOID\r
69 )\r
70{\r
71 ASSERT (FALSE);\r
72 return 0;\r
73}\r
74\r
75/**\r
76 Retrieves the 64-bit frequency in Hz and the range of performance counter\r
77 values.\r
78\r
79 If StartValue is not NULL, then the value that the performance counter starts\r
80 with immediately after is it rolls over is returned in StartValue. If\r
81 EndValue is not NULL, then the value that the performance counter end with\r
82 immediately before it rolls over is returned in EndValue. The 64-bit\r
83 frequency of the performance counter in Hz is always returned. If StartValue\r
84 is less than EndValue, then the performance counter counts up. If StartValue\r
85 is greater than EndValue, then the performance counter counts down. For\r
86 example, a 64-bit free running counter that counts up would have a StartValue\r
87 of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter\r
88 that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.\r
89\r
90 @param StartValue The value the performance counter starts with when it\r
91 rolls over.\r
92 @param EndValue The value that the performance counter ends with before\r
93 it rolls over.\r
94\r
95 @return The frequency in Hz.\r
96\r
97**/\r
98UINT64\r
99EFIAPI\r
100GetPerformanceCounterProperties (\r
101 OUT UINT64 *StartValue, OPTIONAL\r
102 OUT UINT64 *EndValue OPTIONAL\r
103 )\r
104{\r
105 ASSERT (FALSE);\r
e19c2c4a 106\r
107 return (UINT64)(-1);\r
e1f414b6 108}\r