]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Metronome Architectural Protocol as defined in PI SPEC VOLUME 2 DXE\r | |
3 | \r | |
4 | This code abstracts the DXE core to provide delay services.\r | |
5 | \r | |
6 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | \r | |
9 | **/\r | |
10 | \r | |
11 | #ifndef __ARCH_PROTOCOL_METRONOME_H__\r | |
12 | #define __ARCH_PROTOCOL_METRONOME_H__\r | |
13 | \r | |
14 | ///\r | |
15 | /// Global ID for the Metronome Architectural Protocol\r | |
16 | ///\r | |
17 | #define EFI_METRONOME_ARCH_PROTOCOL_GUID \\r | |
18 | { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r | |
19 | \r | |
20 | ///\r | |
21 | /// Declare forward reference for the Metronome Architectural Protocol\r | |
22 | ///\r | |
23 | typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;\r | |
24 | \r | |
25 | /**\r | |
26 | The WaitForTick() function waits for the number of ticks specified by\r | |
27 | TickNumber from a known time source in the platform. If TickNumber of\r | |
28 | ticks are detected, then EFI_SUCCESS is returned. The actual time passed\r | |
29 | between entry of this function and the first tick is between 0 and\r | |
30 | TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod\r | |
31 | time has elapsed, wait for two ticks. This function waits for a hardware\r | |
32 | event to determine when a tick occurs. It is possible for interrupt\r | |
33 | processing, or exception processing to interrupt the execution of the\r | |
34 | WaitForTick() function. Depending on the hardware source for the ticks, it\r | |
35 | is possible for a tick to be missed. This function cannot guarantee that\r | |
36 | ticks will not be missed. If a timeout occurs waiting for the specified\r | |
37 | number of ticks, then EFI_TIMEOUT is returned.\r | |
38 | \r | |
39 | @param This The EFI_METRONOME_ARCH_PROTOCOL instance.\r | |
40 | @param TickNumber Number of ticks to wait.\r | |
41 | \r | |
42 | @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber\r | |
43 | succeeded.\r | |
44 | @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.\r | |
45 | \r | |
46 | **/\r | |
47 | typedef\r | |
48 | EFI_STATUS\r | |
49 | (EFIAPI *EFI_METRONOME_WAIT_FOR_TICK)(\r | |
50 | IN EFI_METRONOME_ARCH_PROTOCOL *This,\r | |
51 | IN UINT32 TickNumber\r | |
52 | );\r | |
53 | \r | |
54 | ///\r | |
55 | /// This protocol provides access to a known time source in the platform to the\r | |
56 | /// core. The core uses this known time source to produce core services that\r | |
57 | /// require calibrated delays.\r | |
58 | ///\r | |
59 | struct _EFI_METRONOME_ARCH_PROTOCOL {\r | |
60 | EFI_METRONOME_WAIT_FOR_TICK WaitForTick;\r | |
61 | \r | |
62 | ///\r | |
63 | /// The period of platform's known time source in 100 nS units.\r | |
64 | /// This value on any platform must be at least 10 uS, and must not\r | |
65 | /// exceed 200 uS. The value in this field is a constant that must\r | |
66 | /// not be modified after the Metronome architectural protocol is\r | |
67 | /// installed. All consumers must treat this as a read-only field.\r | |
68 | ///\r | |
69 | UINT32 TickPeriod;\r | |
70 | };\r | |
71 | \r | |
72 | extern EFI_GUID gEfiMetronomeArchProtocolGuid;\r | |
73 | \r | |
74 | #endif\r |