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