summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-28 08:14:30 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-28 08:14:30 +0000
commit3d7b0992fccc89cc049de91d02b4869ec81cf9fb (patch)
treee3731a47419ab758cb9c5d37137d0ab169dc82be /MdeModulePkg
parent64253026df2cc1538eb05c9dc2a5403e54ae1af2 (diff)
downloadedk2-3d7b0992fccc89cc049de91d02b4869ec81cf9fb.tar.gz
edk2-3d7b0992fccc89cc049de91d02b4869ec81cf9fb.tar.bz2
edk2-3d7b0992fccc89cc049de91d02b4869ec81cf9fb.zip
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.h1
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.inf2
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c4
-rw-r--r--MdeModulePkg/Core/Dxe/Image/Image.c8
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf2
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeLoad.c24
-rw-r--r--MdeModulePkg/Core/Pei/Image/Image.c226
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.h2
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.inf3
-rw-r--r--MdeModulePkg/MdeModulePkg.dsc4
10 files changed, 60 insertions, 216 deletions
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 <Library/PeCoffLoaderLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/BaseMemoryLib.h>
+#include <Library/PeCoffLib.h>
#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
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 3267a8cba0..8115a4a310 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -67,7 +67,6 @@
PeiServicesTablePointerLib
CustomDecompressLib
UefiDecompressLib
- PeCoffLoaderLib
CacheMaintenanceLib
ReportStatusCodeLib
PeiServicesLib
@@ -90,7 +89,6 @@
gEfiPeiSectionExtractionPpiGuid # PPI SOMETIMES_CONSUMED
gEfiEndOfPeiSignalPpiGuid # PPI SOMETIMES_PRODUCED
gEfiDxeIplPpiGuid # PPI SOMETIMES_PRODUCED
- gEfiPeiPeCoffLoaderGuid
gEfiPeiDecompressPpiGuid
gEfiPeiFirmwareVolumeInfoPpiGuid
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index a81475484f..cb13a7d4b0 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -174,7 +174,6 @@ DxeLoadCore (
EFI_PHYSICAL_ADDRESS DxeCoreAddress;
UINT64 DxeCoreSize;
EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint;
- EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
EFI_BOOT_MODE BootMode;
EFI_PEI_FV_HANDLE VolumeHandle;
EFI_PEI_FILE_HANDLE FileHandle;
@@ -200,12 +199,6 @@ DxeLoadCore (
// Now should have a HOB with the DXE core w/ the old HOB destroyed
//
}
-
- //
- // Install the PEI Protocols that are shared between PEI and DXE
- //
- PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *) GetPeCoffLoaderProtocol ();
- ASSERT (PeiEfiPeiPeCoffLoader != NULL);
//
// If any FV contains an encapsulated FV extract that FV
@@ -244,14 +237,6 @@ DxeLoadCore (
);
//
- // Add HOB for the PE/COFF Loader Protocol
- //
- BuildGuidDataHob (
- &gEfiPeiPeCoffLoaderGuid,
- (VOID *)&PeiEfiPeiPeCoffLoader,
- sizeof (VOID *)
- );
- //
// Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
//
REPORT_STATUS_CODE (
@@ -456,9 +441,6 @@ PeiLoadFile (
EFI_STATUS Status;
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
VOID *Pe32Data;
- EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
-
- PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
//
// First try to find the required section in this ffs file.
//
@@ -489,7 +471,7 @@ PeiLoadFile (
ASSERT_EFI_ERROR (Status);
- Status = PeiEfiPeiPeCoffLoader->GetImageInfo (PeiEfiPeiPeCoffLoader, &ImageContext);
+ Status = PeCoffLoaderGetImageInfo (&ImageContext);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -502,14 +484,14 @@ PeiLoadFile (
//
// Load the image to our new buffer
//
- Status = PeiEfiPeiPeCoffLoader->LoadImage (PeiEfiPeiPeCoffLoader, &ImageContext);
+ Status = PeCoffLoaderLoadImage (&ImageContext);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Relocate the image in our new buffer
//
- Status = PeiEfiPeiPeCoffLoader->RelocateImage (PeiEfiPeiPeCoffLoader, &ImageContext);
+ Status = PeCoffLoaderRelocateImage (&ImageContext);
if (EFI_ERROR (Status)) {
return Status;
}
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c
index ebe79a6c50..a430d3ea7a 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -195,7 +195,6 @@ Returns:
STATIC
EFI_STATUS
LoadAndRelocatePeCoffImage (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,
IN VOID *Pe32Data,
OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
OUT UINT64 *ImageSize,
@@ -209,8 +208,6 @@ Routine Description:
Arguments:
- PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol
-
Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
ImageAddress - The base address of the relocated PE/COFF image
@@ -230,15 +227,13 @@ Returns:
EFI_STATUS Status;
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
- ASSERT (PeiEfiPeiPeCoffLoader != NULL);
-
ZeroMem (&ImageContext, sizeof (ImageContext));
ImageContext.Handle = Pe32Data;
Status = GetImageReadFunction (&ImageContext);
ASSERT_EFI_ERROR (Status);
- Status = PeiEfiPeiPeCoffLoader->GetImageInfo (PeiEfiPeiPeCoffLoader, &ImageContext);
+ Status = PeCoffLoaderGetImageInfo (&ImageContext);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -251,14 +246,14 @@ Returns:
//
// Load the image to our new buffer
//
- Status = PeiEfiPeiPeCoffLoader->LoadImage (PeiEfiPeiPeCoffLoader, &ImageContext);
+ Status = PeCoffLoaderLoadImage (&ImageContext);
if (EFI_ERROR (Status)) {
return Status;
}
//
// Relocate the image in our new buffer
//
- Status = PeiEfiPeiPeCoffLoader->RelocateImage (PeiEfiPeiPeCoffLoader, &ImageContext);
+ Status = PeCoffLoaderRelocateImage (&ImageContext);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -312,14 +307,12 @@ Returns:
EFI_PHYSICAL_ADDRESS ImageAddress;
UINT64 ImageSize;
EFI_PHYSICAL_ADDRESS ImageEntryPoint;
- EFI_TE_IMAGE_HEADER *TEImageHeader;
UINT16 Machine;
PEI_CORE_INSTANCE *Private;
VOID *EntryPointArg;
- *EntryPoint = 0;
- TEImageHeader = NULL;
- ImageSize = 0;
+ *EntryPoint = 0;
+ ImageSize = 0;
*AuthenticationState = 0;
//
@@ -330,11 +323,8 @@ Returns:
FileHandle,
&Pe32Data
);
- if (!EFI_ERROR (Status)) {
- TEImageHeader = (EFI_TE_IMAGE_HEADER *)Pe32Data;
- }
//
- // If we didn't find a PE32 section, try to find a TE section.
+ // If we didn't find a TE section, try to find a PE32 section.
//
if (EFI_ERROR (Status)) {
Status = PeiServicesFfsFindSectionData (
@@ -355,57 +345,38 @@ Returns:
if (Private->PeiMemoryInstalled &&
(Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
- {
- //
- // If memory is installed, perform the shadow operations
- //
- Status = LoadAndRelocatePeCoffImage (
- Private->PeCoffLoader,
- Pe32Data,
- &ImageAddress,
- &ImageSize,
- &ImageEntryPoint
- );
-
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
+ //
+ // If memory is installed, perform the shadow operations
+ //
+ Status = LoadAndRelocatePeCoffImage (
+ Pe32Data,
+ &ImageAddress,
+ &ImageSize,
+ &ImageEntryPoint
+ );
- //
- // Got the entry point from ImageEntryPoint and ImageStartAddress
- //
- Pe32Data = (VOID *) ((UINTN) ImageAddress);
- *EntryPoint = ImageEntryPoint;
+ if (EFI_ERROR (Status)) {
+ return Status;
}
+
+ //
+ // Got the entry point from the loaded Pe32Data
+ //
+ Pe32Data = (VOID *) ((UINTN) ImageAddress);
+ *EntryPoint = ImageEntryPoint;
} else {
- if (TEImageHeader != NULL) {
- //
- // Retrieve the entry point from the TE image header
- //
- ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) TEImageHeader;
- ImageSize = 0;
- *EntryPoint = (EFI_PHYSICAL_ADDRESS)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) +
- TEImageHeader->AddressOfEntryPoint - TEImageHeader->StrippedSize);
- } else {
- //
- // Retrieve the entry point from the PE/COFF image header
- //
- ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) Pe32Data;
- ImageSize = 0;
- Status = PeCoffLoaderGetEntryPoint (Pe32Data, &EntryPointArg);
- *EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) EntryPointArg;
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
+ //
+ // Retrieve the entry point from the PE/COFF or TE image header
+ //
+ ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) Pe32Data;
+ Status = PeCoffLoaderGetEntryPoint (Pe32Data, &EntryPointArg);
+ if (EFI_ERROR (Status)) {
+ return Status;
}
+ *EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) EntryPointArg;
}
-
- if (((EFI_TE_IMAGE_HEADER *) (UINTN) ImageAddress)->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- TEImageHeader = (EFI_TE_IMAGE_HEADER *) (UINTN) ImageAddress;
- Machine = TEImageHeader->Machine;
- } else {
- Machine = PeCoffLoaderGetMachineType (Pe32Data);
- }
+
+ Machine = PeCoffLoaderGetMachineType (Pe32Data);
if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Machine)) {
return EFI_UNSUPPORTED;
@@ -424,120 +395,29 @@ Returns:
//
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%08x EntryPoint=0x%08x ", (UINTN) ImageAddress, *EntryPoint));
DEBUG_CODE_BEGIN ();
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN DirCount;
- UINTN Index;
- UINTN Index1;
- BOOLEAN FileNameFound;
- CHAR8 *AsciiString;
- CHAR8 AsciiBuffer[512];
- VOID *CodeViewEntryPointer;
- INTN TEImageAdjust;
- EFI_IMAGE_DOS_HEADER *DosHeader;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- UINT32 NumberOfRvaAndSizes;
-
- Hdr.Pe32 = NULL;
- if (TEImageHeader == NULL) {
- DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + (UINTN)((DosHeader->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
- }
-
- //
- // Find the codeview info in the image and display the file name
- // being loaded.
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- DebugEntry = NULL;
- DirectoryEntry = NULL;
- NumberOfRvaAndSizes = 0;
- TEImageAdjust = 0;
+ CHAR8 *AsciiString;
+ CHAR8 AsciiBuffer[512];
+ INT32 Index;
+ INT32 Index1;
- if (TEImageHeader == NULL) {
- if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
- } else if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- //
- // Use PE32+ offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
- }
-
- if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- }
- } else {
- if (TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
- DirectoryEntry = &TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
- TEImageAdjust = sizeof (EFI_TE_IMAGE_HEADER) - TEImageHeader->StrippedSize;
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) TEImageHeader +
- TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +
- TEImageAdjust);
+ AsciiString = PeCoffLoaderGetPdbPointer (Pe32Data);
+
+ if (AsciiString != NULL) {
+ for (Index = AsciiStrLen (AsciiString) - 1; Index >= 0; Index --) {
+ if (AsciiString[Index] == '\\') {
+ break;
+ }
}
- }
- if (DebugEntry != NULL && DirectoryEntry != NULL) {
- for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {
- if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- if (DebugEntry->SizeOfData > 0) {
- CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + (UINTN) ImageAddress + (UINTN)TEImageAdjust);
- switch (* (UINT32 *) CodeViewEntryPointer) {
- case CODEVIEW_SIGNATURE_NB10:
- AsciiString = (CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_RSDS:
- AsciiString = (CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
- break;
-
- default:
- AsciiString = NULL;
- break;
- }
- if (AsciiString != NULL) {
- FileNameFound = FALSE;
- for (Index = 0, Index1 = 0; AsciiString[Index] != '\0'; Index++) {
- if (AsciiString[Index] == '\\') {
- Index1 = Index;
- FileNameFound = TRUE;
- }
- }
-
- if (FileNameFound) {
- for (Index = Index1 + 1; AsciiString[Index] != '.'; Index++) {
- AsciiBuffer[Index - (Index1 + 1)] = AsciiString[Index];
- }
- AsciiBuffer[Index - (Index1 + 1)] = 0;
- DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a.efi", AsciiBuffer));
- break;
- }
- }
- }
+ if (Index != 0) {
+ for (Index1 = 0; AsciiString[Index + 1 + Index1] != '.'; Index1 ++) {
+ AsciiBuffer [Index1] = AsciiString[Index + 1 + Index1];
}
+ AsciiBuffer [Index1] = '\0';
+ DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a.efi", AsciiBuffer));
}
}
+
DEBUG_CODE_END ();
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "\n"));
@@ -691,12 +571,6 @@ Returns:
--*/
{
- //
- // Always update PeCoffLoader pointer as PEI core itself may get
- // shadowed into memory
- //
- PrivateData->PeCoffLoader = GetPeCoffLoaderProtocol ();
-
if (OldCoreData == NULL) {
//
// The first time we are XIP (running from FLASH). We need to remember the
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index da0c0aa1af..2d1e29d9f4 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -54,7 +54,6 @@ Revision History
#include <Library/MemoryAllocationLib.h>
#include <Guid/FirmwareFileSystem2.h>
#include <Guid/AprioriFileName.h>
-#include <Guid/PeiPeCoffLoader.h>
#define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
@@ -133,7 +132,6 @@ typedef struct{
UINTN SizeOfCacheAsRam;
VOID *MaxTopOfCarHeap;
EFI_PEI_PPI_DESCRIPTOR *XipLoadFile;
- EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeCoffLoader;
} PEI_CORE_INSTANCE;
//
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf
index 7701696850..d8db002ea8 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.inf
+++ b/MdeModulePkg/Core/Pei/PeiMain.inf
@@ -82,13 +82,12 @@
DebugLib
MemoryAllocationLib
CacheMaintenanceLib
- PeCoffLoaderLib
PeCoffLib
[Guids]
gPeiAprioriFileNameGuid
gEfiFirmwareFileSystem2Guid
-
+ gEfiPeiPeCoffLoaderGuid
[Ppis]
gEfiPeiSecurityPpiGuid # PPI_NOTIFY SOMETIMES_CONSUMED
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index e80fa4240f..d06c02000b 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -41,7 +41,6 @@
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
- PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf
CustomDecompressLib|MdePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf
S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf
RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
@@ -73,8 +72,6 @@
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf
-
[LibraryClasses.common.PEIM]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -96,7 +93,6 @@
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
- PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf
[LibraryClasses.common.DXE_DRIVER]
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf