diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 23:11:03 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 23:11:03 +0000 |
commit | 8fc38a3f50915b6b11b48f830f6c7b091dbb35d8 (patch) | |
tree | 459a4a3c480686413b588183f04cc312a6bbd9d0 /ArmPlatformPkg/PrePeiCore/PrePeiCore.c | |
parent | 5b1928ffd6c03d171a06b89542d25ed01562c1eb (diff) | |
download | edk2-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.tar.gz edk2-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.tar.bz2 edk2-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.zip |
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
Diffstat (limited to 'ArmPlatformPkg/PrePeiCore/PrePeiCore.c')
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/PrePeiCore.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c index c557efebce..a61d0b8857 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c @@ -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;
}
|