From 3d7b0992fccc89cc049de91d02b4869ec81cf9fb Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 28 Sep 2007 08:14:30 +0000 Subject: 1. Replace PeCoffLoader library by PeCoff lib for PeiCore, DxeIpl and DxeMain. 2. Add three PeCoff library instances for NT32 PeImage load. 3. Update PeCoffGetEntryPointLib to support TeImage. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3965 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/DxeMain.h | 1 + MdeModulePkg/Core/Dxe/DxeMain.inf | 2 +- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 4 ---- MdeModulePkg/Core/Dxe/Image/Image.c | 8 ++++---- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'MdeModulePkg/Core/Dxe') diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h index c5c4f34c49..ed531f7bcc 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -82,6 +82,7 @@ Revision History #include #include #include +#include #include "DebugImageInfo.h" #include "Library.h" diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf index 3b8519b6db..9d6ecd0fba 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -78,7 +78,6 @@ [LibraryClasses] BaseMemoryLib CacheMaintenanceLib - PeCoffLoaderLib UefiDecompressLib CustomDecompressLib PerformanceLib @@ -87,6 +86,7 @@ UefiLib DebugLib DxeCoreEntryPoint + PeCoffLib [Guids] gEfiEventLegacyBootGuid # ALWAYS_CONSUMED diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 26bc94c13f..53f1d5f594 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -25,7 +25,6 @@ Abstract: // DXE Core Global Variables for Protocols from PEI // EFI_HANDLE mDecompressHandle = NULL; -EFI_PEI_PE_COFF_LOADER_PROTOCOL *gEfiPeiPeCoffLoader = NULL; // // DXE Core globals for Architecture Protocols @@ -370,9 +369,6 @@ Returns: ); ASSERT_EFI_ERROR (Status); - gEfiPeiPeCoffLoader = GetPeCoffLoaderProtocol (); - ASSERT (gEfiPeiPeCoffLoader != NULL); - // // Register for the GUIDs of the Architectural Protocols, so the rest of the // EFI Boot Services and EFI Runtime Services tables can be filled in. diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index e227f3a6bf..9232cabcef 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -213,7 +213,7 @@ Returns: // // Get information about the image being loaded // - Status = gEfiPeiPeCoffLoader->GetImageInfo (gEfiPeiPeCoffLoader, &Image->ImageContext); + Status = PeCoffLoaderGetImageInfo (&Image->ImageContext); if (EFI_ERROR (Status)) { return Status; } @@ -305,7 +305,7 @@ Returns: // // Load the image from the file into the allocated memory // - Status = gEfiPeiPeCoffLoader->LoadImage (gEfiPeiPeCoffLoader, &Image->ImageContext); + Status = PeCoffLoaderLoadImage (&Image->ImageContext); if (EFI_ERROR (Status)) { goto Done; } @@ -328,7 +328,7 @@ Returns: // // Relocate the image in memory // - Status = gEfiPeiPeCoffLoader->RelocateImage (gEfiPeiPeCoffLoader, &Image->ImageContext); + Status = PeCoffLoaderRelocateImage (&Image->ImageContext); if (EFI_ERROR (Status)) { goto Done; } @@ -1085,7 +1085,7 @@ Returns: // // Unload image, free Image->ImageContext->ModHandle // - gEfiPeiPeCoffLoader->UnloadImage (gEfiPeiPeCoffLoader, &Image->ImageContext); + PeCoffLoaderUnloadImage (&Image->ImageContext); // // Free our references to the image handle -- cgit v1.2.3