summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/PrePi
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPlatformPkg/PrePi')
-rwxr-xr-xArmPlatformPkg/PrePi/PrePi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index 5a88b47fe9..a1c1c443f0 100755
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -76,12 +76,15 @@ PrePiMain (
InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
SaveAndSetDebugTimerInterrupt (TRUE);
- PrePiHobBase = (EFI_HOB_HANDOFF_INFO_TABLE**)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdHobListPtrGlobalOffset));
-
UefiMemoryTop = UefiMemoryBase + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize);
StacksSize = PcdGet32 (PcdCPUCoresNonSecStackSize) * PcdGet32 (PcdMPCoreMaxCores);
StacksBase = UefiMemoryTop - StacksSize;
+ // Check the PcdCPUCoresNonSecStackBase match with the calculated StackBase
+ ASSERT (StacksBase == PcdGet32 (PcdCPUCoresNonSecStackBase));
+
+ PrePiHobBase = (EFI_HOB_HANDOFF_INFO_TABLE**)(PcdGet32 (PcdCPUCoresNonSecStackBase) + (PcdGet32 (PcdCPUCoresNonSecStackSize) / 2) - PcdGet32 (PcdHobListPtrGlobalOffset));
+
// Declare the PI/UEFI memory region
*PrePiHobBase = HobConstructor (
(VOID*)UefiMemoryBase,
@@ -140,12 +143,14 @@ CEntryPoint (
)
{
UINT64 StartTimeStamp;
-
+
if ((CoreId == ARM_PRIMARY_CORE) && PerformanceMeasurementEnabled ()) {
// Initialize the Timer Library to setup the Timer HW controller
TimerConstructor ();
// We cannot call yet the PerformanceLib because the HOB List has not been initialized
StartTimeStamp = GetPerformanceCounter ();
+ } else {
+ StartTimeStamp = 0;
}
// Clean Data cache