From e5b56d6ef9fb028957683fd546347edf5232a024 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Wed, 29 Jan 2025 11:20:17 +0100 Subject: ArmPkg/CpuDxe: Use STATIC linkage where possible Use static linkage for variables and routines that are not referenced from other objects. This is generally preferred, because it gives the compiler more freedom for optimization. Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/CpuDxe/CpuDxe.c | 10 +++++++++- ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.c b/ArmPkg/Drivers/CpuDxe/CpuDxe.c index 9bb2b4a600..f109a8e0cf 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.c +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.c @@ -42,6 +42,7 @@ BOOLEAN mIsFlushingGCD; from the processor's data cache. **/ +STATIC EFI_STATUS EFIAPI CpuFlushCpuDataCache ( @@ -77,6 +78,7 @@ CpuFlushCpuDataCache ( @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the processor. **/ +STATIC EFI_STATUS EFIAPI CpuEnableInterrupt ( @@ -97,6 +99,7 @@ CpuEnableInterrupt ( @retval EFI_DEVICE_ERROR Interrupts could not be disabled on the processor. **/ +STATIC EFI_STATUS EFIAPI CpuDisableInterrupt ( @@ -121,6 +124,7 @@ CpuDisableInterrupt ( @retval EFI_INVALID_PARAMETER State is NULL. **/ +STATIC EFI_STATUS EFIAPI CpuGetInterruptState ( @@ -152,6 +156,7 @@ CpuGetInterruptState ( @retval EFI_DEVICE_ERROR The processor INIT failed. **/ +STATIC EFI_STATUS EFIAPI CpuInit ( @@ -162,6 +167,7 @@ CpuInit ( return EFI_UNSUPPORTED; } +STATIC EFI_STATUS EFIAPI CpuRegisterInterruptHandler ( @@ -173,6 +179,7 @@ CpuRegisterInterruptHandler ( return RegisterInterruptHandler (InterruptType, InterruptHandler); } +STATIC EFI_STATUS EFIAPI CpuGetTimerValue ( @@ -193,6 +200,7 @@ CpuGetTimerValue ( which is implementation-dependent. **/ +STATIC VOID EFIAPI IdleLoopEventCallback ( @@ -206,7 +214,7 @@ IdleLoopEventCallback ( // // Globals used to initialize the protocol // -EFI_CPU_ARCH_PROTOCOL mCpu = { +STATIC EFI_CPU_ARCH_PROTOCOL mCpu = { CpuFlushCpuDataCache, CpuEnableInterrupt, CpuDisableInterrupt, diff --git a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c index dbe71e4d59..489c0a17a4 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c +++ b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c @@ -27,6 +27,7 @@ @retval EFI_NOT_FOUND The requested descriptors does not exist. **/ +STATIC EFI_STATUS SearchGcdMemorySpaces ( IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap, -- cgit