Path: blob/main/sys/contrib/edk2/Include/Protocol/Metronome.h
96339 views
/** @file1Metronome Architectural Protocol as defined in PI SPEC VOLUME 2 DXE23This code abstracts the DXE core to provide delay services.45Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>6SPDX-License-Identifier: BSD-2-Clause-Patent78**/910#ifndef __ARCH_PROTOCOL_METRONOME_H__11#define __ARCH_PROTOCOL_METRONOME_H__1213///14/// Global ID for the Metronome Architectural Protocol15///16#define EFI_METRONOME_ARCH_PROTOCOL_GUID \17{ 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }1819///20/// Declare forward reference for the Metronome Architectural Protocol21///22typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;2324/**25The WaitForTick() function waits for the number of ticks specified by26TickNumber from a known time source in the platform. If TickNumber of27ticks are detected, then EFI_SUCCESS is returned. The actual time passed28between entry of this function and the first tick is between 0 and29TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod30time has elapsed, wait for two ticks. This function waits for a hardware31event to determine when a tick occurs. It is possible for interrupt32processing, or exception processing to interrupt the execution of the33WaitForTick() function. Depending on the hardware source for the ticks, it34is possible for a tick to be missed. This function cannot guarantee that35ticks will not be missed. If a timeout occurs waiting for the specified36number of ticks, then EFI_TIMEOUT is returned.3738@param This The EFI_METRONOME_ARCH_PROTOCOL instance.39@param TickNumber Number of ticks to wait.4041@retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber42succeeded.43@retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.4445**/46typedef47EFI_STATUS48(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK)(49IN EFI_METRONOME_ARCH_PROTOCOL *This,50IN UINT32 TickNumber51);5253///54/// This protocol provides access to a known time source in the platform to the55/// core. The core uses this known time source to produce core services that56/// require calibrated delays.57///58struct _EFI_METRONOME_ARCH_PROTOCOL {59EFI_METRONOME_WAIT_FOR_TICK WaitForTick;6061///62/// The period of platform's known time source in 100 nS units.63/// This value on any platform must be at least 10 uS, and must not64/// exceed 200 uS. The value in this field is a constant that must65/// not be modified after the Metronome architectural protocol is66/// installed. All consumers must treat this as a read-only field.67///68UINT32 TickPeriod;69};7071extern EFI_GUID gEfiMetronomeArchProtocolGuid;7273#endif747576