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