ArmPlatformPkg/ArmPlatformGlobalVariableLib: Added new function ArmPlatformGetGlobalVariableAddress()
This function returns the address of a Global Variable in the Global Variable Region. Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13246 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -65,3 +65,17 @@ ArmPlatformSetGlobalVariable (
|
||||
}
|
||||
}
|
||||
|
||||
VOID*
|
||||
ArmPlatformGetGlobalVariableAddress (
|
||||
IN UINTN VariableOffset
|
||||
)
|
||||
{
|
||||
UINTN GlobalVariableBase;
|
||||
|
||||
// Ensure the Global Variable Size have been initialized
|
||||
ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
|
||||
|
||||
GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
|
||||
|
||||
return (VOID*)(GlobalVariableBase + VariableOffset);
|
||||
}
|
||||
|
Reference in New Issue
Block a user