]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePeiCore: constify PPI globals
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 7 Aug 2015 17:27:24 +0000 (17:27 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Fri, 7 Aug 2015 17:27:24 +0000 (17:27 +0000)
Since PrePeiCore's .text section contains an AARCH64 exception
vector table, its 2 KB alignment propagates to other sections as
well. Since this is a SEC module, it should not have any writable
data in the first place, so change some non-const PPI globals to
const. The resulting binary has no .data section at all, which
saves 2 KB in the XIP image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18188 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/PrePeiCore/PrePeiCore.c

index 43ae40de2f245b695adfe102bbd0354f4c4bb9e4..491d7a6f851f8433d0107273ddc7311fd10ffe6f 100644 (file)
 \r
 #include "PrePeiCore.h"\r
 \r
-EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI   mTemporaryRamSupportPpi = { PrePeiCoreTemporaryRamSupport };\r
-ARM_GLOBAL_VARIABLE_PPI             mGlobalVariablePpi = { PrePeiCoreGetGlobalVariableMemory };\r
+CONST EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI   mTemporaryRamSupportPpi = { PrePeiCoreTemporaryRamSupport };\r
+CONST ARM_GLOBAL_VARIABLE_PPI             mGlobalVariablePpi = { PrePeiCoreGetGlobalVariableMemory };\r
 \r
-EFI_PEI_PPI_DESCRIPTOR      gCommonPpiTable[] = {\r
+CONST EFI_PEI_PPI_DESCRIPTOR      gCommonPpiTable[] = {\r
   {\r
     EFI_PEI_PPI_DESCRIPTOR_PPI,\r
     &gEfiTemporaryRamSupportPpiGuid,\r
-    &mTemporaryRamSupportPpi\r
+    (VOID *) &mTemporaryRamSupportPpi\r
   },\r
   {\r
     EFI_PEI_PPI_DESCRIPTOR_PPI,\r
     &gArmGlobalVariablePpiGuid,\r
-    &mGlobalVariablePpi\r
+    (VOID *) &mGlobalVariablePpi\r
   }\r
 };\r
 \r