]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/EdkDecompress.h
Add comments and DoxyGen format for these files.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / EdkDecompress.h
CommitLineData
504214c4 1/** @file\r
d8a43975 2\r
504214c4
LG
3 The Tiano Decompress Protocol Interface\r
4\r
5Copyright (c) 2006 - 2008, Intel Corporation \r
d8a43975 6All rights reserved. This program and the accompanying materials \r
7are licensed and made available under the terms and conditions of the BSD License \r
8which accompanies this distribution. The full text of the license may be found at \r
9http://opensource.org/licenses/bsd-license.php \r
10 \r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
504214c4 14**/\r
d8a43975 15\r
16#ifndef __EDK_DECOMPRESS_H__\r
17#define __EDK_DECOMPRESS_H__\r
18\r
19#define EFI_TIANO_DECOMPRESS_PROTOCOL_GUID \\r
20 { 0xe84cf29c, 0x191f, 0x4eae, {0x96, 0xe1, 0xf4, 0x6a, 0xec, 0xea, 0xea, 0x0b } }\r
21\r
22typedef struct _EFI_TIANO_DECOMPRESS_PROTOCOL EFI_TIANO_DECOMPRESS_PROTOCOL;\r
23\r
504214c4 24/**\r
d8a43975 25\r
26 The GetInfo() function retrieves the size of the uncompressed buffer \r
27 and the temporary scratch buffer required to decompress the buffer \r
28 specified by Source and SourceSize. If the size of the uncompressed\r
29 buffer or the size of the scratch buffer cannot be determined from \r
30 the compressed data specified by Source and SourceData, then \r
31 EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed\r
32 buffer is returned in DestinationSize, the size of the scratch buffer is \r
33 returned in ScratchSize, and EFI_SUCCESS is returned.\r
34 \r
35 The GetInfo() function does not have scratch buffer available to perform \r
36 a thorough checking of the validity of the source data. It just retrieves\r
37 the 'Original Size' field from the beginning bytes of the source data and\r
38 output it as DestinationSize. And ScratchSize is specific to the decompression\r
39 implementation.\r
40\r
504214c4
LG
41 @param This The protocol instance pointer\r
42 @param Source The source buffer containing the compressed data.\r
43 @param SourceSize The size, in bytes, of source buffer.\r
44 @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r
45 that will be generated when the compressed buffer specified \r
46 by Source and SourceSize is decompressed.\r
47 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that \r
48 is required to decompress the compressed buffer specified by\r
49 Source and SourceSize.\r
50\r
51 @retval EFI_SUCCESS The size of the uncompressed data was returned in DestinationSize\r
52 and the size of the scratch buffer was returned in ScratchSize.\r
53 @retval EFI_INVALID_PARAMETER \r
54 The size of the uncompressed data or the size of the scratch\r
55 buffer cannot be determined from the compressed data specified by \r
56 Source and SourceData.\r
d8a43975 57\r
58--*/\r
d8a43975 59typedef\r
60EFI_STATUS\r
504214c4
LG
61(EFIAPI *EFI_TIANO_DECOMPRESS_GET_INFO) (\r
62 IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r
63 IN VOID *Source,\r
64 IN UINT32 SourceSize,\r
65 OUT UINT32 *DestinationSize,\r
66 OUT UINT32 *ScratchSize\r
d8a43975 67 );\r
d8a43975 68\r
504214c4 69/**\r
d8a43975 70\r
71 The Decompress() function extracts decompressed data to its original form.\r
72 \r
73 This protocol is designed so that the decompression algorithm can be \r
74 implemented without using any memory services. As a result, the \r
75 Decompress() function is not allowed to call AllocatePool() or \r
76 AllocatePages() in its implementation. It is the caller's responsibility \r
77 to allocate and free the Destination and Scratch buffers.\r
78 \r
79 If the compressed source data specified by Source and SourceSize is \r
80 sucessfully decompressed into Destination, then EFI_SUCCESS is returned. \r
81 If the compressed source data specified by Source and SourceSize is not in \r
82 a valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
83\r
504214c4
LG
84 @param This The protocol instance pointer\r
85 @param Source The source buffer containing the compressed data.\r
86 @param SourceSize The size of source data.\r
87 @param Destination On output, the destination buffer that contains \r
88 the uncompressed data.\r
89 @param DestinationSize The size of destination buffer. The size of destination\r
90 buffer needed is obtained from GetInfo().\r
91 @param Scratch A temporary scratch buffer that is used to perform the \r
92 decompression.\r
93 @param ScratchSize The size of scratch buffer. The size of scratch buffer needed\r
94 is obtained from GetInfo().\r
95\r
96 @retval EFI_SUCCESS Decompression completed successfully, and the uncompressed \r
97 buffer is returned in Destination.\r
98 @retval EFI_INVALID_PARAMETER \r
99 The source buffer specified by Source and SourceSize is \r
100 corrupted (not in a valid compressed format).\r
101**/\r
102typedef\r
103EFI_STATUS\r
104(EFIAPI *EFI_TIANO_DECOMPRESS_DECOMPRESS) (\r
105 IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r
106 IN VOID* Source,\r
107 IN UINT32 SourceSize,\r
108 IN OUT VOID* Destination,\r
109 IN UINT32 DestinationSize,\r
110 IN OUT VOID* Scratch,\r
111 IN UINT32 ScratchSize\r
112 );\r
d8a43975 113\r
114struct _EFI_TIANO_DECOMPRESS_PROTOCOL {\r
115 EFI_TIANO_DECOMPRESS_GET_INFO GetInfo;\r
116 EFI_TIANO_DECOMPRESS_DECOMPRESS Decompress;\r
117};\r
118\r
119extern EFI_GUID gEfiTianoDecompressProtocolGuid;\r
120\r
121#endif\r