]> git.proxmox.com Git - mirror_edk2.git/blob - BeagleBoardPkg/PrePi/LzmaDecompress.h
NetworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BeagleBoardPkg / PrePi / LzmaDecompress.h
1 /** @file
2 LZMA Decompress Library header file
3
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __LZMA_DECOMPRESS_H___
10 #define __LZMA_DECOMPRESS_H___
11
12 /**
13 Examines a GUIDed section and returns the size of the decoded buffer and the
14 size of an scratch buffer required to actually decode the data in a GUIDed section.
15
16 Examines a GUIDed section specified by InputSection.
17 If GUID for InputSection does not match the GUID that this handler supports,
18 then RETURN_UNSUPPORTED is returned.
19 If the required information can not be retrieved from InputSection,
20 then RETURN_INVALID_PARAMETER is returned.
21 If the GUID of InputSection does match the GUID that this handler supports,
22 then the size required to hold the decoded buffer is returned in OututBufferSize,
23 the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field
24 from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.
25
26 If InputSection is NULL, then ASSERT().
27 If OutputBufferSize is NULL, then ASSERT().
28 If ScratchBufferSize is NULL, then ASSERT().
29 If SectionAttribute is NULL, then ASSERT().
30
31
32 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
33 @param[out] OutputBufferSize A pointer to the size, in bytes, of an output buffer required
34 if the buffer specified by InputSection were decoded.
35 @param[out] ScratchBufferSize A pointer to the size, in bytes, required as scratch space
36 if the buffer specified by InputSection were decoded.
37 @param[out] SectionAttribute A pointer to the attributes of the GUIDed section. See the Attributes
38 field of EFI_GUID_DEFINED_SECTION in the PI Specification.
39
40 @retval RETURN_SUCCESS The information about InputSection was returned.
41 @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
42 @retval RETURN_INVALID_PARAMETER The information can not be retrieved from the section specified by InputSection.
43
44 **/
45 RETURN_STATUS
46 EFIAPI
47 LzmaGuidedSectionGetInfo (
48 IN CONST VOID *InputSection,
49 OUT UINT32 *OutputBufferSize,
50 OUT UINT32 *ScratchBufferSize,
51 OUT UINT16 *SectionAttribute
52 );
53
54 /**
55 Decompress a LZAM compressed GUIDed section into a caller allocated output buffer.
56
57 Decodes the GUIDed section specified by InputSection.
58 If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned.
59 If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.
60 If the GUID of InputSection does match the GUID that this handler supports, then InputSection
61 is decoded into the buffer specified by OutputBuffer and the authentication status of this
62 decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the
63 data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise,
64 the decoded data will be placed in caller allocated buffer specified by OutputBuffer.
65
66 If InputSection is NULL, then ASSERT().
67 If OutputBuffer is NULL, then ASSERT().
68 If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().
69 If AuthenticationStatus is NULL, then ASSERT().
70
71
72 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
73 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.
74 @param[out] ScratchBuffer A caller allocated buffer that may be required by this function
75 as a scratch buffer to perform the decode operation.
76 @param[out] AuthenticationStatus
77 A pointer to the authentication status of the decoded output buffer.
78 See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
79 section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must
80 never be set by this handler.
81
82 @retval RETURN_SUCCESS The buffer specified by InputSection was decoded.
83 @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
84 @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded.
85
86 **/
87 RETURN_STATUS
88 EFIAPI
89 LzmaGuidedSectionExtraction (
90 IN CONST VOID *InputSection,
91 OUT VOID **OutputBuffer,
92 OUT VOID *ScratchBuffer, OPTIONAL
93 OUT UINT32 *AuthenticationStatus
94 );
95
96 #endif // __LZMADECOMPRESS_H__
97