]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Protocol/TianoDecompress/TianoDecompress.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Protocol / TianoDecompress / TianoDecompress.h
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 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 TianoDecompress.h\r
15 \r
16Abstract:\r
17\r
18 The Tiano Decompress Protocol Interface\r
19\r
20--*/\r
21\r
22#ifndef _TIANO_DECOMPRESS_H_\r
23#define _TIANO_DECOMPRESS_H_\r
24\r
25#define EFI_TIANO_DECOMPRESS_PROTOCOL_GUID \\r
7ccf38a3 26 { 0xe84cf29c, 0x191f, 0x4eae, {0x96, 0xe1, 0xf4, 0x6a, 0xec, 0xea, 0xea, 0x0b} }\r
3eb9473e 27\r
28EFI_FORWARD_DECLARATION (EFI_TIANO_DECOMPRESS_PROTOCOL);\r
29\r
30typedef\r
31EFI_STATUS\r
32(EFIAPI *EFI_TIANO_DECOMPRESS_GET_INFO) (\r
33 IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r
34 IN VOID *Source,\r
35 IN UINT32 SourceSize,\r
36 OUT UINT32 *DestinationSize,\r
37 OUT UINT32 *ScratchSize\r
38 );\r
39/*++\r
40\r
41Routine Description:\r
42\r
43 The GetInfo() function retrieves the size of the uncompressed buffer \r
44 and the temporary scratch buffer required to decompress the buffer \r
45 specified by Source and SourceSize. If the size of the uncompressed\r
46 buffer or the size of the scratch buffer cannot be determined from \r
47 the compressed data specified by Source and SourceData, then \r
48 EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed\r
49 buffer is returned in DestinationSize, the size of the scratch buffer is \r
50 returned in ScratchSize, and EFI_SUCCESS is returned.\r
51 \r
52 The GetInfo() function does not have scratch buffer available to perform \r
53 a thorough checking of the validity of the source data. It just retrieves\r
54 the 'Original Size' field from the beginning bytes of the source data and\r
55 output it as DestinationSize. And ScratchSize is specific to the decompression\r
56 implementation.\r
57\r
58Arguments:\r
59\r
60 This - The protocol instance pointer\r
61 Source - The source buffer containing the compressed data.\r
62 SourceSize - The size, in bytes, of source buffer.\r
63 DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer\r
64 that will be generated when the compressed buffer specified \r
65 by Source and SourceSize is decompressed.\r
66 ScratchSize - A pointer to the size, in bytes, of the scratch buffer that \r
67 is required to decompress the compressed buffer specified by\r
68 Source and SourceSize.\r
69\r
70Returns:\r
71 EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize\r
72 and the size of the scratch buffer was returned in ScratchSize.\r
73 EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch\r
74 buffer cannot be determined from the compressed data specified by \r
75 Source and SourceData.\r
76\r
77--*/\r
78\r
79\r
80typedef\r
81EFI_STATUS\r
82(EFIAPI *EFI_TIANO_DECOMPRESS_DECOMPRESS) (\r
83 IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r
84 IN VOID* Source,\r
85 IN UINT32 SourceSize,\r
86 IN OUT VOID* Destination,\r
87 IN UINT32 DestinationSize,\r
88 IN OUT VOID* Scratch,\r
89 IN UINT32 ScratchSize\r
90 );\r
91/*++\r
92\r
93Routine Description:\r
94\r
95 The Decompress() function extracts decompressed data to its original form.\r
96 \r
97 This protocol is designed so that the decompression algorithm can be \r
98 implemented without using any memory services. As a result, the \r
99 Decompress() function is not allowed to call AllocatePool() or \r
100 AllocatePages() in its implementation. It is the caller's responsibility \r
101 to allocate and free the Destination and Scratch buffers.\r
102 \r
103 If the compressed source data specified by Source and SourceSize is \r
104 sucessfully decompressed into Destination, then EFI_SUCCESS is returned. \r
105 If the compressed source data specified by Source and SourceSize is not in \r
106 a valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
107\r
108Arguments:\r
109\r
110 This - The protocol instance pointer\r
111 Source - The source buffer containing the compressed data.\r
112 SourceSize - The size of source data.\r
113 Destination - On output, the destination buffer that contains \r
114 the uncompressed data.\r
115 DestinationSize - The size of destination buffer. The size of destination\r
116 buffer needed is obtained from GetInfo().\r
117 Scratch - A temporary scratch buffer that is used to perform the \r
118 decompression.\r
119 ScratchSize - The size of scratch buffer. The size of scratch buffer needed\r
120 is obtained from GetInfo().\r
121\r
122Returns:\r
123\r
124 EFI_SUCCESS - Decompression completed successfully, and the uncompressed \r
125 buffer is returned in Destination.\r
126 EFI_INVALID_PARAMETER \r
127 - The source buffer specified by Source and SourceSize is \r
128 corrupted (not in a valid compressed format).\r
129\r
130--*/\r
131\r
9c092841 132struct _EFI_TIANO_DECOMPRESS_PROTOCOL {\r
3eb9473e 133 EFI_TIANO_DECOMPRESS_GET_INFO GetInfo;\r
134 EFI_TIANO_DECOMPRESS_DECOMPRESS Decompress;\r
9c092841 135};\r
3eb9473e 136\r
137extern EFI_GUID gEfiTianoDecompressProtocolGuid;\r
138\r
139#endif\r