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:
oliviermartin
2012-05-02 19:51:08 +00:00
parent f437141a9c
commit d9efd68ef5
6 changed files with 63 additions and 6 deletions

View File

@@ -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);
}