summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c')
-rwxr-xr-xArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c b/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
index a18a02a9bb..8ec0808b32 100755
--- a/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
+++ b/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
@@ -13,6 +13,7 @@
**/
#include <PiPei.h>
+#include <Library/ArmPlatformGlobalVariableLib.h>
#include <Library/PrePiHobListPointerLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
@@ -31,10 +32,11 @@ PrePeiGetHobList (
VOID
)
{
- return (VOID *)*(UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
- PcdGet32 (PcdCPUCoresNonSecStackSize) -
- PcdGet32 (PcdPeiGlobalVariableSize) +
- PcdGet32 (PcdHobListPtrGlobalOffset));
+ VOID* HobList;
+
+ ArmPlatformGetGlobalVariable (PcdGet32 (PcdHobListPtrGlobalOffset), sizeof(VOID*), &HobList);
+
+ return HobList;
}
@@ -51,14 +53,7 @@ PrePeiSetHobList (
IN VOID *HobList
)
{
- UINTN* HobListPtr;
-
- HobListPtr = (UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
- PcdGet32 (PcdCPUCoresNonSecStackSize) -
- PcdGet32 (PcdPeiGlobalVariableSize) +
- PcdGet32 (PcdHobListPtrGlobalOffset));
-
- *HobListPtr = (UINTN)HobList;
+ ArmPlatformSetGlobalVariable (PcdGet32 (PcdHobListPtrGlobalOffset), sizeof(VOID*), &HobList);
return EFI_SUCCESS;
}