]> git.proxmox.com Git - mirror_edk2.git/blame - BeagleBoardPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.c
BeagleBoardPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BeagleBoardPkg / 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
60274cca 6 Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
a1594be9 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
607a0df6 8\r
9**/\r
10\r
11#include <PiDxe.h>\r
12#include <Library/HobLib.h>\r
13#include <Library/ExtractGuidedSectionLib.h>\r
14\r
15#include <Guid/ExtractSection.h>\r
16#include <Guid/LzmaDecompress.h>\r
17\r
18\r
19/**\r
20 Register LzmaDecompress and LzmaDecompressGetInfo handlers with LzmaCustomerDecompressGuid.\r
21\r
22 @retval RETURN_SUCCESS Register successfully.\r
23 @retval RETURN_OUT_OF_RESOURCES No enough memory to store this handler.\r
24**/\r
25EFI_STATUS\r
26EFIAPI\r
27LzmaDecompressLibConstructor (\r
28 )\r
29{\r
30 EXTRACT_SECTION_HOB *Hob;\r
3402aac7 31\r
607a0df6 32 Hob = GetFirstGuidHob (&gLzmaCustomDecompressGuid);\r
33 if (Hob == NULL) {\r
34 return EFI_NOT_FOUND;\r
35 }\r
3402aac7
RC
36\r
37 // Locate Guided Hob\r
607a0df6 38\r
39 return ExtractGuidedSectionRegisterHandlers (\r
40 &gLzmaCustomDecompressGuid,\r
ca3ad58b 41 Hob->Data.SectionGetInfo,\r
42 Hob->Data.SectionExtraction\r
3402aac7 43 );\r
607a0df6 44}\r