]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Sec/SecMain.c
Update the copyright notice format
[mirror_edk2.git] / OvmfPkg / Sec / SecMain.c
index 99d21f3d95120469ecd2ce8f6e270879f84d49c2..275d8e492a7292b83f10bc8045c91491e22e7b6e 100644 (file)
@@ -1,9 +1,9 @@
 /** @file
   Main SEC phase code.  Transitions to PEI.
 
-  Copyright (c) 2008 - 2009, Intel Corporation
+  Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
 
-  All rights reserved. This program and the accompanying materials
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -17,6 +17,7 @@
 #include <Library/BaseLib.h>
 #include <Library/DebugLib.h>
 #include <Library/BaseMemoryLib.h>
+#include <Library/PeimEntryPoint.h>
 #include <Library/PeiServicesLib.h>
 #include <Ppi/TemporaryRamSupport.h>
 #include <Library/PcdLib.h>
@@ -61,7 +62,7 @@ InitializeIdtPtr (
 VOID
 EFIAPI
 SecCoreStartupWithStack (
-  IN EFI_FIRMWARE_VOLUME_HEADER       *BootFirmwareVolumePtr,
+  IN EFI_FIRMWARE_VOLUME_HEADER       *BootFv,
   IN VOID                             *TopOfCurrentStack
   )
 {
@@ -72,18 +73,20 @@ SecCoreStartupWithStack (
   VOID                        *IdtPtr;
   VOID                        *PeiCoreEntryPoint;
 
+  DEBUG ((EFI_D_INFO,
+    "SecCoreStartupWithStack(0x%x, 0x%x)\n",
+    (UINT32)(UINTN)BootFv,
+    (UINT32)(UINTN)TopOfCurrentStack
+    ));
+
+  ProcessLibraryConstructorList (NULL, NULL);
+
   //
   // Initialize floating point operating environment
   // to be compliant with UEFI spec.
   //
   InitializeFloatingPointUnits ();
 
-  DEBUG ((EFI_D_INFO,
-    "SecCoreStartupWithStack(0x%x, 0x%x)\n",
-    (UINT32)(UINTN)BootFirmwareVolumePtr,
-    (UINT32)(UINTN)TopOfCurrentStack
-    ));
-
   BottomOfTempRam = (UINT8*)(UINTN) INITIAL_TOP_OF_STACK;
   SizeOfTempRam = (UINTN) SIZE_64KB;
   TopOfTempRam = BottomOfTempRam + SizeOfTempRam;
@@ -104,9 +107,6 @@ SecCoreStartupWithStack (
   SecCoreData = (EFI_SEC_PEI_HAND_OFF*)((UINTN) TopOfTempRam - SIZE_4KB);
   SecCoreData->DataSize = sizeof(EFI_SEC_PEI_HAND_OFF);
 
-  SecCoreData->BootFirmwareVolumeBase = (VOID*)(UINTN) PcdGet32 (PcdOvmfFlashFvRecoveryBase);
-  SecCoreData->BootFirmwareVolumeSize = PcdGet32 (PcdOvmfFlashFvRecoverySize);
-
   SecCoreData->TemporaryRamBase       = (VOID*) BottomOfTempRam;
   SecCoreData->TemporaryRamSize       = SizeOfTempRam;
 
@@ -124,7 +124,10 @@ SecCoreStartupWithStack (
   IdtPtr = ALIGN_POINTER(IdtPtr, 16);
   InitializeIdtPtr (IdtPtr);
 
-  FindPeiCoreEntryPoint (BootFirmwareVolumePtr, &PeiCoreEntryPoint);
+  FindPeiCoreEntryPoint (&BootFv, &PeiCoreEntryPoint);
+
+  SecCoreData->BootFirmwareVolumeBase = BootFv;
+  SecCoreData->BootFirmwareVolumeSize = (UINTN) BootFv->FvLength;
 
   if (PeiCoreEntryPoint != NULL) {
     DEBUG ((EFI_D_INFO,