]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Common/Decompress.h
2899ed5eac475515438f6933a0ad14ed6c4e8663
[mirror_edk2.git] / BaseTools / Source / C / Common / Decompress.h
1 /** @file
2 Header file for compression routine
3
4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _EFI_DECOMPRESS_H
16 #define _EFI_DECOMPRESS_H
17
18 #include <Common/UefiBaseTypes.h>
19
20 EFI_STATUS
21 EfiGetInfo (
22 IN VOID *Source,
23 IN UINT32 SrcSize,
24 OUT UINT32 *DstSize,
25 OUT UINT32 *ScratchSize
26 );
27 /**
28
29 Routine Description:
30
31 The implementation Efi Decompress GetInfo().
32
33 Arguments:
34
35 Source - The source buffer containing the compressed data.
36 SrcSize - The size of source buffer
37 DstSize - The size of destination buffer.
38 ScratchSize - The size of scratch buffer.
39
40 Returns:
41
42 EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
43 EFI_INVALID_PARAMETER - The source data is corrupted
44
45 **/
46
47 EFI_STATUS
48 EfiDecompress (
49 IN VOID *Source,
50 IN UINT32 SrcSize,
51 IN OUT VOID *Destination,
52 IN UINT32 DstSize,
53 IN OUT VOID *Scratch,
54 IN UINT32 ScratchSize
55 );
56 /**
57
58 Routine Description:
59
60 The implementation of Efi Decompress().
61
62 Arguments:
63
64 Source - The source buffer containing the compressed data.
65 SrcSize - The size of source buffer
66 Destination - The destination buffer to store the decompressed data
67 DstSize - The size of destination buffer.
68 Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
69 ScratchSize - The size of scratch buffer.
70
71 Returns:
72
73 EFI_SUCCESS - Decompression is successfull
74 EFI_INVALID_PARAMETER - The source data is corrupted
75
76 **/
77
78 EFI_STATUS
79 TianoGetInfo (
80 IN VOID *Source,
81 IN UINT32 SrcSize,
82 OUT UINT32 *DstSize,
83 OUT UINT32 *ScratchSize
84 );
85 /**
86
87 Routine Description:
88
89 The implementation Tiano Decompress GetInfo().
90
91 Arguments:
92
93 Source - The source buffer containing the compressed data.
94 SrcSize - The size of source buffer
95 DstSize - The size of destination buffer.
96 ScratchSize - The size of scratch buffer.
97
98 Returns:
99
100 EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
101 EFI_INVALID_PARAMETER - The source data is corrupted
102
103 **/
104
105 EFI_STATUS
106 TianoDecompress (
107 IN VOID *Source,
108 IN UINT32 SrcSize,
109 IN OUT VOID *Destination,
110 IN UINT32 DstSize,
111 IN OUT VOID *Scratch,
112 IN UINT32 ScratchSize
113 );
114 /**
115
116 Routine Description:
117
118 The implementation of Tiano Decompress().
119
120 Arguments:
121
122 Source - The source buffer containing the compressed data.
123 SrcSize - The size of source buffer
124 Destination - The destination buffer to store the decompressed data
125 DstSize - The size of destination buffer.
126 Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
127 ScratchSize - The size of scratch buffer.
128
129 Returns:
130
131 EFI_SUCCESS - Decompression is successfull
132 EFI_INVALID_PARAMETER - The source data is corrupted
133
134 **/
135
136 typedef
137 EFI_STATUS
138 (*GETINFO_FUNCTION) (
139 IN VOID *Source,
140 IN UINT32 SrcSize,
141 OUT UINT32 *DstSize,
142 OUT UINT32 *ScratchSize
143 );
144
145 typedef
146 EFI_STATUS
147 (*DECOMPRESS_FUNCTION) (
148 IN VOID *Source,
149 IN UINT32 SrcSize,
150 IN OUT VOID *Destination,
151 IN UINT32 DstSize,
152 IN OUT VOID *Scratch,
153 IN UINT32 ScratchSize
154 );
155
156 EFI_STATUS
157 Extract (
158 IN VOID *Source,
159 IN UINT32 SrcSize,
160 OUT VOID **Destination,
161 OUT UINT32 *DstSize,
162 IN UINTN Algorithm
163 );
164
165 #endif