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
This commit is contained in:
oliviermartin 2011-09-22 23:07:55 +00:00
parent 009f583fa0
commit c524ffbb67
7 changed files with 35 additions and 21 deletions

View File

@ -21,6 +21,8 @@
VOID VOID
PrimaryMain ( PrimaryMain (
IN UINTN UefiMemoryBase, IN UINTN UefiMemoryBase,
IN UINTN StacksBase,
IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp IN UINT64 StartTimeStamp
) )
{ {
@ -33,7 +35,7 @@ PrimaryMain (
ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E); ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);
} }
PrePiMain (UefiMemoryBase, StartTimeStamp); PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
// We must never return // We must never return
ASSERT(FALSE); ASSERT(FALSE);

View File

@ -17,10 +17,12 @@
VOID VOID
PrimaryMain ( PrimaryMain (
IN UINTN UefiMemoryBase, IN UINTN UefiMemoryBase,
IN UINTN StacksBase,
IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp IN UINT64 StartTimeStamp
) )
{ {
PrePiMain (UefiMemoryBase, StartTimeStamp); PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
// We must never return // We must never return
ASSERT(FALSE); ASSERT(FALSE);

View File

@ -133,14 +133,21 @@ _InitGlobals:
_PrepareArguments: _PrepareArguments:
mov r0, r5
mov r1, r6
mov r2, r7
mov r3, sp
// Move sec startup address into a data register // Move sec startup address into a data register
// Ensure we're jumping to FV version of the code (not boot remapped alias) // 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 // Jump to PrePiCore C code
// r0 = MpId // r0 = MpId
// r1 = UefiMemoryBase // r1 = UefiMemoryBase
blx r2 // r2 = StacksBase
// r3 = GlobalVariableBase
blx r4
_NeverReturn: _NeverReturn:
b _NeverReturn b _NeverReturn

View File

@ -134,14 +134,21 @@ _InitGlobals
_PrepareArguments _PrepareArguments
mov r0, r5
mov r1, r6
mov r2, r7
mov r3, sp
// Move sec startup address into a data register // Move sec startup address into a data register
// Ensure we're jumping to FV version of the code (not boot remapped alias) // 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 // Jump to PrePiCore C code
// r0 = MpId // r0 = MpId
// r1 = UefiMemoryBase // r1 = UefiMemoryBase
blx r2 // r2 = StacksBase
// r3 = GlobalVariableBase
blx r4
_NeverReturn _NeverReturn
b _NeverReturn b _NeverReturn

View File

@ -51,6 +51,8 @@ LzmaDecompressLibConstructor (
VOID VOID
PrePiMain ( PrePiMain (
IN UINTN UefiMemoryBase, IN UINTN UefiMemoryBase,
IN UINTN StacksBase,
IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp IN UINT64 StartTimeStamp
) )
{ {
@ -58,9 +60,7 @@ PrePiMain (
EFI_STATUS Status; EFI_STATUS Status;
CHAR8 Buffer[100]; CHAR8 Buffer[100];
UINTN CharCount; UINTN CharCount;
UINTN UefiMemoryTop;
UINTN StacksSize; UINTN StacksSize;
UINTN StacksBase;
// Enable program flow prediction, if supported. // Enable program flow prediction, if supported.
ArmEnableBranchPrediction (); ArmEnableBranchPrediction ();
@ -78,12 +78,6 @@ PrePiMain (
InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL); InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
SaveAndSetDebugTimerInterrupt (TRUE); 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 // Declare the PI/UEFI memory region
HobList = HobConstructor ( HobList = HobConstructor (
(VOID*)UefiMemoryBase, (VOID*)UefiMemoryBase,
@ -137,7 +131,9 @@ PrePiMain (
VOID VOID
CEntryPoint ( CEntryPoint (
IN UINTN MpId, IN UINTN MpId,
IN UINTN UefiMemoryBase IN UINTN UefiMemoryBase,
IN UINTN StacksBase,
IN UINTN GlobalVariableBase
) )
{ {
UINT64 StartTimeStamp; UINT64 StartTimeStamp;
@ -170,7 +166,7 @@ CEntryPoint (
// If not primary Jump to Secondary Main // If not primary Jump to Secondary Main
if (IS_PRIMARY_CORE(MpId)) { if (IS_PRIMARY_CORE(MpId)) {
// Goto primary Main. // Goto primary Main.
PrimaryMain (UefiMemoryBase, StartTimeStamp); PrimaryMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);
} else { } else {
SecondaryMain (MpId); SecondaryMain (MpId);
} }

View File

@ -44,6 +44,8 @@ TimerConstructor (
VOID VOID
PrePiMain ( PrePiMain (
IN UINTN UefiMemoryBase, IN UINTN UefiMemoryBase,
IN UINTN StacksBase,
IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp IN UINT64 StartTimeStamp
); );
@ -63,6 +65,8 @@ PlatformPeim (
VOID VOID
PrimaryMain ( PrimaryMain (
IN UINTN UefiMemoryBase, IN UINTN UefiMemoryBase,
IN UINTN StacksBase,
IN UINTN GlobalVariableBase,
IN UINT64 StartTimeStamp IN UINT64 StartTimeStamp
); );

View File

@ -124,6 +124,7 @@
[LibraryClasses.common.SEC] [LibraryClasses.common.SEC]
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
@ -293,7 +294,6 @@
# DEBUG_LOADFILE 0x00020000 // UNDI Driver # DEBUG_LOADFILE 0x00020000 // UNDI Driver
# DEBUG_EVENT 0x00080000 // Event messages # DEBUG_EVENT 0x00080000 // Event messages
# DEBUG_ERROR 0x80000000 // Error # DEBUG_ERROR 0x80000000 // Error
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
@ -331,9 +331,6 @@
# #
gArmTokenSpaceGuid.PcdVFPEnabled|1 gArmTokenSpaceGuid.PcdVFPEnabled|1
gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackBase|0x87FE0000 # stack at top of memory
gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackSize|0x20000 # 128K stack
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000
gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000 gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000
@ -354,7 +351,6 @@
gEmbeddedTokenSpaceGuid.PcdMemoryBase|0x80000000 gEmbeddedTokenSpaceGuid.PcdMemoryBase|0x80000000
gEmbeddedTokenSpaceGuid.PcdMemorySize|0x10000000 gEmbeddedTokenSpaceGuid.PcdMemorySize|0x10000000
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80008000 gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80008000
gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000 gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000