]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseTimerLibNullTemplate/TimerLibNull.c
add in FrameworkIfrSupportLib
[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 Module Name: TimerLibNull.c
14
15 **/
16
17 //
18 // The package level header files this module uses
19 //
20 #include <Base.h>
21 //
22 // The protocols, PPI and GUID defintions for this module
23 //
24 //
25 // The Library classes this module consumes
26 //
27 #include <Library/TimerLib.h>
28 #include <Library/DebugLib.h>
29
30 /**
31 Stalls the CPU for at least the given number of microseconds.
32
33 Stalls the CPU for the number of microseconds specified by MicroSeconds.
34
35 @param MicroSeconds The minimum number of microseconds to delay.
36
37 @return MicroSeconds
38
39 **/
40 UINTN
41 EFIAPI
42 MicroSecondDelay (
43 IN UINTN MicroSeconds
44 )
45 {
46 ASSERT (FALSE);
47 return MicroSeconds;
48 }
49
50 /**
51 Stalls the CPU for at least the given number of nanoseconds.
52
53 Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
54
55 @param NanoSeconds The minimum number of nanoseconds to delay.
56
57 @return NanoSeconds
58
59 **/
60 UINTN
61 EFIAPI
62 NanoSecondDelay (
63 IN UINTN NanoSeconds
64 )
65 {
66 ASSERT (FALSE);
67 return 0;
68 }
69
70 /**
71 Retrieves the current value of a 64-bit free running performance counter.
72
73 Retrieves the current value of a 64-bit free running performance counter. The
74 counter can either count up by 1 or count down by 1. If the physical
75 performance counter counts by a larger increment, then the counter values
76 must be translated. The properties of the counter can be retrieved from
77 GetPerformanceCounterProperties().
78
79 @return The current value of the free running performance counter.
80
81 **/
82 UINT64
83 EFIAPI
84 GetPerformanceCounter (
85 VOID
86 )
87 {
88 ASSERT (FALSE);
89 return 0;
90 }
91
92 /**
93 Retrieves the 64-bit frequency in Hz and the range of performance counter
94 values.
95
96 If StartValue is not NULL, then the value that the performance counter starts
97 with immediately after is it rolls over is returned in StartValue. If
98 EndValue is not NULL, then the value that the performance counter end with
99 immediately before it rolls over is returned in EndValue. The 64-bit
100 frequency of the performance counter in Hz is always returned. If StartValue
101 is less than EndValue, then the performance counter counts up. If StartValue
102 is greater than EndValue, then the performance counter counts down. For
103 example, a 64-bit free running counter that counts up would have a StartValue
104 of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
105 that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
106
107 @param StartValue The value the performance counter starts with when it
108 rolls over.
109 @param EndValue The value that the performance counter ends with before
110 it rolls over.
111
112 @return The frequency in Hz.
113
114 **/
115 UINT64
116 EFIAPI
117 GetPerformanceCounterProperties (
118 OUT UINT64 *StartValue, OPTIONAL
119 OUT UINT64 *EndValue OPTIONAL
120 )
121 {
122 ASSERT (FALSE);
123 return 0;
124 }