Recording the top of SEC visible system memory in a global variable is
not necessary, and violates the constraints of the SEC/PEI environment,
given that it may execute from NOR flash. So remove it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
\r
#include <AsmMacroIoLibV8.h>\r
\r
\r
#include <AsmMacroIoLibV8.h>\r
\r
-ASM_GLOBAL ASM_PFX(mSystemMemoryEnd)\r
-\r
ASM_FUNC(_ModuleEntryPoint)\r
//\r
// We are built as a ET_DYN PIE executable, so we need to process all\r
ASM_FUNC(_ModuleEntryPoint)\r
//\r
// We are built as a ET_DYN PIE executable, so we need to process all\r
ldr x2, PcdGet64 (PcdSystemMemorySize)\r
sub x2, x2, #1\r
add x1, x1, x2 // x1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize\r
ldr x2, PcdGet64 (PcdSystemMemorySize)\r
sub x2, x2, #1\r
add x1, x1, x2 // x1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize\r
- adr x2, mSystemMemoryEnd\r
- str x1, [x2]\r
\r
// Calculate Top of the Firmware Device\r
ldr x2, PcdGet64 (PcdFdBaseAddress)\r
\r
// Calculate Top of the Firmware Device\r
ldr x2, PcdGet64 (PcdFdBaseAddress)\r
\r
_NeverReturn:\r
b _NeverReturn\r
\r
_NeverReturn:\r
b _NeverReturn\r
-\r
-ASM_PFX(mSystemMemoryEnd): .8byte 0\r
\r
#include <AsmMacroIoLib.h>\r
\r
\r
#include <AsmMacroIoLib.h>\r
\r
-ASM_GLOBAL ASM_PFX(mSystemMemoryEnd)\r
-\r
ASM_FUNC(_ModuleEntryPoint)\r
//\r
// We are built as a ET_DYN PIE executable, so we need to process all\r
ASM_FUNC(_ModuleEntryPoint)\r
//\r
// We are built as a ET_DYN PIE executable, so we need to process all\r
ADRL (r12, PcdGet64 (PcdSystemMemorySize))\r
ldrd r2, r3, [r12]\r
\r
ADRL (r12, PcdGet64 (PcdSystemMemorySize))\r
ldrd r2, r3, [r12]\r
\r
- // calculate the top of memory, and record it in mSystemMemoryEnd\r
+ // calculate the top of memory\r
adds r2, r2, r1\r
sub r2, r2, #1\r
addcs r3, r3, #1\r
adds r2, r2, r1\r
sub r2, r2, #1\r
addcs r3, r3, #1\r
- adr r12, mSystemMemoryEnd\r
- strd r2, r3, [r12]\r
\r
// truncate the memory used by UEFI to 4 GB range\r
teq r3, #0\r
\r
// truncate the memory used by UEFI to 4 GB range\r
teq r3, #0\r
\r
_NeverReturn:\r
b _NeverReturn\r
\r
_NeverReturn:\r
b _NeverReturn\r
-\r
-ASM_PFX(mSystemMemoryEnd): .quad 0\r
\r
#define SerialPrint(txt) SerialPortWrite (txt, AsciiStrLen(txt)+1);\r
\r
\r
#define SerialPrint(txt) SerialPortWrite (txt, AsciiStrLen(txt)+1);\r
\r
-extern UINT64 mSystemMemoryEnd;\r
-\r
RETURN_STATUS\r
EFIAPI\r
TimerConstructor (\r
RETURN_STATUS\r
EFIAPI\r
TimerConstructor (\r