ArmPlatformPkg: Introduce ArmPlatformGlobalVariableLib

This library hides where the 'XIP' Global Variable are located in the memory.
It is expected the Sec/PrePi modules define the Global Variable area through
the GlobalVariable HOB.

The ArmPlatformGlobalVariableLib library allows access to global variables by
their offsets in this region.




git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12420 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin
2011-09-22 23:11:03 +00:00
parent 5b1928ffd6
commit 8fc38a3f50
30 changed files with 739 additions and 49 deletions

View File

@@ -13,24 +13,30 @@
*
**/
#include <Library/IoLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugAgentLib.h>
#include <Library/PrintLib.h>
#include <Library/ArmLib.h>
#include <Library/SerialPortLib.h>
#include <Ppi/ArmGlobalVariable.h>
#include <Chipset/ArmV7.h>
#include "PrePeiCore.h"
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport};
ARM_GLOBAL_VARIABLE_PPI mGlobalVariablePpi = { PrePeiCoreGetGlobalVariableMemory };
EFI_PEI_PPI_DESCRIPTOR gSecPpiTable[] = {
EFI_PEI_PPI_DESCRIPTOR gCommonPpiTable[] = {
{
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiTemporaryRamSupportPpiGuid,
&mSecTemporaryRamSupportPpi
},
{
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
&gArmGlobalVariablePpiGuid,
&mGlobalVariablePpi
}
};
@@ -97,6 +103,17 @@ SecTemporaryRamSupport (
SecSwitchStack((UINTN)(PermanentMemoryBase - TemporaryMemoryBase));
EFI_STATUS
PrePeiCoreGetGlobalVariableMemory (
OUT EFI_PHYSICAL_ADDRESS *GlobalVariableBase
)
{
ASSERT (GlobalVariableBase != NULL);
*GlobalVariableBase = (UINTN)PcdGet32 (PcdCPUCoresStackBase) +
(UINTN)PcdGet32 (PcdCPUCorePrimaryStackSize) -
(UINTN)PcdGet32 (PcdPeiGlobalVariableSize);
return EFI_SUCCESS;
}