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:
@@ -43,8 +43,6 @@ ArmPlatformGetGlobalVariable (
|
||||
} else {
|
||||
CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
|
||||
}
|
||||
|
||||
//DEBUG((EFI_D_ERROR,"++ GET Offset[%d] = 0x%x\n",VariableOffset,*(UINTN*)Variable));
|
||||
}
|
||||
|
||||
VOID
|
||||
@@ -68,7 +66,19 @@ ArmPlatformSetGlobalVariable (
|
||||
} else {
|
||||
CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
|
||||
}
|
||||
|
||||
//DEBUG((EFI_D_ERROR,"++ SET Offset[%d] = 0x%x\n",VariableOffset,*(UINTN*)Variable));
|
||||
}
|
||||
|
||||
VOID*
|
||||
ArmPlatformGetGlobalVariableAddress (
|
||||
IN UINTN VariableOffset
|
||||
)
|
||||
{
|
||||
UINTN GlobalVariableBase;
|
||||
|
||||
// Ensure the Global Variable Size have been initialized
|
||||
ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
|
||||
|
||||
GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
|
||||
|
||||
return (VOID*)(GlobalVariableBase + VariableOffset);
|
||||
}
|
||||
|
Reference in New Issue
Block a user