]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c
1) PcdDxeIplSupportCustomDecompress, PcdDxeIplSupportTianoDecompress, PcdDxeIplSuppor...
[mirror_edk2.git] / MdeModulePkg / Library / DxePeCoffLoaderFromHobLib / PeCoff.c
diff --git a/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c b/MdeModulePkg/Library/DxePeCoffLoaderFromHobLib/PeCoff.c
new file mode 100644 (file)
index 0000000..c1a4309
--- /dev/null
@@ -0,0 +1,50 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \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
+Module Name:\r
+\r
+  Decompress.c\r
+\r
+Abstract:\r
+  \r
+--*/\r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Guid/PeiPeCoffLoader.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/PeCoffLoaderLib.h>\r
+#include <Library/HobLib.h>\r
+\r
+\r
+\r
+EFI_PEI_PE_COFF_LOADER_PROTOCOL *\r
+EFIAPI\r
+GetPeCoffLoaderProtocol (\r
+  )\r
+{\r
+  EFI_HOB_GUID_TYPE        *GuidHob;\r
+\r
+  GuidHob = GetFirstGuidHob (&gEfiPeiPeCoffLoaderGuid);\r
+  if (GuidHob == NULL) {\r
+    return NULL;\r
+  } else {\r
+    return (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
+  }\r
+}\r
+\r