summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Sec/SecMain.c
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-16 23:29:17 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-16 23:29:17 +0000
commit0913fadc1af9edf545d5dd4120e0a708dfb73af0 (patch)
tree268f0551065ff5347bdeff734b336f191a19e830 /OvmfPkg/Sec/SecMain.c
parent7a55c43b072ec2192d35df5e44cf37eb8be06555 (diff)
downloadedk2-0913fadc1af9edf545d5dd4120e0a708dfb73af0.tar.gz
edk2-0913fadc1af9edf545d5dd4120e0a708dfb73af0.tar.bz2
edk2-0913fadc1af9edf545d5dd4120e0a708dfb73af0.zip
OVMF SEC: Modify to match new interface of reset vector module
Previously the interface to the SEC module was: ESI/RSI - SEC Core entry point EDI/RDI - PEI Core entry point EBP/RBP - Start of BFV Now it is: RAX/EAX Initial value of the EAX register (BIST: Built-in Self Test) DI 'BP': boot-strap processor, or 'AP': application processor RBP/EBP Address of Boot Firmware Volume (BFV) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9572 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Sec/SecMain.c')
-rw-r--r--OvmfPkg/Sec/SecMain.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
index 832c0e8a37..99d21f3d95 100644
--- a/OvmfPkg/Sec/SecMain.c
+++ b/OvmfPkg/Sec/SecMain.c
@@ -61,10 +61,8 @@ InitializeIdtPtr (
VOID
EFIAPI
SecCoreStartupWithStack (
- IN VOID *BootFirmwareVolumePtr,
- IN VOID *SecCoreEntryPoint,
- IN VOID *PeiCoreEntryPoint,
- IN VOID *TopOfCurrentStack
+ IN EFI_FIRMWARE_VOLUME_HEADER *BootFirmwareVolumePtr,
+ IN VOID *TopOfCurrentStack
)
{
EFI_SEC_PEI_HAND_OFF *SecCoreData;
@@ -72,6 +70,7 @@ SecCoreStartupWithStack (
UINT8 *TopOfTempRam;
UINTN SizeOfTempRam;
VOID *IdtPtr;
+ VOID *PeiCoreEntryPoint;
//
// Initialize floating point operating environment
@@ -79,14 +78,12 @@ SecCoreStartupWithStack (
//
InitializeFloatingPointUnits ();
- DEBUG ((EFI_D_ERROR,
- "SecCoreStartupWithStack(0x%x, 0x%x, 0x%x, 0x%x)\n",
+ DEBUG ((EFI_D_INFO,
+ "SecCoreStartupWithStack(0x%x, 0x%x)\n",
(UINT32)(UINTN)BootFirmwareVolumePtr,
- (UINT32)(UINTN)SecCoreEntryPoint,
- (UINT32)(UINTN)PeiCoreEntryPoint,
- (UINT32)(UINTN)TopOfCurrentStack));
+ (UINT32)(UINTN)TopOfCurrentStack
+ ));
-
BottomOfTempRam = (UINT8*)(UINTN) INITIAL_TOP_OF_STACK;
SizeOfTempRam = (UINTN) SIZE_64KB;
TopOfTempRam = BottomOfTempRam + SizeOfTempRam;
@@ -127,20 +124,31 @@ SecCoreStartupWithStack (
IdtPtr = ALIGN_POINTER(IdtPtr, 16);
InitializeIdtPtr (IdtPtr);
- //
- // Transfer control to the PEI Core
- //
- PeiSwitchStacks (
- (SWITCH_STACK_ENTRY_POINT) (UINTN) PeiCoreEntryPoint,
- SecCoreData,
- (VOID *) (UINTN) ((EFI_PEI_PPI_DESCRIPTOR *) &mPrivateDispatchTable),
- NULL,
- TopOfCurrentStack,
- (VOID *)((UINTN)SecCoreData->StackBase + SecCoreData->StackSize)
- );
+ FindPeiCoreEntryPoint (BootFirmwareVolumePtr, &PeiCoreEntryPoint);
+
+ if (PeiCoreEntryPoint != NULL) {
+ DEBUG ((EFI_D_INFO,
+ "Calling PEI Core entry point at 0x%x\n",
+ PeiCoreEntryPoint
+ ));
+ //
+ // Transfer control to the PEI Core
+ //
+ PeiSwitchStacks (
+ (SWITCH_STACK_ENTRY_POINT) (UINTN) PeiCoreEntryPoint,
+ SecCoreData,
+ (VOID *) (UINTN) ((EFI_PEI_PPI_DESCRIPTOR *) &mPrivateDispatchTable),
+ NULL,
+ TopOfCurrentStack,
+ (VOID *)((UINTN)SecCoreData->StackBase + SecCoreData->StackSize)
+ );
+ }
//
- // If we get here, then the PEI Core returned. This is an error
+ // If we get here, then either we couldn't locate the PEI Core, or
+ // the PEI Core returned.
+ //
+ // Both of these errors are unrecoverable.
//
ASSERT (FALSE);
CpuDeadLoop ();