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 <ardb@kernel.org>
This commit is contained in:
Ard Biesheuvel 2025-01-29 11:20:17 +01:00 committed by mergify[bot]
parent afdae789cd
commit e5b56d6ef9
2 changed files with 10 additions and 1 deletions

View File

@ -42,6 +42,7 @@ BOOLEAN mIsFlushingGCD;
from the processor's data cache. from the processor's data cache.
**/ **/
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuFlushCpuDataCache ( CpuFlushCpuDataCache (
@ -77,6 +78,7 @@ CpuFlushCpuDataCache (
@retval EFI_DEVICE_ERROR Interrupts could not be enabled on the processor. @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the processor.
**/ **/
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuEnableInterrupt ( CpuEnableInterrupt (
@ -97,6 +99,7 @@ CpuEnableInterrupt (
@retval EFI_DEVICE_ERROR Interrupts could not be disabled on the processor. @retval EFI_DEVICE_ERROR Interrupts could not be disabled on the processor.
**/ **/
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuDisableInterrupt ( CpuDisableInterrupt (
@ -121,6 +124,7 @@ CpuDisableInterrupt (
@retval EFI_INVALID_PARAMETER State is NULL. @retval EFI_INVALID_PARAMETER State is NULL.
**/ **/
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuGetInterruptState ( CpuGetInterruptState (
@ -152,6 +156,7 @@ CpuGetInterruptState (
@retval EFI_DEVICE_ERROR The processor INIT failed. @retval EFI_DEVICE_ERROR The processor INIT failed.
**/ **/
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuInit ( CpuInit (
@ -162,6 +167,7 @@ CpuInit (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuRegisterInterruptHandler ( CpuRegisterInterruptHandler (
@ -173,6 +179,7 @@ CpuRegisterInterruptHandler (
return RegisterInterruptHandler (InterruptType, InterruptHandler); return RegisterInterruptHandler (InterruptType, InterruptHandler);
} }
STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CpuGetTimerValue ( CpuGetTimerValue (
@ -193,6 +200,7 @@ CpuGetTimerValue (
which is implementation-dependent. which is implementation-dependent.
**/ **/
STATIC
VOID VOID
EFIAPI EFIAPI
IdleLoopEventCallback ( IdleLoopEventCallback (
@ -206,7 +214,7 @@ IdleLoopEventCallback (
// //
// Globals used to initialize the protocol // Globals used to initialize the protocol
// //
EFI_CPU_ARCH_PROTOCOL mCpu = { STATIC EFI_CPU_ARCH_PROTOCOL mCpu = {
CpuFlushCpuDataCache, CpuFlushCpuDataCache,
CpuEnableInterrupt, CpuEnableInterrupt,
CpuDisableInterrupt, CpuDisableInterrupt,

View File

@ -27,6 +27,7 @@
@retval EFI_NOT_FOUND The requested descriptors does not exist. @retval EFI_NOT_FOUND The requested descriptors does not exist.
**/ **/
STATIC
EFI_STATUS EFI_STATUS
SearchGcdMemorySpaces ( SearchGcdMemorySpaces (
IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap, IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,