3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 CustomizedDecompress.h
18 The user Customized Decompress Protocol Interface
22 #ifndef _CUSTOMIZED_DECOMPRESS_H_
23 #define _CUSTOMIZED_DECOMPRESS_H_
25 #define EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL_GUID \
26 { 0x9a44198e, 0xa4a2, 0x44e6, 0x8a, 0x1f, 0x39, 0xbe, 0xfd, 0xac, 0x89, 0x6f }
28 EFI_FORWARD_DECLARATION (EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL
);
32 (EFIAPI
*EFI_CUSTOMIZED_DECOMPRESS_GET_INFO
) (
33 IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL
*This
,
36 OUT UINT32
*DestinationSize
,
37 OUT UINT32
*ScratchSize
43 The GetInfo() function retrieves the size of the uncompressed buffer
44 and the temporary scratch buffer required to decompress the buffer
45 specified by Source and SourceSize. If the size of the uncompressed
46 buffer or the size of the scratch buffer cannot be determined from
47 the compressed data specified by Source and SourceData, then
48 EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
49 buffer is returned in DestinationSize, the size of the scratch buffer is
50 returned in ScratchSize, and EFI_SUCCESS is returned.
52 The GetInfo() function does not have scratch buffer available to perform
53 a thorough checking of the validity of the source data. It just retrieves
54 the 'Original Size' field from the beginning bytes of the source data and
55 output it as DestinationSize. And ScratchSize is specific to the decompression
60 This - The protocol instance pointer
61 Source - The source buffer containing the compressed data.
62 SourceSize - The size, in bytes, of source buffer.
63 DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer
64 that will be generated when the compressed buffer specified
65 by Source and SourceSize is decompressed.
66 ScratchSize - A pointer to the size, in bytes, of the scratch buffer that
67 is required to decompress the compressed buffer specified by
68 Source and SourceSize.
71 EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize
72 and the size of the scratch buffer was returned in ScratchSize.
73 EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch
74 buffer cannot be determined from the compressed data specified by
75 Source and SourceData.
82 (EFIAPI
*EFI_CUSTOMIZED_DECOMPRESS_DECOMPRESS
) (
83 IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL
*This
,
86 IN OUT VOID
* Destination
,
87 IN UINT32 DestinationSize
,
95 The Decompress() function extracts decompressed data to its original form.
97 This protocol is designed so that the decompression algorithm can be
98 implemented without using any memory services. As a result, the
99 Decompress() function is not allowed to call AllocatePool() or
100 AllocatePages() in its implementation. It is the caller's responsibility
101 to allocate and free the Destination and Scratch buffers.
103 If the compressed source data specified by Source and SourceSize is
104 sucessfully decompressed into Destination, then EFI_SUCCESS is returned.
105 If the compressed source data specified by Source and SourceSize is not in
106 a valid compressed data format, then EFI_INVALID_PARAMETER is returned.
110 This - The protocol instance pointer
111 Source - The source buffer containing the compressed data.
112 SourceSize - The size of source data.
113 Destination - On output, the destination buffer that contains
114 the uncompressed data.
115 DestinationSize - The size of destination buffer. The size of destination
116 buffer needed is obtained from GetInfo().
117 Scratch - A temporary scratch buffer that is used to perform the
119 ScratchSize - The size of scratch buffer. The size of scratch buffer needed
120 is obtained from GetInfo().
124 EFI_SUCCESS - Decompression completed successfully, and the uncompressed
125 buffer is returned in Destination.
126 EFI_INVALID_PARAMETER
127 - The source buffer specified by Source and SourceSize is
128 corrupted (not in a valid compressed format).
132 struct _EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL
{
133 EFI_CUSTOMIZED_DECOMPRESS_GET_INFO GetInfo
;
134 EFI_CUSTOMIZED_DECOMPRESS_DECOMPRESS Decompress
;
137 extern EFI_GUID gEfiCustomizedDecompressProtocolGuid
;