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