From 8a771a2e39771b950823abcd3786e82cfd8e6e27 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 17 Mar 2016 11:33:58 +0100 Subject: ArmPkg/ArmExceptionLib: make build time define visible to the compiler The global gArmRelocateVectorTable is a build time constant, but due to its external linkage and lack of constness, the compiler does not see that. So turn it into a static boolean, and at the same time, make the function CopyExceptionHandlers() (which is only called if gArmRelocateVectorTable is set) static as well, so that the compiler can eliminate it completely if we are using the vector table in place. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Eugene Cohen --- ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ArmPkg/Library/ArmExceptionLib') diff --git a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c index 5977a3e..0cf0766 100644 --- a/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c +++ b/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c @@ -26,6 +26,7 @@ #include #include +STATIC RETURN_STATUS CopyExceptionHandlers( IN PHYSICAL_ADDRESS BaseAddress @@ -66,9 +67,9 @@ extern UINTN gDebuggerNoHandlerValue; // library we cannot represent this in a PCD since PCDs are evaluated on // a per-module basis. #if defined(ARM_RELOCATE_VECTORS) -BOOLEAN gArmRelocateVectorTable = TRUE; +STATIC CONST BOOLEAN gArmRelocateVectorTable = TRUE; #else -BOOLEAN gArmRelocateVectorTable = FALSE; +STATIC CONST BOOLEAN gArmRelocateVectorTable = FALSE; #endif @@ -151,6 +152,7 @@ with default exception handlers. @retval EFI_UNSUPPORTED This function is not supported. **/ +STATIC RETURN_STATUS CopyExceptionHandlers( IN PHYSICAL_ADDRESS BaseAddress -- cgit v1.1