summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c')
-rw-r--r--ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
index 8a47e8d8a7..0e6755d3aa 100644
--- a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
+++ b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
@@ -39,7 +39,10 @@ SetPeiServicesTablePointer (
UINTN *PeiPtrLoc;
ASSERT (PeiServicesTablePointer != NULL);
- PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdPeiServicePtrGlobalOffset));
+ PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
+ (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) -
+ PcdGet32 (PcdPeiGlobalVariableSize) +
+ PcdGet32 (PcdPeiServicePtrGlobalOffset));
*PeiPtrLoc = (UINTN)PeiServicesTablePointer;
}
@@ -63,7 +66,10 @@ GetPeiServicesTablePointer (
{
UINTN *PeiPtrLoc;
- PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdPeiServicePtrGlobalOffset));
+ PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
+ (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) -
+ PcdGet32 (PcdPeiGlobalVariableSize) +
+ PcdGet32 (PcdPeiServicePtrGlobalOffset));
return (CONST EFI_PEI_SERVICES **)*PeiPtrLoc;
}