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.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c b/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
index dfcc27edf5..a18a02a9bb 100755
--- a/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
+++ b/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
@@ -17,14 +17,6 @@
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
-//
-// Have to use build system to set the original value in case we are running
-// from FLASH and globals don't work. So if you do a GetHobList() and gHobList
-// and gHobList is NULL the PCD default values are used.
-//
-VOID *gHobList = NULL;
-
-
/**
Returns the pointer to the HOB list.
@@ -39,11 +31,10 @@ PrePeiGetHobList (
VOID
)
{
- if (gHobList == NULL) {
- return (VOID *)*(UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdHobListPtrGlobalOffset));
- } else {
- return gHobList;
- }
+ return (VOID *)*(UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
+ PcdGet32 (PcdCPUCoresNonSecStackSize) -
+ PcdGet32 (PcdPeiGlobalVariableSize) +
+ PcdGet32 (PcdHobListPtrGlobalOffset));
}
@@ -60,10 +51,15 @@ PrePeiSetHobList (
IN VOID *HobList
)
{
- gHobList = HobList;
-
- //
- // If this code is running from ROM this could fail
- //
- return (gHobList == HobList) ? EFI_SUCCESS: EFI_UNSUPPORTED;
+ UINTN* HobListPtr;
+
+ HobListPtr = (UINTN*)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
+ PcdGet32 (PcdCPUCoresNonSecStackSize) -
+ PcdGet32 (PcdPeiGlobalVariableSize) +
+ PcdGet32 (PcdHobListPtrGlobalOffset));
+
+ *HobListPtr = (UINTN)HobList;
+
+ return EFI_SUCCESS;
}
+