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 -- 2 files changed, 15 insertions(+), 22 deletions(-) (limited to 'Nt32Pkg/Library') 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. # -- cgit v1.2.3