878ddf1f |
1 | /*++\r |
2 | \r |
3 | Copyright (c) 2006, Intel Corporation \r |
4 | All rights reserved. This program and the accompanying materials \r |
5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r |
7 | http://opensource.org/licenses/bsd-license.php \r |
8 | \r |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r |
11 | \r |
12 | Module Name:\r |
13 | \r |
14 | CustomizedDecompress.c\r |
15 | \r |
16 | Abstract:\r |
17 | \r |
18 | Implementation file for Customized decompression routine\r |
19 | \r |
20 | --*/\r |
21 | \r |
22 | #include <CustomizedDecompress.h>\r |
23 | \r |
24 | EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL mCustomizedDecompress = {\r |
25 | CustomizedGetInfo,\r |
26 | CustomizedDecompress\r |
27 | };\r |
28 | \r |
29 | EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *\r |
30 | EFIAPI\r |
31 | GetCustomizedDecompressProtocol (\r |
32 | VOID\r |
33 | )\r |
34 | {\r |
35 | return &mCustomizedDecompress;\r |
36 | }\r |
37 | \r |
38 | \r |
39 | \r |
40 | EFI_STATUS\r |
41 | EFIAPI\r |
42 | CustomizedGetInfo (\r |
43 | IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,\r |
44 | IN VOID *Source,\r |
45 | IN UINT32 SrcSize,\r |
46 | OUT UINT32 *DstSize,\r |
47 | OUT UINT32 *ScratchSize\r |
48 | )\r |
49 | /*++\r |
50 | \r |
51 | Routine Description:\r |
52 | \r |
53 | The implementation of Customized GetInfo().\r |
54 | \r |
55 | Arguments:\r |
56 | This - The EFI customized decompress protocol\r |
57 | Source - The source buffer containing the compressed data.\r |
58 | SrcSize - The size of source buffer\r |
59 | DstSize - The size of destination buffer.\r |
60 | ScratchSize - The size of scratch buffer.\r |
61 | \r |
62 | Returns:\r |
63 | \r |
64 | EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.\r |
65 | EFI_INVALID_PARAMETER - The source data is corrupted\r |
66 | EFI_UNSUPPORTED - Not supported\r |
67 | \r |
68 | --*/\r |
69 | {\r |
70 | return EFI_UNSUPPORTED;\r |
71 | }\r |
72 | \r |
73 | EFI_STATUS\r |
74 | EFIAPI\r |
75 | CustomizedDecompress (\r |
76 | IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,\r |
77 | IN VOID *Source,\r |
78 | IN UINT32 SrcSize,\r |
79 | IN OUT VOID *Destination,\r |
80 | IN UINT32 DstSize,\r |
81 | IN OUT VOID *Scratch,\r |
82 | IN UINT32 ScratchSize\r |
83 | )\r |
84 | /*++\r |
85 | \r |
86 | Routine Description:\r |
87 | \r |
88 | The implementation of Customized Decompress().\r |
89 | \r |
90 | Arguments:\r |
91 | \r |
92 | This - The protocol instance pointer\r |
93 | Source - The source buffer containing the compressed data.\r |
94 | SrcSize - The size of source buffer\r |
95 | Destination - The destination buffer to store the decompressed data\r |
96 | DstSize - The size of destination buffer.\r |
97 | Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.\r |
98 | ScratchSize - The size of scratch buffer.\r |
99 | \r |
100 | Returns:\r |
101 | \r |
102 | EFI_SUCCESS - Decompression is successfull\r |
103 | EFI_INVALID_PARAMETER - The source data is corrupted\r |
104 | EFI_UNSUPPORTED - Not supported\r |
105 | \r |
106 | --*/\r |
107 | {\r |
108 | return EFI_UNSUPPORTED;\r |
109 | }\r |