]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/Decompress/Decompress.h
Removed extra typedefs on structures to remove error with gcc compiler.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / Decompress / Decompress.h
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 Decompress.h\r
15 \r
16Abstract:\r
17\r
18 The Decompress Protocol Interface\r
19\r
20--*/\r
21\r
22#ifndef _DECOMPRESS_H_\r
23#define _DECOMPRESS_H_\r
24\r
25#define EFI_DECOMPRESS_PROTOCOL_GUID \\r
26 { \\r
27 0xd8117cfe, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \\r
28 }\r
29\r
30EFI_FORWARD_DECLARATION (EFI_DECOMPRESS_PROTOCOL);\r
31\r
32typedef\r
33EFI_STATUS\r
34(EFIAPI *EFI_DECOMPRESS_GET_INFO) (\r
35 IN EFI_DECOMPRESS_PROTOCOL * This,\r
36 IN VOID *Source,\r
37 IN UINT32 SourceSize,\r
38 OUT UINT32 *DestinationSize,\r
39 OUT UINT32 *ScratchSize\r
40 );\r
41\r
42/*++\r
43\r
44Routine Description:\r
45\r
46 The GetInfo() function retrieves the size of the uncompressed buffer \r
47 and the temporary scratch buffer required to decompress the buffer \r
48 specified by Source and SourceSize. If the size of the uncompressed\r
49 buffer or the size of the scratch buffer cannot be determined from \r
50 the compressed data specified by Source and SourceData, then \r
51 EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed\r
52 buffer is returned in DestinationSize, the size of the scratch buffer is \r
53 returned in ScratchSize, and EFI_SUCCESS is returned.\r
54 \r
55 The GetInfo() function does not have scratch buffer available to perform \r
56 a thorough checking of the validity of the source data. It just retrieves\r
57 the 'Original Size' field from the beginning bytes of the source data and\r
58 output it as DestinationSize. And ScratchSize is specific to the decompression\r
59 implementation.\r
60\r
61Arguments:\r
62\r
63 This - The protocol instance pointer\r
64 Source - The source buffer containing the compressed data.\r
65 SourceSize - The size, in bytes, of source buffer.\r
66 DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer\r
67 that will be generated when the compressed buffer specified \r
68 by Source and SourceSize is decompressed.\r
69 ScratchSize - A pointer to the size, in bytes, of the scratch buffer that \r
70 is required to decompress the compressed buffer specified by\r
71 Source and SourceSize.\r
72\r
73Returns:\r
74 EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize\r
75 and the size of the scratch buffer was returned in ScratchSize.\r
76 EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch\r
77 buffer cannot be determined from the compressed data specified by \r
78 Source and SourceData.\r
79\r
80--*/\r
81typedef\r
82EFI_STATUS\r
83(EFIAPI *EFI_DECOMPRESS_DECOMPRESS) (\r
84 IN EFI_DECOMPRESS_PROTOCOL * This,\r
85 IN VOID *Source,\r
86 IN UINT32 SourceSize,\r
87 IN OUT VOID *Destination,\r
88 IN UINT32 DestinationSize,\r
89 IN OUT VOID *Scratch,\r
90 IN UINT32 ScratchSize\r
91 );\r
92\r
93/*++\r
94\r
95Routine Description:\r
96\r
97 The Decompress() function extracts decompressed data to its original form.\r
98 \r
99 This protocol is designed so that the decompression algorithm can be \r
100 implemented without using any memory services. As a result, the \r
101 Decompress() function is not allowed to call AllocatePool() or \r
102 AllocatePages() in its implementation. It is the caller's responsibility \r
103 to allocate and free the Destination and Scratch buffers.\r
104 \r
105 If the compressed source data specified by Source and SourceSize is \r
106 sucessfully decompressed into Destination, then EFI_SUCCESS is returned. \r
107 If the compressed source data specified by Source and SourceSize is not in \r
108 a valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
109\r
110Arguments:\r
111\r
112 This - The protocol instance pointer\r
113 Source - The source buffer containing the compressed data.\r
114 SourceSize - The size of source data.\r
115 Destination - On output, the destination buffer that contains \r
116 the uncompressed data.\r
117 DestinationSize - The size of destination buffer. The size of destination\r
118 buffer needed is obtained from GetInfo().\r
119 Scratch - A temporary scratch buffer that is used to perform the \r
120 decompression.\r
121 ScratchSize - The size of scratch buffer. The size of scratch buffer needed\r
122 is obtained from GetInfo().\r
123\r
124Returns:\r
125\r
126 EFI_SUCCESS - Decompression completed successfully, and the uncompressed \r
127 buffer is returned in Destination.\r
128 EFI_INVALID_PARAMETER \r
129 - The source buffer specified by Source and SourceSize is \r
130 corrupted (not in a valid compressed format).\r
131\r
132--*/\r
e5bce275 133struct _EFI_DECOMPRESS_PROTOCOL {\r
3eb9473e 134 EFI_DECOMPRESS_GET_INFO GetInfo;\r
135 EFI_DECOMPRESS_DECOMPRESS Decompress;\r
e5bce275 136};\r
3eb9473e 137\r
138extern EFI_GUID gEfiDecompressProtocolGuid;\r
139\r
140#endif\r