@@ -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);
@@ -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);
@@ -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) +
((FixedPcdGet32 (PcdCoreCount) - 1) * FixedPcdGet32 (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);
@@ -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
Under virtualization, typically, the guest is entered with only a single CPU turned on, and any remaining CPUs are started by the OS using PSCI. So refactor the PrePi code in such a way that we can implement a unicore flavor which can be allowed to execute on a MPcore CPU. 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(-)