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 | |
parent | 5b1928ffd6c03d171a06b89542d25ed01562c1eb (diff) | |
download | edk2-platforms-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.tar.xz |
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')
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/MainMPCore.c | 2 | ||||
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/MainUniCore.c | 2 | ||||
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/PrePeiCore.c | 25 | ||||
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/PrePeiCore.h | 9 | ||||
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf | 1 | ||||
-rw-r--r-- | ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 1 |
6 files changed, 32 insertions, 8 deletions
diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c b/ArmPlatformPkg/PrePeiCore/MainMPCore.c index 5402161b62..74f4b8e77a 100644 --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c @@ -18,8 +18,6 @@ #include "PrePeiCore.h"
-extern EFI_PEI_PPI_DESCRIPTOR *gSecPpiTable;
-
/*
* This is the main function for secondary cores. They loop around until a non Null value is written to
* SYS_FLAGS register.The SYS_FLAGS register is platform specific.
diff --git a/ArmPlatformPkg/PrePeiCore/MainUniCore.c b/ArmPlatformPkg/PrePeiCore/MainUniCore.c index 9db6fdfbd5..7b32e40114 100644 --- a/ArmPlatformPkg/PrePeiCore/MainUniCore.c +++ b/ArmPlatformPkg/PrePeiCore/MainUniCore.c @@ -16,8 +16,6 @@ #include "PrePeiCore.h"
-extern EFI_PEI_PPI_DESCRIPTOR *gSecPpiTable;
-
VOID
EFIAPI
SecondaryMain (
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;
}
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h index 05198b8290..08c5ebd031 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.h +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.h @@ -15,7 +15,11 @@ #ifndef __PREPEICORE_H_
#define __PREPEICORE_H_
+#include <Library/ArmLib.h>
+#include <Library/ArmPlatformLib.h>
+#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <PiPei.h>
@@ -31,6 +35,11 @@ SecTemporaryRamSupport ( IN UINTN CopySize
);
+EFI_STATUS
+PrePeiCoreGetGlobalVariableMemory (
+ OUT EFI_PHYSICAL_ADDRESS *GlobalVariableBase
+ );
+
VOID
SecSwitchStack (
INTN StackDelta
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf index cd3c3461f8..d019e60369 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf @@ -50,6 +50,7 @@ [Ppis]
gEfiTemporaryRamSupportPpiGuid
+ gArmGlobalVariablePpiGuid
[FeaturePcd]
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf index 57318744b4..90582d8922 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf @@ -48,6 +48,7 @@ [Ppis]
gEfiTemporaryRamSupportPpiGuid
+ gArmGlobalVariablePpiGuid
[FeaturePcd]
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
|