VOID\r
PrimaryMain (\r
IN UINTN UefiMemoryBase,\r
+ IN UINTN StacksBase,\r
+ IN UINTN GlobalVariableBase,\r
IN UINT64 StartTimeStamp\r
)\r
{\r
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);\r
}\r
\r
- PrePiMain (UefiMemoryBase, StartTimeStamp);\r
+ PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
\r
// We must never return\r
ASSERT(FALSE);\r
VOID\r
PrimaryMain (\r
IN UINTN UefiMemoryBase,\r
+ IN UINTN StacksBase,\r
+ IN UINTN GlobalVariableBase,\r
IN UINT64 StartTimeStamp\r
)\r
{\r
- PrePiMain (UefiMemoryBase, StartTimeStamp);\r
+ PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
\r
// We must never return\r
ASSERT(FALSE);\r
\r
\r
_PrepareArguments:\r
+ mov r0, r5\r
+ mov r1, r6\r
+ mov r2, r7\r
+ mov r3, sp\r
+\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
- ldr r2, StartupAddr\r
+ ldr r4, StartupAddr\r
\r
// Jump to PrePiCore C code\r
// r0 = MpId\r
// r1 = UefiMemoryBase\r
- blx r2\r
+ // r2 = StacksBase\r
+ // r3 = GlobalVariableBase\r
+ blx r4\r
\r
_NeverReturn:\r
b _NeverReturn\r
\r
\r
_PrepareArguments\r
+ mov r0, r5\r
+ mov r1, r6\r
+ mov r2, r7\r
+ mov r3, sp\r
+\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
- ldr r2, StartupAddr\r
+ ldr r4, StartupAddr\r
\r
// Jump to PrePiCore C code\r
// r0 = MpId\r
// r1 = UefiMemoryBase\r
- blx r2\r
+ // r2 = StacksBase\r
+ // r3 = GlobalVariableBase\r
+ blx r4\r
\r
_NeverReturn\r
b _NeverReturn\r
VOID\r
PrePiMain (\r
IN UINTN UefiMemoryBase,\r
+ IN UINTN StacksBase,\r
+ IN UINTN GlobalVariableBase,\r
IN UINT64 StartTimeStamp\r
)\r
{\r
EFI_STATUS Status;\r
CHAR8 Buffer[100];\r
UINTN CharCount;\r
- UINTN UefiMemoryTop;\r
UINTN StacksSize;\r
- UINTN StacksBase;\r
\r
// Enable program flow prediction, if supported.\r
ArmEnableBranchPrediction ();\r
// Initialize the Debug Agent for Source Level Debugging\r
InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);\r
SaveAndSetDebugTimerInterrupt (TRUE);\r
-\r
- UefiMemoryTop = UefiMemoryBase + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize);\r
- StacksBase = UefiMemoryTop - StacksSize;\r
-\r
- // Check the PcdCPUCoresNonSecStackBase match with the calculated StackBase\r
- ASSERT (StacksBase == PcdGet32 (PcdCPUCoresNonSecStackBase));\r
\r
// Declare the PI/UEFI memory region\r
HobList = HobConstructor (\r
VOID\r
CEntryPoint (\r
IN UINTN MpId,\r
- IN UINTN UefiMemoryBase\r
+ IN UINTN UefiMemoryBase,\r
+ IN UINTN StacksBase,\r
+ IN UINTN GlobalVariableBase\r
)\r
{\r
UINT64 StartTimeStamp;\r
// If not primary Jump to Secondary Main\r
if (IS_PRIMARY_CORE(MpId)) {\r
// Goto primary Main.\r
- PrimaryMain (UefiMemoryBase, StartTimeStamp);\r
+ PrimaryMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
} else {\r
SecondaryMain (MpId);\r
}\r
VOID\r
PrePiMain (\r
IN UINTN UefiMemoryBase,\r
+ IN UINTN StacksBase,\r
+ IN UINTN GlobalVariableBase,\r
IN UINT64 StartTimeStamp\r
);\r
\r
VOID\r
PrimaryMain (\r
IN UINTN UefiMemoryBase,\r
+ IN UINTN StacksBase,\r
+ IN UINTN GlobalVariableBase,\r
IN UINT64 StartTimeStamp\r
);\r
\r
\r
[LibraryClasses.common.SEC]\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf\r
+ \r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
# DEBUG_LOADFILE 0x00020000 // UNDI Driver\r
# DEBUG_EVENT 0x00080000 // Event messages\r
# DEBUG_ERROR 0x80000000 // Error\r
-\r
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F\r
\r
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07\r
#\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
\r
- gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackBase|0x87FE0000 # stack at top of memory\r
- gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackSize|0x20000 # 128K stack\r
-\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000\r
\r
gEmbeddedTokenSpaceGuid.PcdMemoryBase|0x80000000\r
gEmbeddedTokenSpaceGuid.PcdMemorySize|0x10000000\r
\r
-\r
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80008000\r
gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000\r
\r