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