summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Library
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-11 12:03:00 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-11 12:03:00 +0000
commit47a8e12fe162f7c9c1deefde7bed912a860c4223 (patch)
treef5e8984f752c46a6df23f1f1872a65ae9b46ca4f /ArmPlatformPkg/Library
parent936eff09c3d5297aa4cdf69da2b89a69666bf9c9 (diff)
downloadedk2-platforms-47a8e12fe162f7c9c1deefde7bed912a860c4223.tar.xz
ArmPlatformPkg/PrePeiCore: Reserve some memory on the top of the stack for Global Variables in XIP code
The size of this memory is controlled by a PCD. The Global Variable in this regsion are defined by their offset. This memory region can be use to store the PEI Services Table Pointer. Update the PeiServicesTablePointerLib to use this region instead of PcdPeiServicePtrAddr. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11803 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Library')
-rw-r--r--ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c4
-rw-r--r--ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf5
2 files changed, 6 insertions, 3 deletions
diff --git a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
index 9f25f4699f..8a47e8d8a7 100644
--- a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
+++ b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
@@ -39,7 +39,7 @@ SetPeiServicesTablePointer (
UINTN *PeiPtrLoc;
ASSERT (PeiServicesTablePointer != NULL);
- PeiPtrLoc = (UINTN *)(UINTN)PcdGet32(PcdPeiServicePtrAddr);
+ PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdPeiServicePtrGlobalOffset));
*PeiPtrLoc = (UINTN)PeiServicesTablePointer;
}
@@ -63,7 +63,7 @@ GetPeiServicesTablePointer (
{
UINTN *PeiPtrLoc;
- PeiPtrLoc = (UINTN *)(UINTN)PcdGet32(PcdPeiServicePtrAddr);
+ PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdPeiServicePtrGlobalOffset));
return (CONST EFI_PEI_SERVICES **)*PeiPtrLoc;
}
diff --git a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
index f9860b63b7..33f2457b7e 100644
--- a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
+++ b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
@@ -40,4 +40,7 @@
DebugLib
[Pcd]
- gArmPlatformTokenSpaceGuid.PcdPeiServicePtrAddr
+ gArmPlatformTokenSpaceGuid.PcdPeiServicePtrGlobalOffset
+ gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackBase
+ gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackSize
+