]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | Metronome.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Metronome Architectural Protocol as defined in DXE CIS\r | |
19 | \r | |
20 | This code abstracts the DXE core to provide delay services.\r | |
21 | \r | |
22 | --*/\r | |
23 | \r | |
24 | #ifndef _ARCH_PROTOCOL_METRONOME_H_\r | |
25 | #define _ARCH_PROTOCOL_METRONOME_H_\r | |
26 | \r | |
27 | //\r | |
28 | // Global ID for the Metronome Architectural Protocol\r | |
29 | //\r | |
30 | #define EFI_METRONOME_ARCH_PROTOCOL_GUID \\r | |
7ccf38a3 | 31 | { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }\r |
3eb9473e | 32 | \r |
33 | //\r | |
34 | // Declare forward reference for the Metronome Architectural Protocol\r | |
35 | //\r | |
36 | EFI_FORWARD_DECLARATION (EFI_METRONOME_ARCH_PROTOCOL);\r | |
37 | \r | |
38 | typedef \r | |
39 | EFI_STATUS\r | |
40 | (EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) (\r | |
41 | IN EFI_METRONOME_ARCH_PROTOCOL *This,\r | |
42 | IN UINT32 TickNumber\r | |
43 | );\r | |
44 | /*++\r | |
45 | \r | |
46 | Routine Description:\r | |
47 | \r | |
48 | The WaitForTick() function waits for the number of ticks specified by \r | |
49 | TickNumber from a known time source in the platform. If TickNumber of \r | |
50 | ticks are detected, then EFI_SUCCESS is returned. The actual time passed \r | |
51 | between entry of this function and the first tick is between 0 and \r | |
52 | TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod \r | |
53 | time has elapsed, wait for two ticks. This function waits for a hardware \r | |
54 | event to determine when a tick occurs. It is possible for interrupt \r | |
55 | processing, or exception processing to interrupt the execution of the \r | |
56 | WaitForTick() function. Depending on the hardware source for the ticks, it \r | |
57 | is possible for a tick to be missed. This function cannot guarantee that \r | |
58 | ticks will not be missed. If a timeout occurs waiting for the specified \r | |
59 | number of ticks, then EFI_TIMEOUT is returned.\r | |
60 | \r | |
61 | Arguments:\r | |
62 | \r | |
63 | This - The EFI_METRONOME_ARCH_PROTOCOL instance.\r | |
64 | \r | |
65 | TickNumber - Number of ticks to wait.\r | |
66 | \r | |
67 | Returns: \r | |
68 | \r | |
69 | EFI_SUCCESS - The wait for the number of ticks specified by TickNumber \r | |
70 | succeeded.\r | |
71 | \r | |
72 | EFI_TIMEOUT - A timeout occurred waiting for the specified number of ticks.\r | |
73 | \r | |
74 | --*/\r | |
75 | \r | |
76 | //\r | |
77 | // Interface stucture for the Metronome Architectural Protocol\r | |
78 | //\r | |
6f80bb86 | 79 | struct _EFI_METRONOME_ARCH_PROTOCOL {\r |
3eb9473e | 80 | EFI_METRONOME_WAIT_FOR_TICK WaitForTick;\r |
81 | UINT32 TickPeriod;\r | |
6f80bb86 | 82 | };\r |
3eb9473e | 83 | \r |
84 | /*++\r | |
85 | \r | |
86 | Protocol Description:\r | |
87 | This protocol provides access to a known time source in the platform to the\r | |
88 | core. The core uses this known time source to produce core services that \r | |
89 | require calibrated delays. \r | |
90 | \r | |
91 | Parameters:\r | |
92 | \r | |
93 | WaitForTick - Waits for a specified number of ticks from a known time source \r | |
94 | in the platform. The actual time passed between entry of this \r | |
95 | function and the first tick is between 0 and TickPeriod 100 nS \r | |
96 | units. If you want to guarantee that at least TickPeriod time \r | |
97 | has elapsed, wait for two ticks.\r | |
98 | \r | |
99 | TickPeriod - The period of platform's known time source in 100 nS units. \r | |
100 | This value on any platform must be at least 10 uS, and must not \r | |
101 | exceed 200 uS. The value in this field is a constant that must \r | |
102 | not be modified after the Metronome architectural protocol is \r | |
103 | installed. All consumers must treat this as a read-only field.\r | |
104 | \r | |
105 | --*/\r | |
106 | \r | |
107 | extern EFI_GUID gEfiMetronomeArchProtocolGuid;\r | |
108 | \r | |
109 | #endif\r |