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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user