]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Metronome.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / Metronome.h
1 /** @file
2 Metronome Architectural Protocol as defined in PI SPEC VOLUME 2 DXE
3
4 This code abstracts the DXE core to provide delay services.
5
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef __ARCH_PROTOCOL_METRONOME_H__
12 #define __ARCH_PROTOCOL_METRONOME_H__
13
14 ///
15 /// Global ID for the Metronome Architectural Protocol
16 ///
17 #define EFI_METRONOME_ARCH_PROTOCOL_GUID \
18 { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
19
20 ///
21 /// Declare forward reference for the Metronome Architectural Protocol
22 ///
23 typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;
24
25 /**
26 The WaitForTick() function waits for the number of ticks specified by
27 TickNumber from a known time source in the platform. If TickNumber of
28 ticks are detected, then EFI_SUCCESS is returned. The actual time passed
29 between entry of this function and the first tick is between 0 and
30 TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod
31 time has elapsed, wait for two ticks. This function waits for a hardware
32 event to determine when a tick occurs. It is possible for interrupt
33 processing, or exception processing to interrupt the execution of the
34 WaitForTick() function. Depending on the hardware source for the ticks, it
35 is possible for a tick to be missed. This function cannot guarantee that
36 ticks will not be missed. If a timeout occurs waiting for the specified
37 number of ticks, then EFI_TIMEOUT is returned.
38
39 @param This The EFI_METRONOME_ARCH_PROTOCOL instance.
40 @param TickNumber Number of ticks to wait.
41
42 @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber
43 succeeded.
44 @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.
45
46 **/
47 typedef
48 EFI_STATUS
49 (EFIAPI *EFI_METRONOME_WAIT_FOR_TICK)(
50 IN EFI_METRONOME_ARCH_PROTOCOL *This,
51 IN UINT32 TickNumber
52 );
53
54 ///
55 /// This protocol provides access to a known time source in the platform to the
56 /// core. The core uses this known time source to produce core services that
57 /// require calibrated delays.
58 ///
59 struct _EFI_METRONOME_ARCH_PROTOCOL {
60 EFI_METRONOME_WAIT_FOR_TICK WaitForTick;
61
62 ///
63 /// The period of platform's known time source in 100 nS units.
64 /// This value on any platform must be at least 10 uS, and must not
65 /// exceed 200 uS. The value in this field is a constant that must
66 /// not be modified after the Metronome architectural protocol is
67 /// installed. All consumers must treat this as a read-only field.
68 ///
69 UINT32 TickPeriod;
70 };
71
72 extern EFI_GUID gEfiMetronomeArchProtocolGuid;
73
74 #endif