summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Sec/SecMain.c
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-04 16:17:59 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-04 16:17:59 +0000
commitc1c2669c6bb3ed4e23c06a93e60450a4fc3eccf2 (patch)
tree844feddcd621f20d1d6e27eb3efc0bc437367112 /OvmfPkg/Sec/SecMain.c
parent8cf01cae78c1e7b823587aac1b672a8c5adccaa9 (diff)
downloadedk2-c1c2669c6bb3ed4e23c06a93e60450a4fc3eccf2.tar.gz
edk2-c1c2669c6bb3ed4e23c06a93e60450a4fc3eccf2.tar.bz2
edk2-c1c2669c6bb3ed4e23c06a93e60450a4fc3eccf2.zip
OVMF: Update OVMF FD/FV build to minimize ROM size
* Only SEC is uncompressed now * The MAIN FV with PEI & DXE can easily shrink and grow as needed * The final output will now be OVMF.Fv rather than OVMF.fd * The final output size will be a multiple of 64kb git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9672 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Sec/SecMain.c')
-rw-r--r--OvmfPkg/Sec/SecMain.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
index 99d21f3d95..58da92b086 100644
--- a/OvmfPkg/Sec/SecMain.c
+++ b/OvmfPkg/Sec/SecMain.c
@@ -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 = BootFv->FvLength;
if (PeiCoreEntryPoint != NULL) {
DEBUG ((EFI_D_INFO,