]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
24e25d11 | 2 | Return UEFI Decompress Protocol \r |
878ddf1f | 3 | \r |
24e25d11 | 4 | Copyright (c) 2006, Intel Corporation \r |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
878ddf1f | 9 | \r |
24e25d11 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
878ddf1f | 12 | \r |
24e25d11 | 13 | Module Name: UefiDecompressLib.h\r |
878ddf1f | 14 | \r |
15 | **/\r | |
16 | \r | |
17 | #ifndef __UEFI_DECPOMPRESS_LIB_H__\r | |
18 | #define __UEFI_DECPOMPRESS_LIB_H__\r | |
19 | \r | |
1ea5ca46 | 20 | /**\r |
21 | Retrieves the size of the uncompressed buffer and the size of the scratch buffer.\r | |
22 | \r | |
23 | Retrieves the size of the uncompressed buffer and the temporary scratch buffer \r | |
24 | required to decompress the buffer specified by Source and SourceSize.\r | |
25 | If the size of the uncompressed buffer or the size of the scratch buffer cannot\r | |
26 | be determined from the compressed data specified by Source and SourceData, \r | |
27 | then RETURN_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed\r | |
28 | buffer is returned in DestinationSize, the size of the scratch buffer is returned\r | |
29 | in ScratchSize, and RETURN_SUCCESS is returned.\r | |
30 | This function does not have scratch buffer available to perform a thorough \r | |
31 | checking of the validity of the source data. It just retrieves the "Original Size"\r | |
32 | field from the beginning bytes of the source data and output it as DestinationSize.\r | |
33 | And ScratchSize is specific to the decompression implementation.\r | |
34 | \r | |
35 | If Source is NULL, then ASSERT().\r | |
36 | If DestinationSize is NULL, then ASSERT().\r | |
37 | If ScratchSize is NULL, then ASSERT().\r | |
38 | \r | |
39 | @param Source The source buffer containing the compressed data.\r | |
40 | @param SourceSize The size, in bytes, of the source buffer.\r | |
41 | @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r | |
42 | that will be generated when the compressed buffer specified\r | |
43 | by Source and SourceSize is decompressed..\r | |
44 | @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that\r | |
45 | is required to decompress the compressed buffer specified \r | |
46 | by Source and SourceSize.\r | |
47 | \r | |
48 | @retval RETURN_SUCCESS The size of destination buffer and the size of scratch \r | |
49 | buffer are successull retrieved.\r | |
50 | @retval RETURN_INVALID_PARAMETER The source data is corrupted\r | |
51 | \r | |
52 | **/\r | |
878ddf1f | 53 | RETURN_STATUS\r |
54 | EFIAPI\r | |
55 | UefiDecompressGetInfo (\r | |
56 | IN CONST VOID *Source,\r | |
57 | IN UINT32 SourceSize,\r | |
58 | OUT UINT32 *DestinationSize,\r | |
59 | OUT UINT32 *ScratchSize\r | |
60 | );\r | |
61 | \r | |
1ea5ca46 | 62 | /**\r |
63 | Decompresses a compressed source buffer.\r | |
64 | \r | |
65 | This function is designed so that the decompression algorithm can be implemented\r | |
66 | without using any memory services. As a result, this function is not allowed to\r | |
511710d6 | 67 | call any memory allocation services in its implementation. It is the caller's r\r |
1ea5ca46 | 68 | esponsibility to allocate and free the Destination and Scratch buffers.\r |
69 | If the compressed source data specified by Source is sucessfully decompressed \r | |
70 | into Destination, then RETURN_SUCCESS is returned. If the compressed source data \r | |
71 | specified by Source is not in a valid compressed data format,\r | |
72 | then RETURN_INVALID_PARAMETER is returned.\r | |
73 | \r | |
74 | If Source is NULL, then ASSERT().\r | |
75 | If Destination is NULL, then ASSERT().\r | |
76 | If the required scratch buffer size > 0 and Scratch is NULL, then ASSERT().\r | |
77 | \r | |
78 | @param Source The source buffer containing the compressed data.\r | |
79 | @param Destination The destination buffer to store the decompressed data\r | |
80 | @param Scratch A temporary scratch buffer that is used to perform the decompression.\r | |
81 | This is an optional parameter that may be NULL if the \r | |
82 | required scratch buffer size is 0.\r | |
83 | \r | |
84 | @retval RETURN_SUCCESS Decompression is successfull\r | |
85 | @retval RETURN_INVALID_PARAMETER The source data is corrupted\r | |
86 | \r | |
87 | **/\r | |
878ddf1f | 88 | RETURN_STATUS\r |
89 | EFIAPI\r | |
90 | UefiDecompress (\r | |
91 | IN CONST VOID *Source,\r | |
92 | IN OUT VOID *Destination,\r | |
93 | IN OUT VOID *Scratch\r | |
94 | );\r | |
95 | \r | |
96 | #endif\r |