MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / EfiCompress

Function EfiCompress

BaseTools/Source/C/Common/EfiCompress.c:253–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251//
252
253EFI_STATUS
254EfiCompress (
255 IN UINT8 *SrcBuffer,
256 IN UINT32 SrcSize,
257 IN UINT8 *DstBuffer,
258 IN OUT UINT32 *DstSize
259 )
260/*++
261
262Routine Description:
263
264 The main compression routine.
265
266Arguments:
267
268 SrcBuffer - The buffer storing the source data
269 SrcSize - The size of source data
270 DstBuffer - The buffer to store the compressed data
271 DstSize - On input, the size of DstBuffer; On output,
272 the size of the actual compressed data.
273
274Returns:
275
276 EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
277 DstSize contains the size needed.
278 EFI_SUCCESS - Compression is successful.
279
280--*/
281{
282 EFI_STATUS Status = EFI_SUCCESS;
283
284 //
285 // Initializations
286 //
287 mBufSiz = 0;
288 mBuf = NULL;
289 mText = NULL;
290 mLevel = NULL;
291 mChildCount = NULL;
292 mPosition = NULL;
293 mParent = NULL;
294 mPrev = NULL;
295 mNext = NULL;
296
297
298 mSrc = SrcBuffer;
299 mSrcUpperLimit = mSrc + SrcSize;
300 mDst = DstBuffer;
301 mDstUpperLimit = mDst + *DstSize;
302
303 PutDword(0L);
304 PutDword(0L);
305
306 MakeCrcTable ();
307
308 mOrigSize = mCompSize = 0;
309 mCrc = INIT_CRC;
310

Callers 2

TianoCompress.cFile · 0.85
ProcessEfiFileFunction · 0.85

Calls 3

PutDwordFunction · 0.70
MakeCrcTableFunction · 0.70
EncodeFunction · 0.50

Tested by

no test coverage detected