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 }}
|
gEfiPciHotplugDeviceGuid = { 0x0B280816, 0x52E7, 0x4E51, { 0xAA, 0x57, 0x11, 0xBD, 0x41, 0xCB, 0xEF, 0xC3 }}
|
||||||
|
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid = { 0xD3705011, 0xBC19, 0x4af7, { 0xBE, 0x16, 0xF6, 0x80, 0x30, 0x37, 0x8C, 0x15 }}
|
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]
|
[Protocols.common]
|
||||||
gEfiPciHotPlugRequestProtocolGuid = { 0x19CB87AB, 0x2CB9, 0x4665, { 0x83, 0x60, 0xDD, 0xCF, 0x60, 0x54, 0xF7, 0x9D }}
|
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"
|
#include "BaseUefiTianoCustomDecompressLibInternals.h"
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
@@ -775,6 +776,7 @@ Returns:
|
|||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CustomDecompressGetInfo (
|
CustomDecompressGetInfo (
|
||||||
|
IN CONST GUID *DecompressGuid,
|
||||||
IN CONST VOID *Source,
|
IN CONST VOID *Source,
|
||||||
IN UINT32 SourceSize,
|
IN UINT32 SourceSize,
|
||||||
OUT UINT32 *DestinationSize,
|
OUT UINT32 *DestinationSize,
|
||||||
@@ -787,7 +789,7 @@ Routine Description:
|
|||||||
The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().
|
The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
DecompressGuid The guid matches this decompress method.
|
||||||
Source - The source buffer containing the compressed data.
|
Source - The source buffer containing the compressed data.
|
||||||
SourceSize - The size of source buffer
|
SourceSize - The size of source buffer
|
||||||
DestinationSize - The size of destination 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_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
|
||||||
RETURN_INVALID_PARAMETER - The source data is corrupted
|
RETURN_INVALID_PARAMETER - The source data is corrupted
|
||||||
|
RETURN_UNSUPPORTED - Decompress method is not supported.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
|
if (CompareGuid (DecompressGuid, &gTianoCustomDecompressGuid)) {
|
||||||
return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
|
return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
|
||||||
|
} else {
|
||||||
|
return RETURN_UNSUPPORTED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CustomDecompress (
|
CustomDecompress (
|
||||||
|
IN CONST GUID *DecompressGuid,
|
||||||
IN CONST VOID *Source,
|
IN CONST VOID *Source,
|
||||||
IN OUT VOID *Destination,
|
IN OUT VOID *Destination,
|
||||||
IN OUT VOID *Scratch
|
IN OUT VOID *Scratch
|
||||||
@@ -817,7 +825,7 @@ Routine Description:
|
|||||||
The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().
|
The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
DecompressGuid The guid matches this decompress method.
|
||||||
Source - The source buffer containing the compressed data.
|
Source - The source buffer containing the compressed data.
|
||||||
Destination - The destination buffer to store the decompressed 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.
|
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_SUCCESS - Decompression is successfull
|
||||||
RETURN_INVALID_PARAMETER - The source data is corrupted
|
RETURN_INVALID_PARAMETER - The source data is corrupted
|
||||||
|
RETURN_UNSUPPORTED - Decompress method is not supported.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
|
if (CompareGuid (DecompressGuid, &gTianoCustomDecompressGuid)) {
|
||||||
return UefiTianoDecompress (Source, Destination, Scratch, 2);
|
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
|
EDK_RELEASE_VERSION = 0x00020000
|
||||||
EFI_SPECIFICATION_VERSION = 0x00020000
|
EFI_SPECIFICATION_VERSION = 0x00020000
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# The following information is for reference only and not required by the build tools.
|
# The following information is for reference only and not required by the build tools.
|
||||||
#
|
#
|
||||||
@@ -38,8 +37,12 @@
|
|||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseMemoryLib
|
BaseMemoryLib
|
||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
gTianoCustomDecompressGuid
|
||||||
|
|
||||||
|
@@ -79,6 +79,7 @@
|
|||||||
CacheMaintenanceLib
|
CacheMaintenanceLib
|
||||||
PeCoffLoaderLib
|
PeCoffLoaderLib
|
||||||
UefiDecompressLib
|
UefiDecompressLib
|
||||||
|
CustomDecompressLib
|
||||||
PerformanceLib
|
PerformanceLib
|
||||||
HobLib
|
HobLib
|
||||||
BaseLib
|
BaseLib
|
||||||
|
@@ -213,6 +213,14 @@ IsValidSectionStream (
|
|||||||
IN UINTN SectionStreamLength
|
IN UINTN SectionStreamLength
|
||||||
);
|
);
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
CustomDecompressExtractSection (
|
||||||
|
IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
|
||||||
|
IN CONST VOID *InputSection,
|
||||||
|
OUT VOID **OutputBuffer,
|
||||||
|
OUT UINTN *OutputSize,
|
||||||
|
OUT UINT32 *AuthenticationStatus
|
||||||
|
);
|
||||||
//
|
//
|
||||||
// Module globals
|
// Module globals
|
||||||
//
|
//
|
||||||
@@ -226,6 +234,9 @@ EFI_SECTION_EXTRACTION_PROTOCOL mSectionExtraction = {
|
|||||||
CloseSectionStream
|
CloseSectionStream
|
||||||
};
|
};
|
||||||
|
|
||||||
|
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL mCustomDecompressExtraction = {
|
||||||
|
CustomDecompressExtractSection
|
||||||
|
};
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@@ -250,6 +261,8 @@ Returns:
|
|||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
EFI_GUID **DecompressGuidList;
|
||||||
|
UINT32 DecompressMethodNumber;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install SEP to a new handle
|
// Install SEP to a new handle
|
||||||
@@ -262,6 +275,34 @@ Returns:
|
|||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get custom decompress method guid list
|
||||||
|
//
|
||||||
|
DecompressGuidList = NULL;
|
||||||
|
DecompressMethodNumber = 0;
|
||||||
|
Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);
|
||||||
|
if (Status == EFI_OUT_OF_RESOURCES) {
|
||||||
|
DecompressGuidList = (EFI_GUID **) CoreAllocateBootServicesPool (DecompressMethodNumber * sizeof (EFI_GUID *));
|
||||||
|
ASSERT (DecompressGuidList != NULL);
|
||||||
|
Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);
|
||||||
|
}
|
||||||
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Install custom decompress guided extraction protocol
|
||||||
|
//
|
||||||
|
while (DecompressMethodNumber-- > 0) {
|
||||||
|
Status = CoreInstallProtocolInterface (
|
||||||
|
&mSectionExtractionHandle,
|
||||||
|
DecompressGuidList [DecompressMethodNumber],
|
||||||
|
EFI_NATIVE_INTERFACE,
|
||||||
|
&mCustomDecompressExtraction
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
CoreFreePool (DecompressGuidList);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -742,7 +783,7 @@ Returns:
|
|||||||
EFI_COMMON_SECTION_HEADER *SectionHeader;
|
EFI_COMMON_SECTION_HEADER *SectionHeader;
|
||||||
EFI_COMPRESSION_SECTION *CompressionHeader;
|
EFI_COMPRESSION_SECTION *CompressionHeader;
|
||||||
EFI_GUID_DEFINED_SECTION *GuidedHeader;
|
EFI_GUID_DEFINED_SECTION *GuidedHeader;
|
||||||
EFI_TIANO_DECOMPRESS_PROTOCOL *Decompress;
|
EFI_DECOMPRESS_PROTOCOL *Decompress;
|
||||||
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *GuidedExtraction;
|
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *GuidedExtraction;
|
||||||
VOID *NewStreamBuffer;
|
VOID *NewStreamBuffer;
|
||||||
VOID *ScratchBuffer;
|
VOID *ScratchBuffer;
|
||||||
@@ -1339,3 +1380,168 @@ Returns:
|
|||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
The ExtractSection() function processes the input section and
|
||||||
|
allocates a buffer from the pool in which it returns the section
|
||||||
|
contents. If the section being extracted contains
|
||||||
|
authentication information (the section's
|
||||||
|
GuidedSectionHeader.Attributes field has the
|
||||||
|
EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
|
||||||
|
returned in AuthenticationStatus must reflect the results of
|
||||||
|
the authentication operation. Depending on the algorithm and
|
||||||
|
size of the encapsulated data, the time that is required to do
|
||||||
|
a full authentication may be prohibitively long for some
|
||||||
|
classes of systems. To indicate this, use
|
||||||
|
EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
|
||||||
|
the security policy driver (see the Platform Initialization
|
||||||
|
Driver Execution Environment Core Interface Specification for
|
||||||
|
more details and the GUID definition). If the
|
||||||
|
EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
|
||||||
|
database, then, if possible, full authentication should be
|
||||||
|
skipped and the section contents simply returned in the
|
||||||
|
OutputBuffer. In this case, the
|
||||||
|
EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
|
||||||
|
must be set on return. ExtractSection() is callable only from
|
||||||
|
TPL_NOTIFY and below. Behavior of ExtractSection() at any
|
||||||
|
EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
|
||||||
|
defined in RaiseTPL() in the UEFI 2.0 specification.
|
||||||
|
|
||||||
|
|
||||||
|
@param This Indicates the
|
||||||
|
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
|
||||||
|
|
||||||
|
@param InputSection Buffer containing the input GUIDed section
|
||||||
|
to be processed. OutputBuffer OutputBuffer
|
||||||
|
is allocated from boot services pool
|
||||||
|
memory and contains the new section
|
||||||
|
stream. The caller is responsible for
|
||||||
|
freeing this buffer.
|
||||||
|
|
||||||
|
@param OutputSize A pointer to a caller-allocated UINTN in
|
||||||
|
which the size of OutputBuffer allocation
|
||||||
|
is stored. If the function returns
|
||||||
|
anything other than EFI_SUCCESS, the value
|
||||||
|
of OutputSize is undefined.
|
||||||
|
|
||||||
|
@param AuthenticationStatus A pointer to a caller-allocated
|
||||||
|
UINT32 that indicates the
|
||||||
|
authentication status of the
|
||||||
|
output buffer. If the input
|
||||||
|
section's
|
||||||
|
GuidedSectionHeader.Attributes
|
||||||
|
field has the
|
||||||
|
EFI_GUIDED_SECTION_AUTH_STATUS_VAL
|
||||||
|
bit as clear, AuthenticationStatus
|
||||||
|
must return zero. Both local bits
|
||||||
|
(19:16) and aggregate bits (3:0)
|
||||||
|
in AuthenticationStatus are
|
||||||
|
returned by ExtractSection().
|
||||||
|
These bits reflect the status of
|
||||||
|
the extraction operation. The bit
|
||||||
|
pattern in both regions must be
|
||||||
|
the same, as the local and
|
||||||
|
aggregate authentication statuses
|
||||||
|
have equivalent meaning at this
|
||||||
|
level. If the function returns
|
||||||
|
anything other than EFI_SUCCESS,
|
||||||
|
the value of AuthenticationStatus
|
||||||
|
is undefined.
|
||||||
|
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The InputSection was successfully
|
||||||
|
processed and the section contents were
|
||||||
|
returned.
|
||||||
|
|
||||||
|
@retval EFI_OUT_OF_RESOURCES The system has insufficient
|
||||||
|
resources to process the
|
||||||
|
request.
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER The GUID in InputSection does
|
||||||
|
not match this instance of the
|
||||||
|
GUIDed Section Extraction
|
||||||
|
Protocol.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
CustomDecompressExtractSection (
|
||||||
|
IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
|
||||||
|
IN CONST VOID *InputSection,
|
||||||
|
OUT VOID **OutputBuffer,
|
||||||
|
OUT UINTN *OutputSize,
|
||||||
|
OUT UINT32 *AuthenticationStatus
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINT8 *ScratchBuffer;
|
||||||
|
UINT32 ScratchSize;
|
||||||
|
UINT32 SectionLength;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set authentic value to zero.
|
||||||
|
//
|
||||||
|
*AuthenticationStatus = 0;
|
||||||
|
//
|
||||||
|
// Calculate Section data Size
|
||||||
|
//
|
||||||
|
SectionLength = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;
|
||||||
|
//
|
||||||
|
// Get compressed data information
|
||||||
|
//
|
||||||
|
Status = CustomDecompressGetInfo (
|
||||||
|
(GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),
|
||||||
|
(UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),
|
||||||
|
SectionLength - sizeof (EFI_GUID_DEFINED_SECTION),
|
||||||
|
OutputSize,
|
||||||
|
&ScratchSize
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// GetInfo failed
|
||||||
|
//
|
||||||
|
DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allocate scratch buffer
|
||||||
|
//
|
||||||
|
ScratchBuffer = CoreAllocateBootServicesPool (ScratchSize);
|
||||||
|
if (ScratchBuffer == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Allocate destination buffer
|
||||||
|
//
|
||||||
|
*OutputBuffer = CoreAllocateBootServicesPool (*OutputSize);
|
||||||
|
if (*OutputBuffer == NULL) {
|
||||||
|
CoreFreePool (ScratchBuffer);
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call decompress function
|
||||||
|
//
|
||||||
|
Status = CustomDecompress (
|
||||||
|
(GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),
|
||||||
|
(UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),
|
||||||
|
*OutputBuffer,
|
||||||
|
ScratchBuffer
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Decompress failed
|
||||||
|
//
|
||||||
|
CoreFreePool (ScratchBuffer);
|
||||||
|
CoreFreePool (*OutputBuffer);
|
||||||
|
DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Free unused scratch buffer.
|
||||||
|
//
|
||||||
|
CoreFreePool (ScratchBuffer);
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
@@ -1,47 +0,0 @@
|
|||||||
/*++
|
|
||||||
|
|
||||||
Copyright (c) 2006, 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:
|
|
||||||
|
|
||||||
DecompressLibraryHob.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Declaration of HOB that is used to pass decompressor library functions from PEI to DXE
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef __DECOMPRESS_LIBRARY_H__
|
|
||||||
#define __DECOMPRESS_LIBRARY_H__
|
|
||||||
|
|
||||||
typedef
|
|
||||||
RETURN_STATUS
|
|
||||||
(EFIAPI *DECOMPRESS_LIBRARY_GET_INFO) (
|
|
||||||
IN CONST VOID *Source,
|
|
||||||
IN UINT32 SourceSize,
|
|
||||||
OUT UINT32 *DestinationSize,
|
|
||||||
OUT UINT32 *ScratchSize
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef
|
|
||||||
RETURN_STATUS
|
|
||||||
(EFIAPI *DECOMPRESS_LIBRARY_DECOMPRESS) (
|
|
||||||
IN CONST VOID *Source,
|
|
||||||
IN OUT VOID *Destination,
|
|
||||||
IN OUT VOID *Scratch
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
DECOMPRESS_LIBRARY_GET_INFO GetInfo;
|
|
||||||
DECOMPRESS_LIBRARY_DECOMPRESS Decompress;
|
|
||||||
} DECOMPRESS_LIBRARY;
|
|
||||||
|
|
||||||
#endif
|
|
@@ -59,7 +59,7 @@ extern BOOLEAN gInMemory;
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
PeiFindFile (
|
PeiFindFile (
|
||||||
IN UINT8 Type,
|
IN UINT8 Type,
|
||||||
IN UINT16 SectionType,
|
IN EFI_SECTION_TYPE SectionType,
|
||||||
OUT EFI_GUID *FileName,
|
OUT EFI_GUID *FileName,
|
||||||
OUT VOID **Pe32Data
|
OUT VOID **Pe32Data
|
||||||
)
|
)
|
||||||
@@ -124,7 +124,7 @@ HandOffToDxeCore (
|
|||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
PeiProcessFile (
|
PeiProcessFile (
|
||||||
IN UINT16 SectionType,
|
IN EFI_SECTION_TYPE SectionType,
|
||||||
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
|
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
|
||||||
OUT VOID **Pe32Data,
|
OUT VOID **Pe32Data,
|
||||||
IN EFI_PEI_HOB_POINTERS *OrigHob
|
IN EFI_PEI_HOB_POINTERS *OrigHob
|
||||||
|
@@ -21,12 +21,21 @@ Abstract:
|
|||||||
--*/
|
--*/
|
||||||
|
|
||||||
#include "DxeIpl.h"
|
#include "DxeIpl.h"
|
||||||
|
#include <Ppi/GuidedSectionExtraction.h>
|
||||||
|
|
||||||
// porting note remove later
|
// porting note remove later
|
||||||
#include "DecompressLibrary.h"
|
|
||||||
#include "FrameworkPei.h"
|
#include "FrameworkPei.h"
|
||||||
// end of remove later
|
// end of remove later
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
CustomDecompressExtractSection (
|
||||||
|
IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
|
||||||
|
IN CONST VOID *InputSection,
|
||||||
|
OUT VOID **OutputBuffer,
|
||||||
|
OUT UINTN *OutputSize,
|
||||||
|
OUT UINT32 *AuthenticationStatus
|
||||||
|
);
|
||||||
|
|
||||||
BOOLEAN gInMemory = FALSE;
|
BOOLEAN gInMemory = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -41,6 +50,10 @@ static EFI_PEI_FV_FILE_LOADER_PPI mLoadFilePpi = {
|
|||||||
DxeIplLoadFile
|
DxeIplLoadFile
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI mCustomDecompressExtractiongPpi = {
|
||||||
|
CustomDecompressExtractSection
|
||||||
|
};
|
||||||
|
|
||||||
static EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
|
static EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
|
||||||
{
|
{
|
||||||
EFI_PEI_PPI_DESCRIPTOR_PPI,
|
EFI_PEI_PPI_DESCRIPTOR_PPI,
|
||||||
@@ -60,16 +73,6 @@ static EFI_PEI_PPI_DESCRIPTOR mPpiSignal = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gEfiDecompress = {
|
|
||||||
UefiDecompressGetInfo,
|
|
||||||
UefiDecompress
|
|
||||||
};
|
|
||||||
|
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gCustomDecompress = {
|
|
||||||
CustomDecompressGetInfo,
|
|
||||||
CustomDecompress
|
|
||||||
};
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PeimInitializeDxeIpl (
|
PeimInitializeDxeIpl (
|
||||||
@@ -96,6 +99,9 @@ Returns:
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
|
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
|
||||||
EFI_BOOT_MODE BootMode;
|
EFI_BOOT_MODE BootMode;
|
||||||
|
EFI_GUID **DecompressGuidList;
|
||||||
|
UINT32 DecompressMethodNumber;
|
||||||
|
EFI_PEI_PPI_DESCRIPTOR *GuidPpi;
|
||||||
|
|
||||||
Status = PeiServicesGetBootMode (&BootMode);
|
Status = PeiServicesGetBootMode (&BootMode);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
@@ -111,6 +117,35 @@ Returns:
|
|||||||
//
|
//
|
||||||
Status = ShadowDxeIpl (FfsHeader, PeiEfiPeiPeCoffLoader);
|
Status = ShadowDxeIpl (FfsHeader, PeiEfiPeiPeCoffLoader);
|
||||||
} else {
|
} else {
|
||||||
|
//
|
||||||
|
// Get custom decompress method guid list
|
||||||
|
//
|
||||||
|
DecompressGuidList = NULL;
|
||||||
|
DecompressMethodNumber = 0;
|
||||||
|
Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);
|
||||||
|
if (Status == EFI_OUT_OF_RESOURCES) {
|
||||||
|
DecompressGuidList = (EFI_GUID **) AllocatePages (EFI_SIZE_TO_PAGES (DecompressMethodNumber * sizeof (EFI_GUID *)));
|
||||||
|
ASSERT (DecompressGuidList != NULL);
|
||||||
|
Status = CustomDecompressGetAlgorithms (DecompressGuidList, &DecompressMethodNumber);
|
||||||
|
}
|
||||||
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Install custom decompress extraction guid ppi
|
||||||
|
//
|
||||||
|
if (DecompressMethodNumber > 0) {
|
||||||
|
GuidPpi = NULL;
|
||||||
|
GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *) AllocatePages (EFI_SIZE_TO_PAGES (DecompressMethodNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR)));
|
||||||
|
ASSERT (GuidPpi != NULL);
|
||||||
|
while (DecompressMethodNumber-- > 0) {
|
||||||
|
GuidPpi->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
|
||||||
|
GuidPpi->Ppi = &mCustomDecompressExtractiongPpi;
|
||||||
|
GuidPpi->Guid = DecompressGuidList [DecompressMethodNumber];
|
||||||
|
Status = PeiServicesInstallPpi (GuidPpi++);
|
||||||
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install FvFileLoader and DxeIpl PPIs.
|
// Install FvFileLoader and DxeIpl PPIs.
|
||||||
//
|
//
|
||||||
@@ -205,7 +240,6 @@ Returns:
|
|||||||
PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
|
PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
|
||||||
ASSERT (PeiEfiPeiPeCoffLoader != NULL);
|
ASSERT (PeiEfiPeiPeCoffLoader != NULL);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE type compressed Firmware Volume file
|
// Find the EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE type compressed Firmware Volume file
|
||||||
// The file found will be processed by PeiProcessFile: It will first be decompressed to
|
// The file found will be processed by PeiProcessFile: It will first be decompressed to
|
||||||
@@ -251,36 +285,6 @@ Returns:
|
|||||||
DxeCoreEntryPoint
|
DxeCoreEntryPoint
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
// Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
|
|
||||||
//
|
|
||||||
REPORT_STATUS_CODE (
|
|
||||||
EFI_PROGRESS_CODE,
|
|
||||||
EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT
|
|
||||||
);
|
|
||||||
|
|
||||||
if (FeaturePcdGet (PcdDxeIplBuildShareCodeHobs)) {
|
|
||||||
if (FeaturePcdGet (PcdDxeIplSupportEfiDecompress)) {
|
|
||||||
//
|
|
||||||
// Add HOB for the EFI Decompress Protocol
|
|
||||||
//
|
|
||||||
BuildGuidDataHob (
|
|
||||||
&gEfiDecompressProtocolGuid,
|
|
||||||
(VOID *)&gEfiDecompress,
|
|
||||||
sizeof (gEfiDecompress)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (FeaturePcdGet (PcdDxeIplSupportCustomDecompress)) {
|
|
||||||
//
|
|
||||||
// Add HOB for the user customized Decompress Protocol
|
|
||||||
//
|
|
||||||
BuildGuidDataHob (
|
|
||||||
&gEfiCustomizedDecompressProtocolGuid,
|
|
||||||
(VOID *)&gCustomDecompress,
|
|
||||||
sizeof (gCustomDecompress)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add HOB for the PE/COFF Loader Protocol
|
// Add HOB for the PE/COFF Loader Protocol
|
||||||
//
|
//
|
||||||
@@ -289,7 +293,13 @@ Returns:
|
|||||||
(VOID *)&PeiEfiPeiPeCoffLoader,
|
(VOID *)&PeiEfiPeiPeCoffLoader,
|
||||||
sizeof (VOID *)
|
sizeof (VOID *)
|
||||||
);
|
);
|
||||||
}
|
//
|
||||||
|
// Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
|
||||||
|
//
|
||||||
|
REPORT_STATUS_CODE (
|
||||||
|
EFI_PROGRESS_CODE,
|
||||||
|
EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Transfer control to the DXE Core
|
// Transfer control to the DXE Core
|
||||||
@@ -311,7 +321,7 @@ Returns:
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
PeiFindFile (
|
PeiFindFile (
|
||||||
IN UINT8 Type,
|
IN UINT8 Type,
|
||||||
IN UINT16 SectionType,
|
IN EFI_SECTION_TYPE SectionType,
|
||||||
OUT EFI_GUID *FileName,
|
OUT EFI_GUID *FileName,
|
||||||
OUT VOID **Pe32Data
|
OUT VOID **Pe32Data
|
||||||
)
|
)
|
||||||
@@ -609,7 +619,7 @@ Returns:
|
|||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
PeiProcessFile (
|
PeiProcessFile (
|
||||||
IN UINT16 SectionType,
|
IN EFI_SECTION_TYPE SectionType,
|
||||||
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
|
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
|
||||||
OUT VOID **Pe32Data,
|
OUT VOID **Pe32Data,
|
||||||
IN EFI_PEI_HOB_POINTERS *OrigHob
|
IN EFI_PEI_HOB_POINTERS *OrigHob
|
||||||
@@ -635,8 +645,6 @@ Returns:
|
|||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
VOID *SectionData;
|
|
||||||
DECOMPRESS_LIBRARY *DecompressLibrary;
|
|
||||||
UINT8 *DstBuffer;
|
UINT8 *DstBuffer;
|
||||||
UINT8 *ScratchBuffer;
|
UINT8 *ScratchBuffer;
|
||||||
UINT32 DstBufferSize;
|
UINT32 DstBufferSize;
|
||||||
@@ -649,41 +657,43 @@ Returns:
|
|||||||
EFI_COMMON_SECTION_HEADER *Section;
|
EFI_COMMON_SECTION_HEADER *Section;
|
||||||
UINTN SectionLength;
|
UINTN SectionLength;
|
||||||
UINTN OccupiedSectionLength;
|
UINTN OccupiedSectionLength;
|
||||||
UINT64 FileSize;
|
UINTN FileSize;
|
||||||
UINT32 AuthenticationStatus;
|
|
||||||
EFI_PEI_SECTION_EXTRACTION_PPI *SectionExtract;
|
|
||||||
UINT32 BufferSize;
|
|
||||||
UINT8 *Buffer;
|
|
||||||
EFI_PEI_SECURITY_PPI *Security;
|
|
||||||
BOOLEAN StartCrisisRecovery;
|
|
||||||
EFI_GUID TempGuid;
|
|
||||||
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
|
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
|
||||||
EFI_COMPRESSION_SECTION *CompressionSection;
|
EFI_COMPRESSION_SECTION *CompressionSection;
|
||||||
|
EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *SectionExtract;
|
||||||
|
UINT32 AuthenticationStatus;
|
||||||
|
|
||||||
|
//
|
||||||
|
// First try to find the required section in this ffs file.
|
||||||
|
//
|
||||||
|
Status = PeiServicesFfsFindSectionData (
|
||||||
|
SectionType,
|
||||||
|
FfsFileHeader,
|
||||||
|
Pe32Data
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// If not found, the required section may be in guided or compressed section.
|
||||||
|
// So, search guided or compressed section to process
|
||||||
|
//
|
||||||
|
Section = (EFI_COMMON_SECTION_HEADER *) (UINTN) (VOID *) ((UINT8 *) (FfsFileHeader) + (UINTN) sizeof (EFI_FFS_FILE_HEADER));
|
||||||
|
FileSize = FfsFileHeader->Size[0] & 0xFF;
|
||||||
|
FileSize += (FfsFileHeader->Size[1] << 8) & 0xFF00;
|
||||||
|
FileSize += (FfsFileHeader->Size[2] << 16) & 0xFF0000;
|
||||||
|
FileSize &= 0x00FFFFFF;
|
||||||
|
OccupiedSectionLength = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
//
|
//
|
||||||
// Initialize local variables.
|
// Initialize local variables.
|
||||||
//
|
//
|
||||||
DecompressLibrary = NULL;
|
|
||||||
DstBuffer = NULL;
|
DstBuffer = NULL;
|
||||||
DstBufferSize = 0;
|
DstBufferSize = 0;
|
||||||
|
|
||||||
Status = PeiServicesFfsFindSectionData (
|
Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);
|
||||||
EFI_SECTION_COMPRESSION,
|
|
||||||
FfsFileHeader,
|
|
||||||
&SectionData
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// First process the compression section
|
|
||||||
//
|
|
||||||
if (!EFI_ERROR (Status)) {
|
|
||||||
//
|
|
||||||
// Yes, there is a compression section, so extract the contents
|
|
||||||
// Decompress the image here
|
|
||||||
//
|
|
||||||
Section = (EFI_COMMON_SECTION_HEADER *) (UINTN) (VOID *) ((UINT8 *) (FfsFileHeader) + (UINTN) sizeof (EFI_FFS_FILE_HEADER));
|
|
||||||
|
|
||||||
do {
|
|
||||||
SectionLength = *(UINT32 *) (Section->Size) & 0x00ffffff;
|
SectionLength = *(UINT32 *) (Section->Size) & 0x00ffffff;
|
||||||
OccupiedSectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);
|
OccupiedSectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);
|
||||||
|
|
||||||
@@ -691,85 +701,44 @@ Returns:
|
|||||||
// Was the DXE Core file encapsulated in a GUID'd section?
|
// Was the DXE Core file encapsulated in a GUID'd section?
|
||||||
//
|
//
|
||||||
if (Section->Type == EFI_SECTION_GUID_DEFINED) {
|
if (Section->Type == EFI_SECTION_GUID_DEFINED) {
|
||||||
|
|
||||||
//
|
|
||||||
// This following code constitutes the addition of the security model
|
|
||||||
// to the DXE IPL.
|
|
||||||
//
|
|
||||||
//
|
//
|
||||||
// Set a default authenticatino state
|
// Set a default authenticatino state
|
||||||
//
|
//
|
||||||
AuthenticationStatus = 0;
|
AuthenticationStatus = 0;
|
||||||
|
//
|
||||||
|
// Locate extract guid section ppi
|
||||||
|
//
|
||||||
Status = PeiServicesLocatePpi (
|
Status = PeiServicesLocatePpi (
|
||||||
&gEfiPeiSectionExtractionPpiGuid,
|
(EFI_GUID *) (Section + 1),
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
(VOID **)&SectionExtract
|
(VOID **)&SectionExtract
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
//
|
||||||
|
// ignore the unknown guid section
|
||||||
|
//
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Verify Authentication State
|
// Extract the contents from guid section
|
||||||
//
|
//
|
||||||
CopyMem (&TempGuid, Section + 1, sizeof (EFI_GUID));
|
Status = SectionExtract->ExtractSection (
|
||||||
|
|
||||||
Status = SectionExtract->PeiGetSection (
|
|
||||||
GetPeiServicesTablePointer(),
|
|
||||||
SectionExtract,
|
SectionExtract,
|
||||||
(EFI_SECTION_TYPE *) &SectionType,
|
(VOID *) Section,
|
||||||
&TempGuid,
|
(VOID **) &DstBuffer,
|
||||||
0,
|
&DstBufferSize,
|
||||||
(VOID **) &Buffer,
|
|
||||||
&BufferSize,
|
|
||||||
&AuthenticationStatus
|
&AuthenticationStatus
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((EFI_D_ERROR, "Extract section content failed - %r\n", Status));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// If not ask the Security PPI, if exists, for disposition
|
// Todo check AuthenticationStatus and do the verify
|
||||||
//
|
//
|
||||||
//
|
|
||||||
Status = PeiServicesLocatePpi (
|
|
||||||
&gEfiPeiSecurityPpiGuid,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
(VOID **)&Security
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = Security->AuthenticationState (
|
|
||||||
GetPeiServicesTablePointer(),
|
|
||||||
(struct _EFI_PEI_SECURITY_PPI *) Security,
|
|
||||||
AuthenticationStatus,
|
|
||||||
FfsFileHeader,
|
|
||||||
&StartCrisisRecovery
|
|
||||||
);
|
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// If there is a security violation, report to caller and have
|
|
||||||
// the upper-level logic possible engender a crisis recovery
|
|
||||||
//
|
|
||||||
if (StartCrisisRecovery) {
|
|
||||||
return EFI_SECURITY_VIOLATION;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Section->Type == EFI_SECTION_PE32) {
|
|
||||||
//
|
|
||||||
// This is what we want
|
|
||||||
//
|
|
||||||
*Pe32Data = (VOID *) (Section + 1);
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
} else if (Section->Type == EFI_SECTION_COMPRESSION) {
|
} else if (Section->Type == EFI_SECTION_COMPRESSION) {
|
||||||
//
|
//
|
||||||
// This is a compression set, expand it
|
// This is a compression set, expand it
|
||||||
@@ -780,11 +749,48 @@ Returns:
|
|||||||
case EFI_STANDARD_COMPRESSION:
|
case EFI_STANDARD_COMPRESSION:
|
||||||
//
|
//
|
||||||
// Load EFI standard compression.
|
// Load EFI standard compression.
|
||||||
|
// For compressed data, decompress them to dstbuffer.
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdDxeIplSupportTianoDecompress)) {
|
Status = UefiDecompressGetInfo (
|
||||||
DecompressLibrary = &gEfiDecompress;
|
(UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
|
||||||
} else {
|
(UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION),
|
||||||
ASSERT (FALSE);
|
&DstBufferSize,
|
||||||
|
&ScratchBufferSize
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// GetInfo failed
|
||||||
|
//
|
||||||
|
DEBUG ((EFI_D_ERROR, "Decompress GetInfo Failed - %r\n", Status));
|
||||||
|
return EFI_NOT_FOUND;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Allocate scratch buffer
|
||||||
|
//
|
||||||
|
ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));
|
||||||
|
if (ScratchBuffer == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Allocate destination buffer
|
||||||
|
//
|
||||||
|
DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
|
||||||
|
if (DstBuffer == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Call decompress function
|
||||||
|
//
|
||||||
|
Status = UefiDecompress (
|
||||||
|
(CHAR8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
|
||||||
|
DstBuffer,
|
||||||
|
ScratchBuffer
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Decompress failed
|
||||||
|
//
|
||||||
|
DEBUG ((EFI_D_ERROR, "Decompress Failed - %r\n", Status));
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -813,60 +819,15 @@ Returns:
|
|||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (CompressionSection->CompressionType != EFI_NOT_COMPRESSED) {
|
|
||||||
//
|
//
|
||||||
// For compressed data, decompress them to dstbuffer.
|
// ignore other type sections
|
||||||
//
|
//
|
||||||
Status = DecompressLibrary->GetInfo (
|
continue;
|
||||||
(UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
|
|
||||||
(UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION),
|
|
||||||
&DstBufferSize,
|
|
||||||
&ScratchBufferSize
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
//
|
|
||||||
// GetInfo failed
|
|
||||||
//
|
|
||||||
DEBUG ((EFI_D_ERROR, "Decompress GetInfo Failed - %r\n", Status));
|
|
||||||
return EFI_NOT_FOUND;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate scratch buffer
|
// Extract contents from guided or compressed sections.
|
||||||
//
|
|
||||||
ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));
|
|
||||||
if (ScratchBuffer == NULL) {
|
|
||||||
return EFI_OUT_OF_RESOURCES;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Allocate destination buffer
|
|
||||||
//
|
|
||||||
DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
|
|
||||||
if (DstBuffer == NULL) {
|
|
||||||
return EFI_OUT_OF_RESOURCES;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Call decompress function
|
|
||||||
//
|
|
||||||
Status = DecompressLibrary->Decompress (
|
|
||||||
(CHAR8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
|
|
||||||
DstBuffer,
|
|
||||||
ScratchBuffer
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
//
|
|
||||||
// Decompress failed
|
|
||||||
//
|
|
||||||
DEBUG ((EFI_D_ERROR, "Decompress Failed - %r\n", Status));
|
|
||||||
return EFI_NOT_FOUND;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Decompress successfully.
|
|
||||||
// Loop the decompressed data searching for expected section.
|
// Loop the decompressed data searching for expected section.
|
||||||
//
|
//
|
||||||
CmpSection = (EFI_COMMON_SECTION_HEADER *) DstBuffer;
|
CmpSection = (EFI_COMMON_SECTION_HEADER *) DstBuffer;
|
||||||
@@ -878,10 +839,7 @@ Returns:
|
|||||||
//
|
//
|
||||||
// This is what we want
|
// This is what we want
|
||||||
//
|
//
|
||||||
if (SectionType == EFI_SECTION_PE32) {
|
if (SectionType == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) {
|
||||||
*Pe32Data = (VOID *) (CmpSection + 1);
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
} else if (SectionType == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) {
|
|
||||||
//
|
//
|
||||||
// Firmware Volume Image in this Section
|
// Firmware Volume Image in this Section
|
||||||
// Skip the section header to get FvHeader
|
// Skip the section header to get FvHeader
|
||||||
@@ -896,10 +854,6 @@ Returns:
|
|||||||
// we need to reload this FvImage to another correct memory address.
|
// we need to reload this FvImage to another correct memory address.
|
||||||
//
|
//
|
||||||
if (((UINTN) FvHeader % sizeof (UINT64)) != 0) {
|
if (((UINTN) FvHeader % sizeof (UINT64)) != 0) {
|
||||||
DstBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES ((UINTN) CmpSectionLength - sizeof (EFI_COMMON_SECTION_HEADER)), sizeof (UINT64));
|
|
||||||
if (DstBuffer == NULL) {
|
|
||||||
return EFI_OUT_OF_RESOURCES;
|
|
||||||
}
|
|
||||||
CopyMem (DstBuffer, FvHeader, (UINTN) CmpSectionLength - sizeof (EFI_COMMON_SECTION_HEADER));
|
CopyMem (DstBuffer, FvHeader, (UINTN) CmpSectionLength - sizeof (EFI_COMMON_SECTION_HEADER));
|
||||||
FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) DstBuffer;
|
FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) DstBuffer;
|
||||||
}
|
}
|
||||||
@@ -915,61 +869,155 @@ Returns:
|
|||||||
if (OrigHob != NULL) {
|
if (OrigHob != NULL) {
|
||||||
OrigHob->Header->HobType = EFI_HOB_TYPE_UNUSED;
|
OrigHob->Header->HobType = EFI_HOB_TYPE_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// return found FvImage data.
|
// return found FvImage data.
|
||||||
//
|
//
|
||||||
*Pe32Data = (VOID *) FvHeader;
|
*Pe32Data = (VOID *) FvHeader;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// direct return the found section.
|
||||||
|
//
|
||||||
|
*Pe32Data = (VOID *) (CmpSection + 1);
|
||||||
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OccupiedCmpSectionLength = GET_OCCUPIED_SIZE (CmpSectionLength, 4);
|
OccupiedCmpSectionLength = GET_OCCUPIED_SIZE (CmpSectionLength, 4);
|
||||||
CmpSection = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) CmpSection + OccupiedCmpSectionLength);
|
CmpSection = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) CmpSection + OccupiedCmpSectionLength);
|
||||||
} while (CmpSection->Type != 0 && (UINTN) ((UINT8 *) CmpSection - (UINT8 *) CmpFileData) < CmpFileSize);
|
} while (CmpSection->Type != 0 && (UINTN) ((UINT8 *) CmpSection - (UINT8 *) CmpFileData) < CmpFileSize);
|
||||||
}
|
} while (Section->Type != 0 && (UINTN) ((UINT8 *) Section + OccupiedSectionLength - (UINT8 *) FfsFileHeader) < FileSize);
|
||||||
//
|
|
||||||
// End of the decompression activity
|
|
||||||
//
|
|
||||||
|
|
||||||
Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);
|
|
||||||
FileSize = FfsFileHeader->Size[0] & 0xFF;
|
|
||||||
FileSize += (FfsFileHeader->Size[1] << 8) & 0xFF00;
|
|
||||||
FileSize += (FfsFileHeader->Size[2] << 16) & 0xFF0000;
|
|
||||||
FileSize &= 0x00FFFFFF;
|
|
||||||
} while (Section->Type != 0 && (UINTN) ((UINT8 *) Section - (UINT8 *) FfsFileHeader) < FileSize);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// search all sections (compression and non compression) in this FFS, don't
|
// search all sections (compression and non compression) in this FFS, don't
|
||||||
// find expected section.
|
// find expected section.
|
||||||
//
|
//
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
} else {
|
}
|
||||||
//
|
|
||||||
// For those FFS that doesn't contain compression section, directly search
|
|
||||||
// PE or TE section in this FFS.
|
|
||||||
//
|
|
||||||
|
|
||||||
Status = PeiServicesFfsFindSectionData (
|
/**
|
||||||
EFI_SECTION_PE32,
|
The ExtractSection() function processes the input section and
|
||||||
FfsFileHeader,
|
returns a pointer to the section contents. If the section being
|
||||||
&SectionData
|
extracted does not require processing (if the section
|
||||||
);
|
GuidedSectionHeader.Attributes has the
|
||||||
|
EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then
|
||||||
|
OutputBuffer is just updated to point to the start of the
|
||||||
|
section's contents. Otherwise, *Buffer must be allocated
|
||||||
|
from PEI permanent memory.
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
@param This Indicates the
|
||||||
Status = PeiServicesFfsFindSectionData (
|
EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.
|
||||||
EFI_SECTION_TE,
|
Buffer containing the input GUIDed section to be
|
||||||
FfsFileHeader,
|
processed. OutputBuffer OutputBuffer is
|
||||||
&SectionData
|
allocated from PEI permanent memory and contains
|
||||||
|
the new section stream.
|
||||||
|
|
||||||
|
@param OutputSize A pointer to a caller-allocated
|
||||||
|
UINTN in which the size of *OutputBuffer
|
||||||
|
allocation is stored. If the function
|
||||||
|
returns anything other than EFI_SUCCESS,
|
||||||
|
the value of OutputSize is undefined.
|
||||||
|
|
||||||
|
@param AuthenticationStatus A pointer to a caller-allocated
|
||||||
|
UINT32 that indicates the
|
||||||
|
authentication status of the
|
||||||
|
output buffer. If the input
|
||||||
|
section's GuidedSectionHeader.
|
||||||
|
Attributes field has the
|
||||||
|
EFI_GUIDED_SECTION_AUTH_STATUS_VALID
|
||||||
|
bit as clear,
|
||||||
|
AuthenticationStatus must return
|
||||||
|
zero. These bits reflect the
|
||||||
|
status of the extraction
|
||||||
|
operation. If the function
|
||||||
|
returns anything other than
|
||||||
|
EFI_SUCCESS, the value of
|
||||||
|
AuthenticationStatus is
|
||||||
|
undefined.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The InputSection was
|
||||||
|
successfully processed and the
|
||||||
|
section contents were returned.
|
||||||
|
|
||||||
|
@retval EFI_OUT_OF_RESOURCES The system has insufficient
|
||||||
|
resources to process the request.
|
||||||
|
|
||||||
|
@reteval EFI_INVALID_PARAMETER The GUID in InputSection does
|
||||||
|
not match this instance of the
|
||||||
|
GUIDed Section Extraction PPI.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
CustomDecompressExtractSection (
|
||||||
|
IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
|
||||||
|
IN CONST VOID *InputSection,
|
||||||
|
OUT VOID **OutputBuffer,
|
||||||
|
OUT UINTN *OutputSize,
|
||||||
|
OUT UINT32 *AuthenticationStatus
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINT8 *ScratchBuffer;
|
||||||
|
UINT32 ScratchSize;
|
||||||
|
UINT32 SectionLength;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set authentic value to zero.
|
||||||
|
//
|
||||||
|
*AuthenticationStatus = 0;
|
||||||
|
//
|
||||||
|
// Calculate Section data Size
|
||||||
|
//
|
||||||
|
SectionLength = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;
|
||||||
|
//
|
||||||
|
// Get compressed data information
|
||||||
|
//
|
||||||
|
Status = CustomDecompressGetInfo (
|
||||||
|
(GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),
|
||||||
|
(UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),
|
||||||
|
SectionLength - sizeof (EFI_GUID_DEFINED_SECTION),
|
||||||
|
OutputSize,
|
||||||
|
&ScratchSize
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// GetInfo failed
|
||||||
|
//
|
||||||
|
DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allocate scratch buffer
|
||||||
|
//
|
||||||
|
ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchSize));
|
||||||
|
if (ScratchBuffer == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// Allocate destination buffer
|
||||||
|
//
|
||||||
|
*OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (*OutputSize));
|
||||||
|
if (*OutputBuffer == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
*Pe32Data = SectionData;
|
//
|
||||||
|
// Call decompress function
|
||||||
|
//
|
||||||
|
Status = CustomDecompress (
|
||||||
|
(GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)),
|
||||||
|
(UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION),
|
||||||
|
*OutputBuffer,
|
||||||
|
ScratchBuffer
|
||||||
|
);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Decompress failed
|
||||||
|
//
|
||||||
|
DEBUG ((EFI_D_ERROR, "Extract guided section Failed - %r\n", Status));
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,21 +16,63 @@
|
|||||||
#ifndef __CUSTOM_DECPOMPRESS_LIB_H__
|
#ifndef __CUSTOM_DECPOMPRESS_LIB_H__
|
||||||
#define __CUSTOM_DECPOMPRESS_LIB_H__
|
#define __CUSTOM_DECPOMPRESS_LIB_H__
|
||||||
|
|
||||||
|
/**
|
||||||
|
Decompress GetInfo fucntion.
|
||||||
|
|
||||||
|
@param[in] DecompressGuid The guid matches this decompress method.
|
||||||
|
@param[in] Source The source buffer containing the compressed data.
|
||||||
|
@param[in] SourceSize The size of source buffer
|
||||||
|
@param[out] DestinationSize The size of destination buffer.
|
||||||
|
@param[out] ScratchSize The size of scratch buffer.
|
||||||
|
|
||||||
|
@retval RETURN_SUCCESS The size of destination buffer and the size of scratch buffer are successull retrieved.
|
||||||
|
@retval RETURN_INVALID_PARAMETER The source data is corrupted
|
||||||
|
|
||||||
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CustomDecompressGetInfo (
|
CustomDecompressGetInfo (
|
||||||
|
IN CONST GUID *DecompressGuid,
|
||||||
IN CONST VOID *Source,
|
IN CONST VOID *Source,
|
||||||
IN UINT32 SourceSize,
|
IN UINT32 SourceSize,
|
||||||
OUT UINT32 *DestinationSize,
|
OUT UINT32 *DestinationSize,
|
||||||
OUT UINT32 *ScratchSize
|
OUT UINT32 *ScratchSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Decompress fucntion.
|
||||||
|
|
||||||
|
@param[in] DecompressGuid The guid matches this decompress method.
|
||||||
|
@param[in] Source The source buffer containing the compressed data.
|
||||||
|
@param[in] Destination The destination buffer to store the decompressed data
|
||||||
|
@param[out] Scratch The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
|
||||||
|
|
||||||
|
@retval RETURN_SUCCESS Decompression is successfull
|
||||||
|
@retval RETURN_INVALID_PARAMETER The source data is corrupted
|
||||||
|
|
||||||
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CustomDecompress (
|
CustomDecompress (
|
||||||
|
IN CONST GUID *DecompressGuid,
|
||||||
IN CONST VOID *Source,
|
IN CONST VOID *Source,
|
||||||
IN OUT VOID *Destination,
|
IN OUT VOID *Destination,
|
||||||
IN OUT VOID *Scratch
|
IN OUT VOID *Scratch
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
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..
|
||||||
|
**/
|
||||||
|
RETURN_STATUS
|
||||||
|
EFIAPI
|
||||||
|
CustomDecompressGetAlgorithms (
|
||||||
|
IN OUT GUID **AlgorithmGuidTable,
|
||||||
|
IN OUT UINTN *NumberOfAlgorithms
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CustomDecompressGetInfo (
|
CustomDecompressGetInfo (
|
||||||
|
IN CONST GUID *DecompressGuid,
|
||||||
IN CONST VOID *Source,
|
IN CONST VOID *Source,
|
||||||
IN UINT32 SourceSize,
|
IN UINT32 SourceSize,
|
||||||
OUT UINT32 *DestinationSize,
|
OUT UINT32 *DestinationSize,
|
||||||
@@ -56,6 +57,7 @@ CustomDecompressGetInfo (
|
|||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
CustomDecompress (
|
CustomDecompress (
|
||||||
|
IN const GUID *DecompressGuid,
|
||||||
IN CONST VOID *Source,
|
IN CONST VOID *Source,
|
||||||
IN OUT VOID *Destination,
|
IN OUT VOID *Destination,
|
||||||
IN OUT VOID *Scratch
|
IN OUT VOID *Scratch
|
||||||
@@ -63,3 +65,22 @@ CustomDecompress (
|
|||||||
{
|
{
|
||||||
return RETURN_UNSUPPORTED;
|
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..
|
||||||
|
**/
|
||||||
|
RETURN_STATUS
|
||||||
|
EFIAPI
|
||||||
|
CustomDecompressGetAlgorithms (
|
||||||
|
IN OUT GUID **AlgorithmGuidTable,
|
||||||
|
IN OUT UINTN *NumberOfAlgorithms
|
||||||
|
)
|
||||||
|
{
|
||||||
|
*NumberOfAlgorithms = 0;
|
||||||
|
return RETURN_SUCCESS;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user