From b0d803fe3e5c55a9a0c75bc90ccf40ebbbc9ffa3 Mon Sep 17 00:00:00 2001 From: klu2 Date: Mon, 24 Sep 2007 11:38:43 +0000 Subject: Merge branch of PI tree to main trunk git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3918 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoader.c | 35 ++++++++++------------ .../Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.inf | 2 -- Nt32Pkg/Nt32Pkg.dsc | 1 + 3 files changed, 16 insertions(+), 22 deletions(-) (limited to 'Nt32Pkg') diff --git a/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoader.c b/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoader.c index 8eaa2aba43..3d5353b423 100644 --- a/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoader.c +++ b/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoader.c @@ -21,35 +21,30 @@ Abstract: --*/ #include +#include #include -#include +#include +#include -EFI_PEI_PE_COFF_LOADER_PROTOCOL *mPeiEfiPeiPeCoffLoader; +EFI_PEI_PE_COFF_LOADER_PROTOCOL *mPeiEfiPeiPeCoffLoader = NULL; -EFI_STATUS -EFIAPI -PeCoffLoaderConstructor ( - IN EFI_FFS_FILE_HEADER *FfsHeader, - IN EFI_PEI_SERVICES **PeiServices - ) -{ - EFI_STATUS Status; - - Status = (*PeiServices)->LocatePpi ( - PeiServices, - &gEfiPeiPeCoffLoaderGuid, - 0, - NULL, - &mPeiEfiPeiPeCoffLoader - ); - return Status; -} EFI_PEI_PE_COFF_LOADER_PROTOCOL * EFIAPI GetPeCoffLoaderProtocol ( ) { + EFI_STATUS Status; + + if (mPeiEfiPeiPeCoffLoader == NULL) { + Status = PeiServicesLocatePpi( + &gEfiPeiPeCoffLoaderGuid, + 0, + NULL, + (VOID **) &mPeiEfiPeiPeCoffLoader + ); + ASSERT_EFI_ERROR (Status); + } return mPeiEfiPeiPeCoffLoader; } diff --git a/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.inf b/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.inf index 04a0102919..d6a57b22b0 100644 --- a/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.inf +++ b/Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.inf @@ -24,8 +24,6 @@ EDK_RELEASE_VERSION = 0x00020000 EFI_SPECIFICATION_VERSION = 0x00020000 - CONSTRUCTOR = PeCoffLoaderConstructor - # # The following information is for reference only and not required by the build tools. # diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index 01a725a8d8..98ed118f8b 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -145,6 +145,7 @@ PeCoffGetEntryPointLib|Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf + PeCoffLoaderLib|Nt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.inf [LibraryClasses.common.DXE_RUNTIME_DRIVER] UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf -- cgit v1.2.3