]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompressLibInternal.h
Program SD Cards into 4-bit mode (support for this is required in the spec). This...
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / LzmaCustomDecompressLib / LzmaDecompressLibInternal.h
CommitLineData
182b1d16
LG
1/** @file\r
2 LZMA Decompress Library internal header file declares Lzma decompress interfaces.\r
3\r
180a5a35
HT
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
182b1d16
LG
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __LZMADECOMPRESSLIB_INTERNAL_H__\r
16#define __LZMADECOMPRESSLIB_INTERNAL_H__\r
17\r
18#include <PiPei.h>\r
19#include <Library/BaseLib.h>\r
20#include <Library/BaseMemoryLib.h>\r
21#include <Library/DebugLib.h>\r
22#include <Library/ExtractGuidedSectionLib.h>\r
23#include <Guid/LzmaDecompress.h>\r
24\r
25/**\r
26 Given a Lzma compressed source buffer, this function retrieves the size of \r
27 the uncompressed buffer and the size of the scratch buffer required \r
28 to decompress the compressed source buffer.\r
29\r
30 Retrieves the size of the uncompressed buffer and the temporary scratch buffer \r
31 required to decompress the buffer specified by Source and SourceSize.\r
32 The size of the uncompressed buffer is returned in DestinationSize, \r
33 the size of the scratch buffer is returned in ScratchSize, and RETURN_SUCCESS is returned.\r
34 This function does not have scratch buffer available to perform a thorough \r
35 checking of the validity of the source data. It just retrieves the "Original Size"\r
36 field from the LZMA_HEADER_SIZE beginning bytes of the source data and output it as DestinationSize.\r
37 And ScratchSize is specific to the decompression implementation.\r
38\r
39 If SourceSize is less than LZMA_HEADER_SIZE, then ASSERT().\r
40\r
41 @param Source The source buffer containing the compressed data.\r
42 @param SourceSize The size, in bytes, of the source buffer.\r
43 @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r
44 that will be generated when the compressed buffer specified\r
45 by Source and SourceSize is decompressed.\r
46 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that\r
47 is required to decompress the compressed buffer specified \r
48 by Source and SourceSize.\r
49\r
50 @retval RETURN_SUCCESS The size of the uncompressed data was returned \r
51 in DestinationSize and the size of the scratch \r
52 buffer was returned in ScratchSize.\r
53\r
54**/\r
55RETURN_STATUS\r
56EFIAPI\r
57LzmaUefiDecompressGetInfo (\r
58 IN CONST VOID *Source,\r
59 IN UINT32 SourceSize,\r
60 OUT UINT32 *DestinationSize,\r
61 OUT UINT32 *ScratchSize\r
62 );\r
63\r
64/**\r
65 Decompresses a Lzma compressed source buffer.\r
66\r
67 Extracts decompressed data to its original form.\r
68 If the compressed source data specified by Source is successfully decompressed \r
69 into Destination, then RETURN_SUCCESS is returned. If the compressed source data \r
70 specified by Source is not in a valid compressed data format,\r
71 then RETURN_INVALID_PARAMETER is returned.\r
72\r
73 @param Source The source buffer containing the compressed data.\r
75a635ac 74 @param SourceSize The size of source buffer.\r
182b1d16
LG
75 @param Destination The destination buffer to store the decompressed data\r
76 @param Scratch A temporary scratch buffer that is used to perform the decompression.\r
77 This is an optional parameter that may be NULL if the \r
78 required scratch buffer size is 0.\r
79 \r
80 @retval RETURN_SUCCESS Decompression completed successfully, and \r
81 the uncompressed buffer is returned in Destination.\r
82 @retval RETURN_INVALID_PARAMETER \r
83 The source buffer specified by Source is corrupted \r
84 (not in a valid compressed format).\r
85**/\r
86RETURN_STATUS\r
87EFIAPI\r
88LzmaUefiDecompress (\r
89 IN CONST VOID *Source,\r
090d3088 90 IN UINTN SourceSize,\r
182b1d16
LG
91 IN OUT VOID *Destination,\r
92 IN OUT VOID *Scratch\r
93 );\r
94\r
95#endif\r
96\r