VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Include/Library/TimerLib.h@ 77599

Last change on this file since 77599 was 48674, checked in by vboxsync, 11 years ago

EFI: Export newly imported tinaocore UEFI sources to OSE.

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette