summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-07-30 19:52:21 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-01 14:55:03 +0000
commit12dc8d420bc98ceb3dbeb7be433b7dfc465a24b8 (patch)
tree7902ed1d33fe523d584032a58a06ec8702068341 /ArmPkg
parente76b248d8fc37832a880121551b0780501f14308 (diff)
downloadedk2-12dc8d420bc98ceb3dbeb7be433b7dfc465a24b8.tar.gz
edk2-12dc8d420bc98ceb3dbeb7be433b7dfc465a24b8.tar.bz2
edk2-12dc8d420bc98ceb3dbeb7be433b7dfc465a24b8.zip
ArmPkg/ArmArchTimerLib: Drop pointless constructor
Drop the pointless constructor in ArmArchTimerLib, which does nothing useful, especially because AArch64 mandates the presence of the generic timer, and 32-bit ARM is mostly obsolete these days. To preserve the existing behavior in DEBUG builds when actually using the timer, move the ASSERT () on a non-zero frequency to the associated accessor helper function. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c26
-rw-r--r--ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf1
2 files changed, 2 insertions, 25 deletions
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
index ccb4f6474b..76f94c9161 100644
--- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
+++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
@@ -24,30 +24,6 @@
#define MULT_U64_X_N MultU64x64
#endif
-RETURN_STATUS
-EFIAPI
-TimerConstructor (
- VOID
- )
-{
- //
- // Check if the ARM Generic Timer Extension is implemented.
- //
- if (ArmIsArchTimerImplemented ()) {
- //
- // Architectural Timer Frequency must be set in Secure privileged
- // mode (if secure extension is supported).
- // If the reset value (0) is returned, just ASSERT.
- //
- ASSERT (ArmGenericTimerGetTimerFreq () != 0);
- } else {
- DEBUG ((DEBUG_ERROR, "ARM Architectural Timer is not available in the CPU, hence this library cannot be used.\n"));
- ASSERT (0);
- }
-
- return RETURN_SUCCESS;
-}
-
/**
A local utility function that returns the PCD value, if specified.
Otherwise it defaults to ArmGenericTimerGetTimerFreq.
@@ -65,6 +41,8 @@ GetPlatformTimerFreq (
TimerFreq = ArmGenericTimerGetTimerFreq ();
+ ASSERT (TimerFreq != 0);
+
return TimerFreq;
}
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
index 273b1e9555..76bad81531 100644
--- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
+++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
@@ -12,7 +12,6 @@
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = TimerLib
- CONSTRUCTOR = TimerConstructor
[Sources.common]
ArmArchTimerLib.c