]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add PrintDxe to produce EDKII print2 protocol on top of PrintLib in MdePkg
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 03:04:26 +0000 (03:04 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 03:04:26 +0000 (03:04 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7571 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/PrintDxe/Print.c [new file with mode: 0644]
MdeModulePkg/Universal/PrintDxe/PrintDxe.inf [new file with mode: 0644]

diff --git a/MdeModulePkg/Universal/PrintDxe/Print.c b/MdeModulePkg/Universal/PrintDxe/Print.c
new file mode 100644 (file)
index 0000000..0bd28d8
--- /dev/null
@@ -0,0 +1,67 @@
+/** @file\r
+  This driver produces Print2 protocol layered on top of the PrintLib from the MdePkg.\r
+\r
+Copyright (c) 2009, Intel Corporation. <BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/Print2.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+EFI_HANDLE  mPrintThunkHandle = NULL;\r
+\r
+CONST EFI_PRINT2_PROTOCOL mPrint2Protocol = {\r
+  UnicodeVSPrint,\r
+  UnicodeSPrint,\r
+  UnicodeVSPrintAsciiFormat,\r
+  UnicodeSPrintAsciiFormat,\r
+  UnicodeValueToString,\r
+  AsciiVSPrint,\r
+  AsciiSPrint,\r
+  AsciiVSPrintUnicodeFormat,\r
+  AsciiSPrintUnicodeFormat,\r
+  AsciiValueToString\r
+};\r
+\r
+\r
+/**\r
+  The user Entry Point for Print module.\r
+\r
+  This is the entry point for Print DXE Driver. It installs the Print2 Protocol.\r
+\r
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param[in] SystemTable    A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS       The entry point is executed successfully.\r
+  @retval Others            Some error occurs when executing this entry point.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PrintEntryPoint (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &mPrintThunkHandle,\r
+                  &gEfiPrint2ProtocolGuid, &mPrint2Protocol,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Status;\r
+}\r
diff --git a/MdeModulePkg/Universal/PrintDxe/PrintDxe.inf b/MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
new file mode 100644 (file)
index 0000000..9dfa81b
--- /dev/null
@@ -0,0 +1,48 @@
+#/** @file\r
+#  Print DXE driver that produces Print2 Protocol.\r
+#\r
+#  This driver produces Print2 protocol layered on top of the PrintLib from the MdePkg.\r
+#\r
+#  Copyright (c) 2009, Intel Corporation. <BR>\r
+#  All rights reserved. This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution.  The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PrintDxe\r
+  FILE_GUID                      = 79E4A61C-ED73-4312-94FE-E3E7563362A9\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  ENTRY_POINT                    = PrintEntryPoint\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+  Print.c\r
+\r
+[Packages]\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+  PrintLib\r
+  UefiBootServicesTableLib\r
+  UefiDriverEntryPoint\r
+  DebugLib\r
+\r
+[Protocols]\r
+  gEfiPrint2ProtocolGuid    ## PRODUCES\r
+\r
+[Depex]\r
+  TRUE\r