]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Metronome.h
Import Pal.h and Sal.h.
[mirror_edk2.git] / MdePkg / Include / Protocol / Metronome.h
CommitLineData
d1f95000 1/** @file\r
2 Metronome Architectural Protocol as defined in DXE CIS\r
3\r
4 This code abstracts the DXE core to provide delay services.\r
5\r
6 Copyright (c) 2006, Intel Corporation \r
7 All rights reserved. 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
11\r
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
14\r
15 Module Name: Metronome.h\r
16\r
17 @par Revision Reference:\r
18 Version 0.91B.\r
19\r
20**/\r
21\r
22#ifndef __ARCH_PROTOCOL_METRONOME_H__\r
23#define __ARCH_PROTOCOL_METRONOME_H__\r
24\r
25//\r
26// Global ID for the Metronome Architectural Protocol\r
27//\r
28#define EFI_METRONOME_ARCH_PROTOCOL_GUID \\r
29 { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
30\r
31//\r
32// Declare forward reference for the Metronome Architectural Protocol\r
33//\r
34typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;\r
35\r
36/**\r
37 The WaitForTick() function waits for the number of ticks specified by \r
38 TickNumber from a known time source in the platform. If TickNumber of \r
39 ticks are detected, then EFI_SUCCESS is returned. The actual time passed \r
40 between entry of this function and the first tick is between 0 and \r
41 TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod \r
42 time has elapsed, wait for two ticks. This function waits for a hardware \r
43 event to determine when a tick occurs. It is possible for interrupt \r
44 processing, or exception processing to interrupt the execution of the \r
45 WaitForTick() function. Depending on the hardware source for the ticks, it \r
46 is possible for a tick to be missed. This function cannot guarantee that \r
47 ticks will not be missed. If a timeout occurs waiting for the specified \r
48 number of ticks, then EFI_TIMEOUT is returned.\r
49\r
50 @param This The EFI_METRONOME_ARCH_PROTOCOL instance.\r
51 @param TickNumber Number of ticks to wait.\r
52\r
53 @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber\r
54 succeeded.\r
55 @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.\r
56\r
57**/\r
58typedef \r
59EFI_STATUS\r
60(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) (\r
61 IN EFI_METRONOME_ARCH_PROTOCOL *This,\r
62 IN UINT32 TickNumber\r
63 );\r
64\r
65//\r
66//\r
67\r
68/**\r
69 Interface stucture for the Metronome Architectural Protocol.\r
70\r
71 @par Protocol Description:\r
72 This protocol provides access to a known time source in the platform to the\r
73 core. The core uses this known time source to produce core services that \r
74 require calibrated delays. \r
75\r
76 @param WaitForTick\r
77 Waits for a specified number of ticks from a known time source \r
78 in the platform. The actual time passed between entry of this \r
79 function and the first tick is between 0 and TickPeriod 100 nS \r
80 units. If you want to guarantee that at least TickPeriod time \r
81 has elapsed, wait for two ticks.\r
82\r
83 @param TickPeriod\r
84 The period of platform's known time source in 100 nS units. \r
85 This value on any platform must be at least 10 uS, and must not \r
86 exceed 200 uS. The value in this field is a constant that must \r
87 not be modified after the Metronome architectural protocol is \r
88 installed. All consumers must treat this as a read-only field.\r
89\r
90**/\r
91struct _EFI_METRONOME_ARCH_PROTOCOL {\r
92 EFI_METRONOME_WAIT_FOR_TICK WaitForTick;\r
93 UINT32 TickPeriod;\r
94};\r
95\r
96extern EFI_GUID gEfiMetronomeArchProtocolGuid;\r
97\r
98#endif\r