When we execute under the Linux kernel boot protocol, secondary cores must be parked or powered down. This means that we may want to allow the unicore build to execute on a CPU which identifies itself as part of an MPcore set.
This patch refactors the calls to ArmIsMpCore () so that the PrePi flavor introduced in a subsequent patch can override them.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- ArmPlatformPkg/PrePi/MainMPCore.c | 2 +- ArmPlatformPkg/PrePi/MainUniCore.c | 2 +- ArmPlatformPkg/PrePi/PrePi.c | 9 ++++----- ArmPlatformPkg/PrePi/PrePi.h | 3 ++- 4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ArmPlatformPkg/PrePi/MainMPCore.c b/ArmPlatformPkg/PrePi/MainMPCore.c index bf813730d341..8e5f9947d499 100644 --- a/ArmPlatformPkg/PrePi/MainMPCore.c +++ b/ArmPlatformPkg/PrePi/MainMPCore.c @@ -35,7 +35,7 @@ PrimaryMain ( ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId)); }
- PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp); + PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp, ArmIsMpCore());
// We must never return ASSERT(FALSE); diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c b/ArmPlatformPkg/PrePi/MainUniCore.c index 43588a50ddb5..918ea4dcdf7b 100644 --- a/ArmPlatformPkg/PrePi/MainUniCore.c +++ b/ArmPlatformPkg/PrePi/MainUniCore.c @@ -27,7 +27,7 @@ PrimaryMain ( ASSERT(ArmIsMpCore() == 0); DEBUG_CODE_END();
- PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp); + PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp, ArmIsMpCore());
// We must never return ASSERT(FALSE); diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c index 2091017a0996..9c669280be01 100755 --- a/ArmPlatformPkg/PrePi/PrePi.c +++ b/ArmPlatformPkg/PrePi/PrePi.c @@ -94,7 +94,8 @@ PrePiMain ( IN UINTN UefiMemoryBase, IN UINTN StacksBase, IN UINTN GlobalVariableBase, - IN UINT64 StartTimeStamp + IN UINT64 StartTimeStamp, + IN BOOLEAN IsMpCore ) { EFI_HOB_HANDOFF_INFO_TABLE* HobList; @@ -138,7 +139,7 @@ PrePiMain ( ASSERT_EFI_ERROR (Status);
// Create the Stacks HOB (reserve the memory for all stacks) - if (ArmIsMpCore ()) { + if (IsMpCore) { StacksSize = PcdGet32 (PcdCPUCorePrimaryStackSize) + ((PcdGet32 (PcdCoreCount) - 1) * PcdGet32 (PcdCPUCoreSecondaryStackSize)); } else { @@ -152,7 +153,7 @@ PrePiMain ( //TODO: Call CpuPei as a library BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));
- if (ArmIsMpCore ()) { + if (IsMpCore) { // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid Status = GetPlatformPpi (&gArmMpCoreInfoPpiGuid, (VOID**)&ArmMpCoreInfoPpi);
@@ -209,8 +210,6 @@ CEntryPoint ( { UINT64 StartTimeStamp;
- ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1)); - // Initialize the platform specific controllers ArmPlatformInitialize (MpId);
diff --git a/ArmPlatformPkg/PrePi/PrePi.h b/ArmPlatformPkg/PrePi/PrePi.h index e67795f4490a..468569b3a28b 100644 --- a/ArmPlatformPkg/PrePi/PrePi.h +++ b/ArmPlatformPkg/PrePi/PrePi.h @@ -40,7 +40,8 @@ PrePiMain ( IN UINTN UefiMemoryBase, IN UINTN StacksBase, IN UINTN GlobalVariableBase, - IN UINT64 StartTimeStamp + IN UINT64 StartTimeStamp, + IN BOOLEAN IsMpCore );
EFI_STATUS