IMPORT ArmReadMpidr\r
IMPORT ArmPlatformPeiBootAction\r
IMPORT ArmPlatformStackSet\r
+ IMPORT mSystemMemoryEnd\r
\r
EXPORT _ModuleEntryPoint\r
- EXPORT mSystemMemoryEnd\r
\r
PRESERVE8\r
AREA PrePiCoreEntryPoint, CODE, READONLY\r
\r
StartupAddr DCD CEntryPoint\r
-mSystemMemoryEnd DCQ 0\r
\r
_ModuleEntryPoint\r
// Do early platform specific actions\r
// to install the stacks at the bottom of the Firmware Device (case the FD is located\r
// at the top of the DRAM)\r
_SystemMemoryEndInit\r
- ldr r1, mSystemMemoryEnd\r
-\r
- // Is mSystemMemoryEnd initialized?\r
- cmp r1, #0\r
- bne _SetupStackPosition\r
-\r
- mov32 r1, FixedPcdGet32(PcdSystemMemoryBase)\r
- mov32 r2, FixedPcdGet32(PcdSystemMemorySize)\r
- sub r2, r2, #1\r
- add r1, r1, r2\r
- // Update the global variable\r
- adr r2, mSystemMemoryEnd\r
- str r1, [r2]\r
+ mov32 r1, mSystemMemoryEnd\r
+ ldrd r2, r3, [r1]\r
+ teq r3, #0\r
+ moveq r1, r2\r
+ mvnne r1, #0\r
\r
_SetupStackPosition\r
// r1 = SystemMemoryTop\r