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