1 /** @file 2 Module produces EDK gEfiPrintProtocolGuid for backward compatibility support. 3 4 EDK II retires old EDK Print Protocol and this module produces 5 gEfiPrintProtocolGuid based on PrintLib: 6 1) If it links against BasePrintLib in MdePkg, it produces gEfiPrintProtocolGuid 7 without any prerequisites. 8 2) If it links against DxePrintLibPrint2Protocol in MdeModulePkg, it produces 9 gEfiPrintProtocolGuid on top of gEfiPrint2ProtocolGuid. 10 11 Copyright (c) 2009, Intel Corporation. All rights reserved.<BR> 12 13 This program and the accompanying materials 14 are licensed and made available under the terms and conditions of the BSD License 15 which accompanies this distribution. The full text of the license may be found at 16 http://opensource.org/licenses/bsd-license.php 17 18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 20 Module Name: 21 22 **/ 23 24 #include <PiDxe.h> 25 26 #include <Protocol/Print.h> 27 #include <Library/PrintLib.h> 28 #include <Library/UefiBootServicesTableLib.h> 29 #include <Library/DebugLib.h> 30 31 EFI_HANDLE mPrintThunkHandle = NULL; 32 33 CONST EFI_PRINT_PROTOCOL mPrintProtocol = { 34 UnicodeVSPrint, 35 }; 36 37 38 /** 39 The user Entry Point for Print thunk module. 40 41 This is the entry point for Print thunk DXE Driver. It installs the Print Protocol on 42 top of PrintLib class in MdePkg. 43 44 @param[in] ImageHandle The firmware allocated handle for the EFI image. 45 @param[in] SystemTable A pointer to the EFI System Table. 46 47 @retval EFI_SUCCESS The entry point is executed successfully. 48 @retval Others Some error occurs when executing this entry point. 49 50 **/ 51 EFI_STATUS 52 EFIAPI 53 InitPrintThunk ( 54 IN EFI_HANDLE ImageHandle, 55 IN EFI_SYSTEM_TABLE *SystemTable 56 ) 57 { 58 EFI_STATUS Status; 59 60 Status = gBS->InstallMultipleProtocolInterfaces ( 61 &mPrintThunkHandle, 62 &gEfiPrintProtocolGuid, &mPrintProtocol, 63 NULL 64 ); 65 ASSERT_EFI_ERROR (Status); 66 67 return Status; 68 } 69