]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Metronome.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Protocol / Metronome.h
CommitLineData
d1f95000 1/** @file\r
4ca9b6c4 2 Metronome Architectural Protocol as defined in PI SPEC VOLUME 2 DXE\r
d1f95000 3\r
4 This code abstracts the DXE core to provide delay services.\r
5\r
9095d37b
LG
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
7 This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
d1f95000 11\r
9095d37b
LG
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
d1f95000 14\r
d1f95000 15**/\r
16\r
17#ifndef __ARCH_PROTOCOL_METRONOME_H__\r
18#define __ARCH_PROTOCOL_METRONOME_H__\r
19\r
99e8ed21 20///\r
21/// Global ID for the Metronome Architectural Protocol\r
22///\r
d1f95000 23#define EFI_METRONOME_ARCH_PROTOCOL_GUID \\r
24 { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
25\r
99e8ed21 26///\r
27/// Declare forward reference for the Metronome Architectural Protocol\r
28///\r
d1f95000 29typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;\r
30\r
31/**\r
9095d37b
LG
32 The WaitForTick() function waits for the number of ticks specified by\r
33 TickNumber from a known time source in the platform. If TickNumber of\r
34 ticks are detected, then EFI_SUCCESS is returned. The actual time passed\r
35 between entry of this function and the first tick is between 0 and\r
36 TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod\r
37 time has elapsed, wait for two ticks. This function waits for a hardware\r
38 event to determine when a tick occurs. It is possible for interrupt\r
39 processing, or exception processing to interrupt the execution of the\r
40 WaitForTick() function. Depending on the hardware source for the ticks, it\r
41 is possible for a tick to be missed. This function cannot guarantee that\r
42 ticks will not be missed. If a timeout occurs waiting for the specified\r
d1f95000 43 number of ticks, then EFI_TIMEOUT is returned.\r
44\r
45 @param This The EFI_METRONOME_ARCH_PROTOCOL instance.\r
46 @param TickNumber Number of ticks to wait.\r
47\r
48 @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber\r
49 succeeded.\r
50 @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.\r
51\r
52**/\r
9095d37b 53typedef\r
d1f95000 54EFI_STATUS\r
8b13229b 55(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK)(\r
d1f95000 56 IN EFI_METRONOME_ARCH_PROTOCOL *This,\r
57 IN UINT32 TickNumber\r
58 );\r
59\r
44717a39 60///\r
61/// This protocol provides access to a known time source in the platform to the\r
9095d37b
LG
62/// core. The core uses this known time source to produce core services that\r
63/// require calibrated delays.\r
44717a39 64///\r
d1f95000 65struct _EFI_METRONOME_ARCH_PROTOCOL {\r
66 EFI_METRONOME_WAIT_FOR_TICK WaitForTick;\r
9095d37b 67\r
cce6f7aa 68 ///\r
9095d37b
LG
69 /// The period of platform's known time source in 100 nS units.\r
70 /// This value on any platform must be at least 10 uS, and must not\r
71 /// exceed 200 uS. The value in this field is a constant that must\r
72 /// not be modified after the Metronome architectural protocol is\r
73 /// installed. All consumers must treat this as a read-only field.\r
cce6f7aa 74 ///\r
d1f95000 75 UINT32 TickPeriod;\r
76};\r
77\r
78extern EFI_GUID gEfiMetronomeArchProtocolGuid;\r
79\r
80#endif\r