TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeStandaloneMmAcpiTimerLib.c
Go to the documentation of this file.
1
9#include <PiDxe.h>
10#include <Library/TimerLib.h>
11#include <Library/BaseLib.h>
12#include <Library/HobLib.h>
13
14//
15// Cached performance counter frequency
16//
17static UINT64 mAcpiTimerLibTscFrequency = 0;
18
19extern GUID mFrequencyHobGuid;
20
30RETURN_STATUS
31EFIAPI
33 VOID
34 );
35
51UINT64
53 VOID
54 );
55
64UINT64
66 VOID
67 )
68{
69 return mAcpiTimerLibTscFrequency;
70}
71
80 VOID
81 )
82{
83 EFI_HOB_GUID_TYPE *GuidHob;
84
85 //
86 // Enable ACPI IO space.
87 //
89
90 //
91 // Initialize PerformanceCounterFrequency
92 //
93 GuidHob = GetFirstGuidHob (&mFrequencyHobGuid);
94 if (GuidHob != NULL) {
95 mAcpiTimerLibTscFrequency = *(UINT64 *)GET_GUID_HOB_DATA (GuidHob);
96 } else {
97 mAcpiTimerLibTscFrequency = InternalCalculateTscFrequency ();
98 }
99
100 return EFI_SUCCESS;
101}
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition: HobLib.c:215
UINT64 InternalCalculateTscFrequency(VOID)
Definition: AcpiTimerLib.c:356
RETURN_STATUS EFIAPI AcpiTimerLibConstructor(VOID)
UINT64 InternalGetPerformanceCounterFrequency(VOID)
EFI_STATUS CommonAcpiTimerLibConstructor(VOID)
#define NULL
Definition: Base.h:319
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
Definition: Base.h:213