summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 23:07:55 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 23:07:55 +0000
commitc524ffbb6762dd7b98108638caa4a25eaf7fcf6b (patch)
treec123ebdb7c4d168677fc85c04981ab85250e2c36 /ArmPlatformPkg
parent009f583fa00404ea243cc5b75f1a4ea4f6bc0c18 (diff)
ArmPlatformPkg/PrePi: Removed the dependency on 'PcdCPUCoresNonSecStackBase'
In PrePi the StackBase is automatically calculated from the top of the memory. The information is now passed from the assembly files to the C code. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12418 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/PrePi/MainMPCore.c4
-rw-r--r--ArmPlatformPkg/PrePi/MainUniCore.c4
-rwxr-xr-xArmPlatformPkg/PrePi/ModuleEntryPoint.S11
-rw-r--r--ArmPlatformPkg/PrePi/ModuleEntryPoint.asm11
-rwxr-xr-xArmPlatformPkg/PrePi/PrePi.c16
-rw-r--r--ArmPlatformPkg/PrePi/PrePi.h4
6 files changed, 34 insertions, 16 deletions
diff --git a/ArmPlatformPkg/PrePi/MainMPCore.c b/ArmPlatformPkg/PrePi/MainMPCore.c
index 2f1f86a4b..139b60289 100644
--- a/ArmPlatformPkg/PrePi/MainMPCore.c
+++ b/ArmPlatformPkg/PrePi/MainMPCore.c
@@ -21,6 +21,8 @@
VOID
PrimaryMain (
IN UINTN UefiMemoryBase,
+ IN UINTN StacksBase,
+ IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp
)
{
@@ -33,7 +35,7 @@ PrimaryMain (
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);
}
- PrePiMain (UefiMemoryBase, StartTimeStamp);
+ PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
// We must never return
ASSERT(FALSE);
diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c b/ArmPlatformPkg/PrePi/MainUniCore.c
index f1dff8af3..e56697ca5 100644
--- a/ArmPlatformPkg/PrePi/MainUniCore.c
+++ b/ArmPlatformPkg/PrePi/MainUniCore.c
@@ -17,10 +17,12 @@
VOID
PrimaryMain (
IN UINTN UefiMemoryBase,
+ IN UINTN StacksBase,
+ IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp
)
{
- PrePiMain (UefiMemoryBase, StartTimeStamp);
+ PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
// We must never return
ASSERT(FALSE);
diff --git a/ArmPlatformPkg/PrePi/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/ModuleEntryPoint.S
index 601128b12..d7c4e2e00 100755
--- a/ArmPlatformPkg/PrePi/ModuleEntryPoint.S
+++ b/ArmPlatformPkg/PrePi/ModuleEntryPoint.S
@@ -133,14 +133,21 @@ _InitGlobals:
_PrepareArguments:
+ mov r0, r5
+ mov r1, r6
+ mov r2, r7
+ mov r3, sp
+
// Move sec startup address into a data register
// Ensure we're jumping to FV version of the code (not boot remapped alias)
- ldr r2, StartupAddr
+ ldr r4, StartupAddr
// Jump to PrePiCore C code
// r0 = MpId
// r1 = UefiMemoryBase
- blx r2
+ // r2 = StacksBase
+ // r3 = GlobalVariableBase
+ blx r4
_NeverReturn:
b _NeverReturn
diff --git a/ArmPlatformPkg/PrePi/ModuleEntryPoint.asm b/ArmPlatformPkg/PrePi/ModuleEntryPoint.asm
index 2c798d09d..5b56e66b9 100644
--- a/ArmPlatformPkg/PrePi/ModuleEntryPoint.asm
+++ b/ArmPlatformPkg/PrePi/ModuleEntryPoint.asm
@@ -134,14 +134,21 @@ _InitGlobals
_PrepareArguments
+ mov r0, r5
+ mov r1, r6
+ mov r2, r7
+ mov r3, sp
+
// Move sec startup address into a data register
// Ensure we're jumping to FV version of the code (not boot remapped alias)
- ldr r2, StartupAddr
+ ldr r4, StartupAddr
// Jump to PrePiCore C code
// r0 = MpId
// r1 = UefiMemoryBase
- blx r2
+ // r2 = StacksBase
+ // r3 = GlobalVariableBase
+ blx r4
_NeverReturn
b _NeverReturn
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index 64c371c80..2ca9c3b8f 100755
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -51,6 +51,8 @@ LzmaDecompressLibConstructor (
VOID
PrePiMain (
IN UINTN UefiMemoryBase,
+ IN UINTN StacksBase,
+ IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp
)
{
@@ -58,9 +60,7 @@ PrePiMain (
EFI_STATUS Status;
CHAR8 Buffer[100];
UINTN CharCount;
- UINTN UefiMemoryTop;
UINTN StacksSize;
- UINTN StacksBase;
// Enable program flow prediction, if supported.
ArmEnableBranchPrediction ();
@@ -77,12 +77,6 @@ PrePiMain (
// Initialize the Debug Agent for Source Level Debugging
InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
SaveAndSetDebugTimerInterrupt (TRUE);
-
- UefiMemoryTop = UefiMemoryBase + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize);
- StacksBase = UefiMemoryTop - StacksSize;
-
- // Check the PcdCPUCoresNonSecStackBase match with the calculated StackBase
- ASSERT (StacksBase == PcdGet32 (PcdCPUCoresNonSecStackBase));
// Declare the PI/UEFI memory region
HobList = HobConstructor (
@@ -137,7 +131,9 @@ PrePiMain (
VOID
CEntryPoint (
IN UINTN MpId,
- IN UINTN UefiMemoryBase
+ IN UINTN UefiMemoryBase,
+ IN UINTN StacksBase,
+ IN UINTN GlobalVariableBase
)
{
UINT64 StartTimeStamp;
@@ -170,7 +166,7 @@ CEntryPoint (
// If not primary Jump to Secondary Main
if (IS_PRIMARY_CORE(MpId)) {
// Goto primary Main.
- PrimaryMain (UefiMemoryBase, StartTimeStamp);
+ PrimaryMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
} else {
SecondaryMain (MpId);
}
diff --git a/ArmPlatformPkg/PrePi/PrePi.h b/ArmPlatformPkg/PrePi/PrePi.h
index 9cf953a79..59f597123 100644
--- a/ArmPlatformPkg/PrePi/PrePi.h
+++ b/ArmPlatformPkg/PrePi/PrePi.h
@@ -44,6 +44,8 @@ TimerConstructor (
VOID
PrePiMain (
IN UINTN UefiMemoryBase,
+ IN UINTN StacksBase,
+ IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp
);
@@ -63,6 +65,8 @@ PlatformPeim (
VOID
PrimaryMain (
IN UINTN UefiMemoryBase,
+ IN UINTN StacksBase,
+ IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp
);