diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 23:11:03 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 23:11:03 +0000 |
commit | 8fc38a3f50915b6b11b48f830f6c7b091dbb35d8 (patch) | |
tree | 459a4a3c480686413b588183f04cc312a6bbd9d0 /ArmPlatformPkg/Library/PeiServicesTablePointerLib | |
parent | 5b1928ffd6c03d171a06b89542d25ed01562c1eb (diff) | |
download | edk2-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/PeiServicesTablePointerLib')
-rw-r--r-- | ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c | 22 | ||||
-rw-r--r-- | ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf | 9 |
2 files changed, 11 insertions, 20 deletions
diff --git a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c index 0e6755d3aa..cb0041f90d 100644 --- a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c +++ b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c @@ -16,6 +16,7 @@ **/
#include <PiPei.h>
+#include <Library/ArmPlatformGlobalVariableLib.h>
#include <Library/PeiServicesTablePointerLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
@@ -33,17 +34,12 @@ VOID
EFIAPI
SetPeiServicesTablePointer (
- IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
+ IN CONST EFI_PEI_SERVICES **PeiServicesTablePointer
)
{
- UINTN *PeiPtrLoc;
ASSERT (PeiServicesTablePointer != NULL);
- PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
- (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) -
- PcdGet32 (PcdPeiGlobalVariableSize) +
- PcdGet32 (PcdPeiServicePtrGlobalOffset));
- *PeiPtrLoc = (UINTN)PeiServicesTablePointer;
+ ArmPlatformSetGlobalVariable (PcdGet32 (PcdPeiServicePtrGlobalOffset), sizeof(EFI_PEI_SERVICES **), &PeiServicesTablePointer);
}
/**
@@ -58,19 +54,17 @@ SetPeiServicesTablePointer ( @return The pointer to PeiServices.
**/
-CONST EFI_PEI_SERVICES **
+CONST EFI_PEI_SERVICES**
EFIAPI
GetPeiServicesTablePointer (
VOID
)
{
- UINTN *PeiPtrLoc;
+ EFI_PEI_SERVICES **PeiServicesTablePointer;
- PeiPtrLoc = (UINTN *)(UINTN)(PcdGet32 (PcdCPUCoresNonSecStackBase) +
- (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) -
- PcdGet32 (PcdPeiGlobalVariableSize) +
- PcdGet32 (PcdPeiServicePtrGlobalOffset));
- return (CONST EFI_PEI_SERVICES **)*PeiPtrLoc;
+ ArmPlatformGetGlobalVariable (PcdGet32 (PcdPeiServicePtrGlobalOffset), sizeof(EFI_PEI_SERVICES **), &PeiServicesTablePointer);
+
+ return (CONST EFI_PEI_SERVICES**)PeiServicesTablePointer;
}
diff --git a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf index 5c0811b837..1e8b5e131e 100644 --- a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf +++ b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf @@ -21,7 +21,7 @@ INF_VERSION = 0x00010005
BASE_NAME = PeiServicesTablePointerLib
FILE_GUID = 1c747f6b-0a58-49ae-8ea3-0327a4fa10e3
- MODULE_TYPE = PEIM
+ MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = PeiServicesTablePointerLib|PEIM PEI_CORE SEC
@@ -37,11 +37,8 @@ ArmPlatformPkg/ArmPlatformPkg.dec
[LibraryClasses]
- DebugLib
+ ArmPlatformGlobalVariableLib
[Pcd]
gArmPlatformTokenSpaceGuid.PcdPeiServicePtrGlobalOffset
- gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackBase
- gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackSize
- gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
-
+
|