]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/PrintDxe/Print.c
2a617b917ed981a68ad1154eb4713ba97abb6bbf
[mirror_edk2.git] / MdeModulePkg / Universal / PrintDxe / Print.c
1 /** @file
2 This driver produces Print2 protocol layered on top of the PrintLib from the MdePkg.
3
4 Copyright (c) 2009, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include <PiDxe.h>
16
17 #include <Protocol/Print2.h>
18 #include <Library/PrintLib.h>
19 #include <Library/UefiBootServicesTableLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/UefiDriverEntryPoint.h>
22
23 EFI_HANDLE mPrintThunkHandle = NULL;
24
25 CONST EFI_PRINT2_PROTOCOL mPrint2Protocol = {
26 UnicodeVSPrint,
27 UnicodeSPrint,
28 UnicodeVSPrintAsciiFormat,
29 UnicodeSPrintAsciiFormat,
30 UnicodeValueToString,
31 AsciiVSPrint,
32 AsciiSPrint,
33 AsciiVSPrintUnicodeFormat,
34 AsciiSPrintUnicodeFormat,
35 AsciiValueToString
36 };
37
38
39 /**
40 The user Entry Point for Print module.
41
42 This is the entry point for Print DXE Driver. It installs the Print2 Protocol.
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 PrintEntryPoint (
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 &gEfiPrint2ProtocolGuid, &mPrint2Protocol,
63 NULL
64 );
65 ASSERT_EFI_ERROR (Status);
66
67 return Status;
68 }