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:
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "PrePeiCore.h"
|
||||
|
||||
extern EFI_PEI_PPI_DESCRIPTOR *gSecPpiTable;
|
||||
|
||||
/*
|
||||
* This is the main function for secondary cores. They loop around until a non Null value is written to
|
||||
* SYS_FLAGS register.The SYS_FLAGS register is platform specific.
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
#include "PrePeiCore.h"
|
||||
|
||||
extern EFI_PEI_PPI_DESCRIPTOR *gSecPpiTable;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
SecondaryMain (
|
||||
|
@@ -13,24 +13,30 @@
|
||||
*
|
||||
**/
|
||||
|
||||
#include <Library/IoLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugAgentLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/ArmLib.h>
|
||||
#include <Library/SerialPortLib.h>
|
||||
|
||||
#include <Ppi/ArmGlobalVariable.h>
|
||||
#include <Chipset/ArmV7.h>
|
||||
|
||||
#include "PrePeiCore.h"
|
||||
|
||||
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport};
|
||||
ARM_GLOBAL_VARIABLE_PPI mGlobalVariablePpi = { PrePeiCoreGetGlobalVariableMemory };
|
||||
|
||||
EFI_PEI_PPI_DESCRIPTOR gSecPpiTable[] = {
|
||||
EFI_PEI_PPI_DESCRIPTOR gCommonPpiTable[] = {
|
||||
{
|
||||
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
|
||||
EFI_PEI_PPI_DESCRIPTOR_PPI,
|
||||
&gEfiTemporaryRamSupportPpiGuid,
|
||||
&mSecTemporaryRamSupportPpi
|
||||
},
|
||||
{
|
||||
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
|
||||
&gArmGlobalVariablePpiGuid,
|
||||
&mGlobalVariablePpi
|
||||
}
|
||||
};
|
||||
|
||||
@@ -97,6 +103,17 @@ SecTemporaryRamSupport (
|
||||
|
||||
SecSwitchStack((UINTN)(PermanentMemoryBase - TemporaryMemoryBase));
|
||||
|
||||
EFI_STATUS
|
||||
PrePeiCoreGetGlobalVariableMemory (
|
||||
OUT EFI_PHYSICAL_ADDRESS *GlobalVariableBase
|
||||
)
|
||||
{
|
||||
ASSERT (GlobalVariableBase != NULL);
|
||||
|
||||
*GlobalVariableBase = (UINTN)PcdGet32 (PcdCPUCoresStackBase) +
|
||||
(UINTN)PcdGet32 (PcdCPUCorePrimaryStackSize) -
|
||||
(UINTN)PcdGet32 (PcdPeiGlobalVariableSize);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,11 @@
|
||||
#ifndef __PREPEICORE_H_
|
||||
#define __PREPEICORE_H_
|
||||
|
||||
#include <Library/ArmLib.h>
|
||||
#include <Library/ArmPlatformLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/IoLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#include <PiPei.h>
|
||||
@@ -31,6 +35,11 @@ SecTemporaryRamSupport (
|
||||
IN UINTN CopySize
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
PrePeiCoreGetGlobalVariableMemory (
|
||||
OUT EFI_PHYSICAL_ADDRESS *GlobalVariableBase
|
||||
);
|
||||
|
||||
VOID
|
||||
SecSwitchStack (
|
||||
INTN StackDelta
|
||||
|
@@ -50,6 +50,7 @@
|
||||
|
||||
[Ppis]
|
||||
gEfiTemporaryRamSupportPpiGuid
|
||||
gArmGlobalVariablePpiGuid
|
||||
|
||||
[FeaturePcd]
|
||||
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
|
||||
|
@@ -48,6 +48,7 @@
|
||||
|
||||
[Ppis]
|
||||
gEfiTemporaryRamSupportPpiGuid
|
||||
gArmGlobalVariablePpiGuid
|
||||
|
||||
[FeaturePcd]
|
||||
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
|
||||
|
Reference in New Issue
Block a user