2009-07-17 11:10:31 +02:00
|
|
|
/** @file
|
2014-08-28 15:53:34 +02:00
|
|
|
Header file for compression routine.
|
|
|
|
Providing both EFI and Tiano Compress algorithms.
|
2018-07-05 11:40:04 +02:00
|
|
|
|
|
|
|
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:03:11 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2018-07-05 11:40:04 +02:00
|
|
|
|
2009-07-17 11:10:31 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _COMPRESS_H_
|
|
|
|
#define _COMPRESS_H_
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "CommonLib.h"
|
|
|
|
#include <Common/UefiBaseTypes.h>
|
|
|
|
|
2023-02-20 07:21:43 +01:00
|
|
|
/**
|
2009-07-17 11:10:31 +02:00
|
|
|
Tiano compression routine.
|
2023-02-20 07:21:43 +01:00
|
|
|
**/
|
2009-07-17 11:10:31 +02:00
|
|
|
EFI_STATUS
|
|
|
|
TianoCompress (
|
|
|
|
IN UINT8 *SrcBuffer,
|
|
|
|
IN UINT32 SrcSize,
|
|
|
|
IN UINT8 *DstBuffer,
|
|
|
|
IN OUT UINT32 *DstSize
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
2023-02-20 07:21:43 +01:00
|
|
|
/**
|
2009-07-17 11:10:31 +02:00
|
|
|
Efi compression routine.
|
2023-02-20 07:21:43 +01:00
|
|
|
**/
|
2009-07-17 11:10:31 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EfiCompress (
|
|
|
|
IN UINT8 *SrcBuffer,
|
|
|
|
IN UINT32 SrcSize,
|
|
|
|
IN UINT8 *DstBuffer,
|
|
|
|
IN OUT UINT32 *DstSize
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
2023-02-20 07:21:43 +01:00
|
|
|
/**
|
2009-07-17 11:10:31 +02:00
|
|
|
The compression routine.
|
|
|
|
|
2023-02-20 07:21:43 +01:00
|
|
|
@param SrcBuffer The buffer storing the source data
|
|
|
|
@param SrcSize The size of source data
|
|
|
|
@param DstBuffer The buffer to store the compressed data
|
|
|
|
@param DstSize On input, the size of DstBuffer; On output,
|
|
|
|
the size of the actual compressed data.
|
2009-07-17 11:10:31 +02:00
|
|
|
|
2023-02-20 07:21:43 +01:00
|
|
|
@retval EFI_BUFFER_TOO_SMALL The DstBuffer is too small. In this case,
|
2009-07-17 11:10:31 +02:00
|
|
|
DstSize contains the size needed.
|
2023-02-20 07:21:43 +01:00
|
|
|
@retval EFI_SUCCESS Compression is successful.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES No resource to complete function.
|
|
|
|
@retval EFI_INVALID_PARAMETER Parameter supplied is wrong.
|
|
|
|
**/
|
2009-07-17 11:10:31 +02:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(*COMPRESS_FUNCTION) (
|
|
|
|
IN UINT8 *SrcBuffer,
|
|
|
|
IN UINT32 SrcSize,
|
|
|
|
IN UINT8 *DstBuffer,
|
|
|
|
IN OUT UINT32 *DstSize
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|