Ronak Kanabar | 1ae366f | 2023-06-07 01:21:56 +0530 | [diff] [blame^] | 1 | /** @file |
| 2 | Provides decompression services to the PEI Foundation. |
| 3 | |
| 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> |
| 5 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 6 | |
| 7 | @par Revision Reference: |
| 8 | This PPI is introduced in PI Version 1.0. |
| 9 | |
| 10 | **/ |
| 11 | |
| 12 | #ifndef __DECOMPRESS_PPI_H__ |
| 13 | #define __DECOMPRESS_PPI_H__ |
| 14 | |
| 15 | #define EFI_PEI_DECOMPRESS_PPI_GUID \ |
| 16 | { 0x1a36e4e7, 0xfab6, 0x476a, { 0x8e, 0x75, 0x69, 0x5a, 0x5, 0x76, 0xfd, 0xd7 } } |
| 17 | |
| 18 | typedef struct _EFI_PEI_DECOMPRESS_PPI EFI_PEI_DECOMPRESS_PPI; |
| 19 | |
| 20 | /** |
| 21 | Decompress a single compression section in a firmware file. |
| 22 | |
| 23 | Decompresses the data in a compressed section and returns it |
| 24 | as a series of standard PI Firmware File Sections. The |
| 25 | required memory is allocated from permanent memory. |
| 26 | |
| 27 | @param This Points to this instance of the |
| 28 | EFI_PEI_DECOMPRESS_PEI PPI. |
| 29 | @param InputSection Points to the compressed section. |
| 30 | @param OutputBuffer Holds the returned pointer to the |
| 31 | decompressed sections. |
| 32 | @param OutputSize Holds the returned size of the decompress |
| 33 | section streams. |
| 34 | |
| 35 | @retval EFI_SUCCESS The section was decompressed |
| 36 | successfully. OutputBuffer contains the |
| 37 | resulting data and OutputSize contains |
| 38 | the resulting size. |
| 39 | @retval EFI_OUT_OF_RESOURCES Unable to allocate sufficient |
| 40 | memory to hold the decompressed data. |
| 41 | @retval EFI_UNSUPPORTED The compression type specified |
| 42 | in the compression header is unsupported. |
| 43 | |
| 44 | **/ |
| 45 | typedef |
| 46 | EFI_STATUS |
| 47 | (EFIAPI *EFI_PEI_DECOMPRESS_DECOMPRESS)( |
| 48 | IN CONST EFI_PEI_DECOMPRESS_PPI *This, |
| 49 | IN CONST EFI_COMPRESSION_SECTION *InputSection, |
| 50 | OUT VOID **OutputBuffer, |
| 51 | OUT UINTN *OutputSize |
| 52 | ); |
| 53 | |
| 54 | /// |
| 55 | /// This PPI's single member function decompresses a compression |
| 56 | /// encapsulated section. It is used by the PEI Foundation to |
| 57 | /// process sectioned files. Prior to the installation of this PPI, |
| 58 | /// compression sections will be ignored. |
| 59 | /// |
| 60 | struct _EFI_PEI_DECOMPRESS_PPI { |
| 61 | EFI_PEI_DECOMPRESS_DECOMPRESS Decompress; |
| 62 | }; |
| 63 | |
| 64 | extern EFI_GUID gEfiPeiDecompressPpiGuid; |
| 65 | |
| 66 | #endif |