summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 23:11:03 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 23:11:03 +0000
commit8fc38a3f50915b6b11b48f830f6c7b091dbb35d8 (patch)
tree459a4a3c480686413b588183f04cc312a6bbd9d0 /ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
parent5b1928ffd6c03d171a06b89542d25ed01562c1eb (diff)
downloadedk2-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.tar.gz
edk2-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.tar.bz2
edk2-8fc38a3f50915b6b11b48f830f6c7b091dbb35d8.zip
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/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;
}