Update CustomDecompress library to support algorithm guid and Update DxeIpl and DxeCore to support custom decompress guid section parse.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3573 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
30
IntelFrameworkModulePkg/Include/Guid/CustomDecompress.h
Normal file
30
IntelFrameworkModulePkg/Include/Guid/CustomDecompress.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
CustomDecompress.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Custom decompress Guid definitions
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __EFI_CUSTOM_DECOMPRESS_GUID_H__
|
||||
#define __EFI_CUSTOM_DECOMPRESS_GUID_H__
|
||||
|
||||
#define TINAO_CUSTOM_DECOMPRESS_GUID \
|
||||
{ 0xA31280AD, 0x481E, 0x41B6, { 0x95, 0xE8, 0x12, 0x7F, 0x4C, 0x98, 0x47, 0x79 } }
|
||||
|
||||
extern GUID gTianoCustomDecompressGuid;
|
||||
|
||||
#endif // #ifndef _EFI_CAPSULE_VENDOR_GUID_H_
|
@@ -34,6 +34,7 @@
|
||||
gEfiPciHotplugDeviceGuid = { 0x0B280816, 0x52E7, 0x4E51, { 0xAA, 0x57, 0x11, 0xBD, 0x41, 0xCB, 0xEF, 0xC3 }}
|
||||
|
||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid = { 0xD3705011, 0xBC19, 0x4af7, { 0xBE, 0x16, 0xF6, 0x80, 0x30, 0x37, 0x8C, 0x15 }}
|
||||
gTianoCustomDecompressGuid = { 0xA31280AD, 0x481E, 0x41B6, { 0x95, 0xE8, 0x12, 0x7F, 0x4C, 0x98, 0x47, 0x79 }}
|
||||
|
||||
[Protocols.common]
|
||||
gEfiPciHotPlugRequestProtocolGuid = { 0x19CB87AB, 0x2CB9, 0x4665, { 0x83, 0x60, 0xDD, 0xCF, 0x60, 0x54, 0xF7, 0x9D }}
|
||||
|
@@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <Guid/CustomDecompress.h>
|
||||
#include "BaseUefiTianoCustomDecompressLibInternals.h"
|
||||
|
||||
VOID
|
||||
@@ -775,6 +776,7 @@ Returns:
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
CustomDecompressGetInfo (
|
||||
IN CONST GUID *DecompressGuid,
|
||||
IN CONST VOID *Source,
|
||||
IN UINT32 SourceSize,
|
||||
OUT UINT32 *DestinationSize,
|
||||
@@ -787,7 +789,7 @@ Routine Description:
|
||||
The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().
|
||||
|
||||
Arguments:
|
||||
|
||||
DecompressGuid The guid matches this decompress method.
|
||||
Source - The source buffer containing the compressed data.
|
||||
SourceSize - The size of source buffer
|
||||
DestinationSize - The size of destination buffer.
|
||||
@@ -797,15 +799,21 @@ Returns:
|
||||
|
||||
RETURN_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
|
||||
RETURN_INVALID_PARAMETER - The source data is corrupted
|
||||
RETURN_UNSUPPORTED - Decompress method is not supported.
|
||||
|
||||
--*/
|
||||
{
|
||||
return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
|
||||
if (CompareGuid (DecompressGuid, &gTianoCustomDecompressGuid)) {
|
||||
return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
|
||||
} else {
|
||||
return RETURN_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
CustomDecompress (
|
||||
IN CONST GUID *DecompressGuid,
|
||||
IN CONST VOID *Source,
|
||||
IN OUT VOID *Destination,
|
||||
IN OUT VOID *Scratch
|
||||
@@ -817,7 +825,7 @@ Routine Description:
|
||||
The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().
|
||||
|
||||
Arguments:
|
||||
|
||||
DecompressGuid The guid matches this decompress method.
|
||||
Source - The source buffer containing the compressed data.
|
||||
Destination - The destination buffer to store the decompressed data
|
||||
Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
|
||||
@@ -826,8 +834,50 @@ Returns:
|
||||
|
||||
RETURN_SUCCESS - Decompression is successfull
|
||||
RETURN_INVALID_PARAMETER - The source data is corrupted
|
||||
RETURN_UNSUPPORTED - Decompress method is not supported.
|
||||
|
||||
--*/
|
||||
{
|
||||
return UefiTianoDecompress (Source, Destination, Scratch, 2);
|
||||
if (CompareGuid (DecompressGuid, &gTianoCustomDecompressGuid)) {
|
||||
return UefiTianoDecompress (Source, Destination, Scratch, 2);
|
||||
} else {
|
||||
return RETURN_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Get decompress method guid list.
|
||||
|
||||
@param[in, out] AlgorithmGuidTable The decompress method guid list.
|
||||
@param[in, out] NumberOfAlgorithms The number of decompress methods.
|
||||
|
||||
@retval RETURN_SUCCESS Get all algorithmes list successfully.
|
||||
@retval RETURN_INVALID_PARAMETER Input paramter error.
|
||||
@retval RETURN_OUT_OF_RESOURCES Source is not enough.
|
||||
|
||||
**/
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
CustomDecompressGetAlgorithms (
|
||||
IN OUT GUID **AlgorithmGuidTable,
|
||||
IN OUT UINTN *NumberOfAlgorithms
|
||||
)
|
||||
{
|
||||
if (NumberOfAlgorithms == NULL) {
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (*NumberOfAlgorithms < 1) {
|
||||
*NumberOfAlgorithms = 1;
|
||||
return RETURN_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
if (AlgorithmGuidTable == NULL) {
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
AlgorithmGuidTable [0] = &gTianoCustomDecompressGuid;
|
||||
*NumberOfAlgorithms = 1;
|
||||
|
||||
return RETURN_SUCCESS;
|
||||
}
|
@@ -24,7 +24,6 @@
|
||||
EDK_RELEASE_VERSION = 0x00020000
|
||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
@@ -38,8 +37,12 @@
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
|
||||
[Guids]
|
||||
gTianoCustomDecompressGuid
|
||||
|
||||
|
Reference in New Issue
Block a user