]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmExceptionLib: make build time define visible to the compiler
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 17 Mar 2016 10:33:58 +0000 (11:33 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 22 Mar 2016 13:39:02 +0000 (14:39 +0100)
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 <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c

index 5977a3e8fae137dbbb9d085fdea112e659c16460..0cf0766b9cbf2f23e2dc7c3fdeef47cef1b54f93 100644 (file)
@@ -26,6 +26,7 @@
 #include <Library/DebugLib.h>\r
 #include <Library/DefaultExceptionHandlerLib.h>\r
 \r
+STATIC\r
 RETURN_STATUS\r
 CopyExceptionHandlers(\r
   IN  PHYSICAL_ADDRESS        BaseAddress\r
@@ -66,9 +67,9 @@ extern UINTN                    gDebuggerNoHandlerValue;
 // library we cannot represent this in a PCD since PCDs are evaluated on\r
 // a per-module basis.\r
 #if defined(ARM_RELOCATE_VECTORS)\r
-BOOLEAN gArmRelocateVectorTable = TRUE;\r
+STATIC CONST BOOLEAN gArmRelocateVectorTable = TRUE;\r
 #else\r
-BOOLEAN gArmRelocateVectorTable = FALSE;\r
+STATIC CONST BOOLEAN gArmRelocateVectorTable = FALSE;\r
 #endif\r
 \r
 \r
@@ -151,6 +152,7 @@ with default exception handlers.
 @retval EFI_UNSUPPORTED       This function is not supported.\r
 \r
 **/\r
+STATIC\r
 RETURN_STATUS\r
 CopyExceptionHandlers(\r
   IN  PHYSICAL_ADDRESS        BaseAddress\r