3 Copyright (c) 2006, 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 DxeCoreUefiDecompressLibFromHob.c
18 UEFI Decompress Library from HOBs
22 static DECOMPRESS_LIBRARY mEfiDecompress
;
25 DxeCoreUefiDecompressLibConstructor (
26 IN EFI_HANDLE ImageHandle
,
27 IN EFI_SYSTEM_TABLE
*SystemTable
39 EFI_HOB_GUID_TYPE
*GuidHob
;
41 GuidHob
= GetFirstGuidHob (&gEfiDecompressProtocolGuid
);
42 ASSERT (GuidHob
!= NULL
);
43 CopyMem (&mEfiDecompress
, GET_GUID_HOB_DATA (GuidHob
), sizeof (mEfiDecompress
));
49 UefiDecompressGetInfo (
50 IN CONST VOID
*Source
,
52 OUT UINT32
*DestinationSize
,
53 OUT UINT32
*ScratchSize
59 The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().
63 Source - The source buffer containing the compressed data.
64 SourceSize - The size of source buffer
65 DestinationSize - The size of destination buffer.
66 ScratchSize - The size of scratch buffer.
70 RETURN_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
71 RETURN_INVALID_PARAMETER - The source data is corrupted
75 return mEfiDecompress
.GetInfo (Source
, SourceSize
, DestinationSize
, ScratchSize
);
81 IN CONST VOID
*Source
,
82 IN OUT VOID
*Destination
,
89 The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().
93 Source - The source buffer containing the compressed data.
94 Destination - The destination buffer to store the decompressed data
95 Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
99 RETURN_SUCCESS - Decompression is successfull
100 RETURN_INVALID_PARAMETER - The source data is corrupted
104 return mEfiDecompress
.Decompress (Source
, Destination
, Scratch
);