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