TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Library/TimerLib.h>
#include <Library/BaseLib.h>
#include <Library/HobLib.h>
Go to the source code of this file.
Functions | |
RETURN_STATUS EFIAPI | AcpiTimerLibConstructor (VOID) |
UINT64 | InternalCalculateTscFrequency (VOID) |
UINT64 | InternalGetPerformanceCounterFrequency (VOID) |
EFI_STATUS | CommonAcpiTimerLibConstructor (VOID) |
Variables | |
GUID | mFrequencyHobGuid |
ACPI Timer implements one instance of Timer Library.
Copyright (c) 2013 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DxeStandaloneMmAcpiTimerLib.c.
RETURN_STATUS EFIAPI AcpiTimerLibConstructor | ( | VOID | ) |
The constructor function enables ACPI IO space.
If ACPI I/O space not enabled, this function will enable it. It will always return RETURN_SUCCESS.
EFI_SUCCESS | The constructor always returns RETURN_SUCCESS. |
The constructor function caches the ACPI tick counter address, and, if necessary, enables ACPI IO space.
EFI_SUCCESS | The constructor always returns RETURN_SUCCESS. |
The constructor function caches the ACPI tick counter address
At the time this constructor runs (DXE_CORE or later), ACPI IO space has already been enabled by either PlatformPei or by the "Base" instance of this library. In order to avoid querying the underlying platform type during each tick counter read operation, we cache the counter address during initialization of this instance of the Timer Library.
EFI_SUCCESS | The constructor always returns RETURN_SUCCESS. |
Definition at line 28 of file BaseAcpiTimerLib.c.
EFI_STATUS CommonAcpiTimerLibConstructor | ( | VOID | ) |
The constructor function enables ACPI IO space, and caches PerformanceCounterFrequency.
EFI_SUCCESS | The constructor always returns RETURN_SUCCESS. |
Definition at line 79 of file DxeStandaloneMmAcpiTimerLib.c.
UINT64 InternalCalculateTscFrequency | ( | VOID | ) |
Calculate TSC frequency.
The TSC counting frequency is determined by comparing how far it counts during a 101.4 us period as determined by the ACPI timer. The ACPI timer is used because it counts at a known frequency. The TSC is sampled, followed by waiting 363 counts of the ACPI timer, or 101.4 us. The TSC is then sampled again. The difference multiplied by 9861 is the TSC frequency. There will be a small error because of the overhead of reading the ACPI timer. An attempt is made to determine and compensate for this error.
Definition at line 356 of file AcpiTimerLib.c.
UINT64 InternalGetPerformanceCounterFrequency | ( | VOID | ) |
Internal function to retrieves the 64-bit frequency in Hz.
Internal function to retrieves the 64-bit frequency in Hz.
Definition at line 65 of file DxeStandaloneMmAcpiTimerLib.c.
|
extern |
Definition at line 18 of file AcpiTimerLib.c.