mirror of https://github.com/acidanthera/audk.git
ArmPlatformPkg/PrePi: remove global variable allocation from lowlevel init
Now that we dropped all ArmPlatformGlobalVariableLib dependencies, there is no longer a need to allocate and clear out the global variable region in the PrePi init code. So remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18992 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5eeba3b7f1
commit
f2e17a0731
|
@ -133,16 +133,10 @@ _GetStackBase:
|
||||||
cmp x0, #1
|
cmp x0, #1
|
||||||
bne _PrepareArguments
|
bne _PrepareArguments
|
||||||
|
|
||||||
_ReserveGlobalVariable:
|
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), x0)
|
|
||||||
// InitializePrimaryStack($GlobalVariableSize, $Tmp1, $Tmp2)
|
|
||||||
InitializePrimaryStack(x0, x1, x2)
|
|
||||||
|
|
||||||
_PrepareArguments:
|
_PrepareArguments:
|
||||||
mov x0, x10
|
mov x0, x10
|
||||||
mov x1, x11
|
mov x1, x11
|
||||||
mov x2, x12
|
mov x2, x12
|
||||||
mov x3, sp
|
|
||||||
|
|
||||||
// Move sec startup address into a data register
|
// Move sec startup address into a data register
|
||||||
// Ensure we're jumping to FV version of the code (not boot remapped alias)
|
// Ensure we're jumping to FV version of the code (not boot remapped alias)
|
||||||
|
@ -152,7 +146,6 @@ _PrepareArguments:
|
||||||
// x0 = MpId
|
// x0 = MpId
|
||||||
// x1 = UefiMemoryBase
|
// x1 = UefiMemoryBase
|
||||||
// x2 = StacksBase
|
// x2 = StacksBase
|
||||||
// x3 = GlobalVariableBase
|
|
||||||
blr x4
|
blr x4
|
||||||
|
|
||||||
_NeverReturn:
|
_NeverReturn:
|
||||||
|
|
|
@ -141,11 +141,6 @@ _GetStackBase:
|
||||||
cmp r0, #1
|
cmp r0, #1
|
||||||
bne _PrepareArguments
|
bne _PrepareArguments
|
||||||
|
|
||||||
_ReserveGlobalVariable:
|
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), r0)
|
|
||||||
// InitializePrimaryStack($GlobalVariableSize, $Tmp1)
|
|
||||||
InitializePrimaryStack(r0, r1)
|
|
||||||
|
|
||||||
_PrepareArguments:
|
_PrepareArguments:
|
||||||
mov r0, r8
|
mov r0, r8
|
||||||
mov r1, r9
|
mov r1, r9
|
||||||
|
@ -160,7 +155,6 @@ _PrepareArguments:
|
||||||
// r0 = MpId
|
// r0 = MpId
|
||||||
// r1 = UefiMemoryBase
|
// r1 = UefiMemoryBase
|
||||||
// r2 = StacksBase
|
// r2 = StacksBase
|
||||||
// r3 = GlobalVariableBase
|
|
||||||
blx r4
|
blx r4
|
||||||
|
|
||||||
_NeverReturn:
|
_NeverReturn:
|
||||||
|
|
|
@ -143,16 +143,10 @@ _GetStackBase
|
||||||
cmp r0, #1
|
cmp r0, #1
|
||||||
bne _PrepareArguments
|
bne _PrepareArguments
|
||||||
|
|
||||||
_ReserveGlobalVariable
|
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), r0)
|
|
||||||
// InitializePrimaryStack($GlobalVariableSize, $Tmp1)
|
|
||||||
InitializePrimaryStack r0, r1
|
|
||||||
|
|
||||||
_PrepareArguments
|
_PrepareArguments
|
||||||
mov r0, r8
|
mov r0, r8
|
||||||
mov r1, r9
|
mov r1, r9
|
||||||
mov r2, r10
|
mov r2, r10
|
||||||
mov r3, sp
|
|
||||||
|
|
||||||
// Move sec startup address into a data register
|
// Move sec startup address into a data register
|
||||||
// Ensure we're jumping to FV version of the code (not boot remapped alias)
|
// Ensure we're jumping to FV version of the code (not boot remapped alias)
|
||||||
|
@ -162,7 +156,6 @@ _PrepareArguments
|
||||||
// r0 = MpId
|
// r0 = MpId
|
||||||
// r1 = UefiMemoryBase
|
// r1 = UefiMemoryBase
|
||||||
// r2 = StacksBase
|
// r2 = StacksBase
|
||||||
// r3 = GlobalVariableBase
|
|
||||||
blx r4
|
blx r4
|
||||||
|
|
||||||
_NeverReturn
|
_NeverReturn
|
||||||
|
|
|
@ -22,7 +22,6 @@ VOID
|
||||||
PrimaryMain (
|
PrimaryMain (
|
||||||
IN UINTN UefiMemoryBase,
|
IN UINTN UefiMemoryBase,
|
||||||
IN UINTN StacksBase,
|
IN UINTN StacksBase,
|
||||||
IN UINTN GlobalVariableBase,
|
|
||||||
IN UINT64 StartTimeStamp
|
IN UINT64 StartTimeStamp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -35,7 +34,7 @@ PrimaryMain (
|
||||||
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));
|
||||||
}
|
}
|
||||||
|
|
||||||
PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
|
PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
|
||||||
|
|
||||||
// We must never return
|
// We must never return
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
|
|
|
@ -18,7 +18,6 @@ VOID
|
||||||
PrimaryMain (
|
PrimaryMain (
|
||||||
IN UINTN UefiMemoryBase,
|
IN UINTN UefiMemoryBase,
|
||||||
IN UINTN StacksBase,
|
IN UINTN StacksBase,
|
||||||
IN UINTN GlobalVariableBase,
|
|
||||||
IN UINT64 StartTimeStamp
|
IN UINT64 StartTimeStamp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +26,7 @@ PrimaryMain (
|
||||||
ASSERT(ArmIsMpCore() == 0);
|
ASSERT(ArmIsMpCore() == 0);
|
||||||
DEBUG_CODE_END();
|
DEBUG_CODE_END();
|
||||||
|
|
||||||
PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
|
PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
|
||||||
|
|
||||||
// We must never return
|
// We must never return
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
|
|
|
@ -67,7 +67,6 @@
|
||||||
gArmMpCoreInfoPpiGuid
|
gArmMpCoreInfoPpiGuid
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gArmGlobalVariableGuid
|
|
||||||
gArmMpCoreInfoGuid
|
gArmMpCoreInfoGuid
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
|
@ -89,8 +88,6 @@
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
|
|
||||||
|
|
||||||
gArmTokenSpaceGuid.PcdGicDistributorBase
|
gArmTokenSpaceGuid.PcdGicDistributorBase
|
||||||
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
|
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
|
||||||
gArmTokenSpaceGuid.PcdGicSgiIntId
|
gArmTokenSpaceGuid.PcdGicSgiIntId
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
gArmMpCoreInfoPpiGuid
|
gArmMpCoreInfoPpiGuid
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gArmGlobalVariableGuid
|
|
||||||
gArmMpCoreInfoGuid
|
gArmMpCoreInfoGuid
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
|
@ -88,8 +87,6 @@
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
|
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <Ppi/GuidedSectionExtraction.h>
|
#include <Ppi/GuidedSectionExtraction.h>
|
||||||
#include <Ppi/ArmMpCoreInfo.h>
|
#include <Ppi/ArmMpCoreInfo.h>
|
||||||
#include <Guid/LzmaDecompress.h>
|
#include <Guid/LzmaDecompress.h>
|
||||||
#include <Guid/ArmGlobalVariableHob.h>
|
|
||||||
|
|
||||||
#include "PrePi.h"
|
#include "PrePi.h"
|
||||||
#include "LzmaDecompress.h"
|
#include "LzmaDecompress.h"
|
||||||
|
@ -33,9 +32,6 @@
|
||||||
#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > mSystemMemoryEnd) || \
|
#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > mSystemMemoryEnd) || \
|
||||||
((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))
|
((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))
|
||||||
|
|
||||||
// Not used when PrePi in run in XIP mode
|
|
||||||
UINTN mGlobalVariableBase = 0;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ExtractGuidedSectionLibConstructor (
|
ExtractGuidedSectionLibConstructor (
|
||||||
|
@ -48,23 +44,6 @@ LzmaDecompressLibConstructor (
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
BuildGlobalVariableHob (
|
|
||||||
IN EFI_PHYSICAL_ADDRESS GlobalVariableBase,
|
|
||||||
IN UINT32 GlobalVariableSize
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ARM_HOB_GLOBAL_VARIABLE *Hob;
|
|
||||||
|
|
||||||
Hob = CreateHob (EFI_HOB_TYPE_GUID_EXTENSION, sizeof (ARM_HOB_GLOBAL_VARIABLE));
|
|
||||||
ASSERT(Hob != NULL);
|
|
||||||
|
|
||||||
CopyGuid (&(Hob->Header.Name), &gArmGlobalVariableGuid);
|
|
||||||
Hob->GlobalVariableBase = GlobalVariableBase;
|
|
||||||
Hob->GlobalVariableSize = GlobalVariableSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
GetPlatformPpi (
|
GetPlatformPpi (
|
||||||
IN EFI_GUID *PpiGuid,
|
IN EFI_GUID *PpiGuid,
|
||||||
|
@ -93,7 +72,6 @@ VOID
|
||||||
PrePiMain (
|
PrePiMain (
|
||||||
IN UINTN UefiMemoryBase,
|
IN UINTN UefiMemoryBase,
|
||||||
IN UINTN StacksBase,
|
IN UINTN StacksBase,
|
||||||
IN UINTN GlobalVariableBase,
|
|
||||||
IN UINT64 StartTimeStamp
|
IN UINT64 StartTimeStamp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -146,9 +124,6 @@ PrePiMain (
|
||||||
}
|
}
|
||||||
BuildStackHob (StacksBase, StacksSize);
|
BuildStackHob (StacksBase, StacksSize);
|
||||||
|
|
||||||
// Declare the Global Variable HOB
|
|
||||||
BuildGlobalVariableHob (GlobalVariableBase, FixedPcdGet32 (PcdPeiGlobalVariableSize));
|
|
||||||
|
|
||||||
//TODO: Call CpuPei as a library
|
//TODO: Call CpuPei as a library
|
||||||
BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));
|
BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));
|
||||||
|
|
||||||
|
@ -203,8 +178,7 @@ VOID
|
||||||
CEntryPoint (
|
CEntryPoint (
|
||||||
IN UINTN MpId,
|
IN UINTN MpId,
|
||||||
IN UINTN UefiMemoryBase,
|
IN UINTN UefiMemoryBase,
|
||||||
IN UINTN StacksBase,
|
IN UINTN StacksBase
|
||||||
IN UINTN GlobalVariableBase
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT64 StartTimeStamp;
|
UINT64 StartTimeStamp;
|
||||||
|
@ -235,7 +209,6 @@ CEntryPoint (
|
||||||
// Define the Global Variable region when we are not running in XIP
|
// Define the Global Variable region when we are not running in XIP
|
||||||
if (!IS_XIP()) {
|
if (!IS_XIP()) {
|
||||||
if (ArmPlatformIsPrimaryCore (MpId)) {
|
if (ArmPlatformIsPrimaryCore (MpId)) {
|
||||||
mGlobalVariableBase = GlobalVariableBase;
|
|
||||||
if (ArmIsMpCore()) {
|
if (ArmIsMpCore()) {
|
||||||
// Signal the Global Variable Region is defined (event: ARM_CPU_EVENT_DEFAULT)
|
// Signal the Global Variable Region is defined (event: ARM_CPU_EVENT_DEFAULT)
|
||||||
ArmCallSEV ();
|
ArmCallSEV ();
|
||||||
|
@ -249,7 +222,7 @@ CEntryPoint (
|
||||||
// If not primary Jump to Secondary Main
|
// If not primary Jump to Secondary Main
|
||||||
if (ArmPlatformIsPrimaryCore (MpId)) {
|
if (ArmPlatformIsPrimaryCore (MpId)) {
|
||||||
// Goto primary Main.
|
// Goto primary Main.
|
||||||
PrimaryMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
|
PrimaryMain (UefiMemoryBase, StacksBase, StartTimeStamp);
|
||||||
} else {
|
} else {
|
||||||
SecondaryMain (MpId);
|
SecondaryMain (MpId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ VOID
|
||||||
PrePiMain (
|
PrePiMain (
|
||||||
IN UINTN UefiMemoryBase,
|
IN UINTN UefiMemoryBase,
|
||||||
IN UINTN StacksBase,
|
IN UINTN StacksBase,
|
||||||
IN UINTN GlobalVariableBase,
|
|
||||||
IN UINT64 StartTimeStamp
|
IN UINT64 StartTimeStamp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -62,7 +61,6 @@ VOID
|
||||||
PrimaryMain (
|
PrimaryMain (
|
||||||
IN UINTN UefiMemoryBase,
|
IN UINTN UefiMemoryBase,
|
||||||
IN UINTN StacksBase,
|
IN UINTN StacksBase,
|
||||||
IN UINTN GlobalVariableBase,
|
|
||||||
IN UINT64 StartTimeStamp
|
IN UINT64 StartTimeStamp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue