]>
Commit | Line | Data |
---|---|---|
6a0d41c0 SQ |
1 | /** @file\r |
2 | EFI Timestamp Protocol as defined in UEFI2.4 Specification. \r | |
3 | Used to provide a platform independent interface for retrieving a high resolution timestamp counter.\r | |
4 | \r | |
5 | Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials \r | |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
14 | @par Revision Reference: \r | |
15 | This Protocol is introduced in UEFI Specification 2.4 \r | |
16 | \r | |
17 | **/\r | |
18 | \r | |
19 | #ifndef __EFI_TIME_STAMP_PROTOCOL_H__\r | |
20 | #define __EFI_TIME_STAMP_PROTOCOL_H__\r | |
21 | \r | |
22 | \r | |
23 | #define EFI_TIMESTAMP_PROTOCOL_GUID \\r | |
24 | { 0xafbfde41, 0x2e6e, 0x4262, {0xba, 0x65, 0x62, 0xb9, 0x23, 0x6e, 0x54, 0x95 } }\r | |
25 | \r | |
26 | ///\r | |
27 | /// Declare forward reference for the Time Stamp Protocol\r | |
28 | ///\r | |
29 | typedef struct _EFI_TIMESTAMP_PROTOCOL EFI_TIMESTAMP_PROTOCOL;\r | |
30 | \r | |
31 | ///\r | |
32 | /// EFI_TIMESTAMP_PROPERTIES\r | |
33 | ///\r | |
34 | typedef struct {\r | |
35 | /// \r | |
36 | /// The frequency of the timestamp counter in Hz.\r | |
37 | /// \r | |
38 | UINT64 Frequency;\r | |
39 | /// \r | |
40 | /// The value that the timestamp counter ends with immediately before it rolls over.\r | |
41 | /// For example, a 64-bit free running counter would have an EndValue of 0xFFFFFFFFFFFFFFFF.\r | |
42 | /// A 24-bit free running counter would have an EndValue of 0xFFFFFF.\r | |
43 | ///\r | |
44 | UINT64 EndValue;\r | |
45 | } EFI_TIMESTAMP_PROPERTIES;\r | |
46 | \r | |
47 | /**\r | |
48 | Retrieves the current value of a 64-bit free running timestamp counter.\r | |
49 | \r | |
50 | The counter shall count up in proportion to the amount of time that has passed. The counter value\r | |
51 | will always roll over to zero. The properties of the counter can be retrieved from GetProperties().\r | |
52 | The caller should be prepared for the function to return the same value twice across successive calls.\r | |
53 | The counter value will not go backwards other than when wrapping, as defined by EndValue in GetProperties().\r | |
54 | The frequency of the returned timestamp counter value must remain constant. Power management operations that \r | |
55 | affect clocking must not change the returned counter frequency. The quantization of counter value updates may \r | |
56 | vary as long as the value reflecting time passed remains consistent.\r | |
57 | \r | |
58 | @param None. \r | |
59 | \r | |
60 | @retval The current value of the free running timestamp counter.\r | |
61 | \r | |
62 | **/\r | |
63 | typedef\r | |
64 | UINT64\r | |
65 | (EFIAPI *TIMESTAMP_GET)(\r | |
66 | VOID\r | |
67 | );\r | |
68 | \r | |
69 | /**\r | |
70 | Obtains timestamp counter properties including frequency and value limits.\r | |
71 | \r | |
72 | @param[out] Properties The properties of the timestamp counter.\r | |
73 | \r | |
74 | @retval EFI_SUCCESS The properties were successfully retrieved. \r | |
75 | @retval EFI_DEVICE_ERROR An error occurred trying to retrieve the properties of the timestamp \r | |
76 | counter subsystem. Properties is not pedated. \r | |
77 | @retval EFI_INVALID_PARAMETER Properties is NULL.\r | |
78 | \r | |
79 | **/\r | |
80 | typedef \r | |
81 | EFI_STATUS\r | |
82 | (EFIAPI *TIMESTAMP_GET_PROPERTIES)(\r | |
83 | OUT EFI_TIMESTAMP_PROPERTIES *Properties\r | |
84 | );\r | |
85 | \r | |
86 | \r | |
87 | \r | |
88 | ///\r | |
89 | /// EFI_TIMESTAMP_PROTOCOL\r | |
90 | /// The protocol provides a platform independent interface for retrieving a high resolution \r | |
91 | /// timestamp counter.\r | |
92 | ///\r | |
93 | struct _EFI_TIMESTAMP_PROTOCOL {\r | |
94 | TIMESTAMP_GET GetTimestamp;\r | |
95 | TIMESTAMP_GET_PROPERTIES GetProperties;\r | |
96 | };\r | |
97 | \r | |
98 | extern EFI_GUID gEfiTimestampProtocolGuid;\r | |
99 | \r | |
100 | #endif\r | |
101 | \r |