]> git.proxmox.com Git - mirror_edk2.git/blame - EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.c
Updated to support passing PE/COFF and LZMA decompress up via HOBS. Currently turned...
[mirror_edk2.git] / EmbeddedPkg / Library / LzmaHobCustomDecompressLib / LzmaHobCustomDecompressLib.c
CommitLineData
607a0df6 1/** @file\r
2 LZMA Decompress GUIDed Section Extraction Library.\r
3 It wraps Lzma decompress interfaces to GUIDed Section Extraction interfaces\r
4 and registers them into GUIDed handler table.\r
5\r
6 Copyright (c) 2009, Intel Corporation<BR>\r
7 All rights reserved. This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#include <PiDxe.h>\r
18#include <Library/HobLib.h>\r
19#include <Library/ExtractGuidedSectionLib.h>\r
20\r
21#include <Guid/ExtractSection.h>\r
22#include <Guid/LzmaDecompress.h>\r
23\r
24\r
25/**\r
26 Register LzmaDecompress and LzmaDecompressGetInfo handlers with LzmaCustomerDecompressGuid.\r
27\r
28 @retval RETURN_SUCCESS Register successfully.\r
29 @retval RETURN_OUT_OF_RESOURCES No enough memory to store this handler.\r
30**/\r
31EFI_STATUS\r
32EFIAPI\r
33LzmaDecompressLibConstructor (\r
34 )\r
35{\r
36 EXTRACT_SECTION_HOB *Hob;\r
37 \r
38 Hob = GetFirstGuidHob (&gLzmaCustomDecompressGuid);\r
39 if (Hob == NULL) {\r
40 return EFI_NOT_FOUND;\r
41 }\r
42 \r
43 // Locate Guided Hob \r
44\r
45 return ExtractGuidedSectionRegisterHandlers (\r
46 &gLzmaCustomDecompressGuid,\r
ca3ad58b 47 Hob->Data.SectionGetInfo,\r
48 Hob->Data.SectionExtraction\r
607a0df6 49 ); \r
50}\r