X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FLibrary%2FArmPlatformGlobalVariableLib%2FPei%2FPeiArmPlatformGlobalVariableLib.c;h=e03a7aeee3ac642c837328c927af7c153b7dabdf;hp=57ea0f416fa985eb177fbcfa595a1ff8fa315d60;hb=0db25ccc6cf1d05dc6b8fd9b07d033b40c387c88;hpb=8fc38a3f50915b6b11b48f830f6c7b091dbb35d8 diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c index 57ea0f416f..e03a7aeee3 100644 --- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c +++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011, ARM Limited. All rights reserved. +* Copyright (c) 2011-2012, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -17,9 +17,7 @@ #include #include #include - -//TODO: RemoveMe -//#include +#include // Declared by ArmPlatformPkg/PrePi Module extern UINTN mGlobalVariableBase; @@ -33,6 +31,9 @@ ArmPlatformGetGlobalVariable ( { UINTN GlobalVariableBase; + // Ensure the Global Variable Size have been initialized + ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize)); + GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize) + VariableOffset; if (VariableSize == 4) { @@ -55,6 +56,9 @@ ArmPlatformSetGlobalVariable ( { UINTN GlobalVariableBase; + // Ensure the Global Variable Size have been initialized + ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize)); + GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize) + VariableOffset; if (VariableSize == 4) {