19b362e8 |
1 | /** @file\r |
2 | Timer Library functions for EBC.\r |
3 | \r |
4 | Copyright (c) 2006, Intel Corporation<BR>\r |
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 |
13 | Module Name: EbcTimerLib.c\r |
14 | \r |
15 | **/\r |
16 | \r |
17 | /**\r |
18 | Stalls the CPU for at least the given number of microseconds.\r |
19 | \r |
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 |
452e6c77 |
24 | @return MicroSeconds\r |
19b362e8 |
25 | \r |
26 | **/\r |
27 | UINTN\r |
28 | EFIAPI\r |
29 | MicroSecondDelay (\r |
30 | IN UINTN MicroSeconds\r |
31 | )\r |
32 | {\r |
33 | //\r |
34 | // EBC architecture does not support local APIC timer.\r |
35 | //\r |
36 | ASSERT (FALSE);\r |
452e6c77 |
37 | return MicroSeconds;\r |
19b362e8 |
38 | }\r |
39 | \r |
40 | /**\r |
41 | Stalls the CPU for at least the given number of nanoseconds.\r |
42 | \r |
43 | Stalls the CPU for the number of nanoseconds specified by NanoSeconds.\r |
44 | \r |
45 | @param NanoSeconds The minimum number of nanoseconds to delay.\r |
46 | \r |
452e6c77 |
47 | @return NanoSeconds\r |
19b362e8 |
48 | \r |
49 | **/\r |
50 | UINTN\r |
51 | EFIAPI\r |
52 | NanoSecondDelay (\r |
53 | IN UINTN NanoSeconds\r |
54 | )\r |
55 | {\r |
56 | //\r |
57 | // EBC architecture does not support local APIC timer.\r |
58 | //\r |
59 | ASSERT (FALSE);\r |
452e6c77 |
60 | return NanoSeconds;\r |
19b362e8 |
61 | }\r |
62 | \r |
63 | /**\r |
64 | Retrieves the current value of a 64-bit free running performance counter.\r |
65 | \r |
66 | Retrieves the current value of a 64-bit free running performance counter. The\r |
67 | counter can either count up by 1 or count down by 1. If the physical\r |
68 | performance counter counts by a larger increment, then the counter values\r |
69 | must be translated. The properties of the counter can be retrieved from\r |
70 | GetPerformanceCounterProperties().\r |
71 | \r |
72 | @return The current value of the free running performance counter.\r |
73 | \r |
74 | **/\r |
75 | UINT64\r |
76 | EFIAPI\r |
77 | GetPerformanceCounter (\r |
78 | VOID\r |
79 | )\r |
80 | {\r |
81 | //\r |
82 | // EBC architecture does not support local APIC timer.\r |
83 | //\r |
84 | ASSERT (FALSE);\r |
85 | return 0;\r |
86 | }\r |
87 | \r |
88 | /**\r |
89 | Retrieves the 64-bit frequency in Hz and the range of performance counter\r |
90 | values.\r |
91 | \r |
92 | If StartValue is not NULL, then the value that the performance counter starts\r |
93 | with immediately after is it rolls over is returned in StartValue. If\r |
94 | EndValue is not NULL, then the value that the performance counter end with\r |
95 | immediately before it rolls over is returned in EndValue. The 64-bit\r |
96 | frequency of the performance counter in Hz is always returned. If StartValue\r |
97 | is less than EndValue, then the performance counter counts up. If StartValue\r |
98 | is greater than EndValue, then the performance counter counts down. For\r |
99 | example, a 64-bit free running counter that counts up would have a StartValue\r |
100 | of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter\r |
101 | that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.\r |
102 | \r |
103 | @param StartValue The value the performance counter starts with when it\r |
104 | rolls over.\r |
105 | @param EndValue The value that the performance counter ends with before\r |
106 | it rolls over.\r |
107 | \r |
108 | @return The frequency in Hz.\r |
109 | \r |
110 | **/\r |
111 | UINT64\r |
112 | EFIAPI\r |
113 | GetPerformanceCounterProperties (\r |
5117b83b |
114 | OUT UINT64 *StartValue, OPTIONAL\r |
115 | OUT UINT64 *EndValue OPTIONAL\r |
19b362e8 |
116 | )\r |
117 | {\r |
118 | //\r |
119 | // EBC architecture does not support local APIC timer.\r |
120 | //\r |
121 | ASSERT (FALSE);\r |
452e6c77 |
122 | return 0;\r |
19b362e8 |
123 | }\r |