From 352892190a06226f154d482e6d61981f91f60e22 Mon Sep 17 00:00:00 2001 From: jcarsey Date: Fri, 2 Sep 2011 18:27:56 +0000 Subject: [PATCH] MdeModulePkg: Remove UefiBootServicesTableLib dependency from DxePrintLibPrint2Protocol. The use of the BootServicesTableLib inside the DxePrintLibPrint2Protocol allows for potential circular library dependency. Signed-off-by: jcarsey Reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12273 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DxePrintLibPrint2Protocol.inf | 10 ---------- .../Library/DxePrintLibPrint2Protocol/PrintLib.c | 11 +++++------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf index 5195d01273..5f2d457b99 100644 --- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf +++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf @@ -21,27 +21,17 @@ MODULE_TYPE = DXE_DRIVER VERSION_STRING = 1.0 LIBRARY_CLASS = PrintLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER - CONSTRUCTOR = PrintLibConstructor -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 IPF EBC -# - [Sources] PrintLib.c - [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - [LibraryClasses] BaseLib - UefiBootServicesTableLib DebugLib [Protocols] diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c index 4646f18432..671c3332f9 100644 --- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c +++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c @@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -#include #include EFI_PRINT2_PROTOCOL *mPrint2Protocol = NULL; @@ -50,11 +49,11 @@ PrintLibConstructor ( { EFI_STATUS Status; - Status = gBS->LocateProtocol ( - &gEfiPrint2ProtocolGuid, - NULL, - (VOID**) &mPrint2Protocol - ); + Status = SystemTable->BootServices->LocateProtocol ( + &gEfiPrint2ProtocolGuid, + NULL, + (VOID**) &mPrint2Protocol + ); ASSERT_EFI_ERROR (Status); ASSERT (mPrint2Protocol != NULL); -- 2.39.2