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