summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c')
-rw-r--r--MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c83
1 files changed, 43 insertions, 40 deletions
diff --git a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
index fefe020..70cfae5 100644
--- a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
@@ -61,31 +61,35 @@ LzmaArchGuidedSectionGetInfo (
if (IS_SECTION2 (InputSection)) {
if (!CompareGuid (
- &gLzmaF86CustomDecompressGuid,
- &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {
+ &gLzmaF86CustomDecompressGuid,
+ &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid)
+ ))
+ {
return RETURN_INVALID_PARAMETER;
}
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->Attributes;
return LzmaUefiDecompressGetInfo (
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,
- SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset,
+ (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset,
+ SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset,
OutputBufferSize,
ScratchBufferSize
);
} else {
if (!CompareGuid (
- &gLzmaF86CustomDecompressGuid,
- &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ &gLzmaF86CustomDecompressGuid,
+ &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid)
+ ))
+ {
return RETURN_INVALID_PARAMETER;
}
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes;
return LzmaUefiDecompressGetInfo (
- (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
- SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
+ (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset,
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset,
OutputBufferSize,
ScratchBufferSize
);
@@ -134,25 +138,25 @@ LzmaArchGuidedSectionExtraction (
OUT UINT32 *AuthenticationStatus
)
{
- EFI_GUID *InputGuid;
- VOID *Source;
- UINTN SourceSize;
- EFI_STATUS Status;
- UINT32 X86State;
- UINT32 OutputBufferSize;
- UINT32 ScratchBufferSize;
+ EFI_GUID *InputGuid;
+ VOID *Source;
+ UINTN SourceSize;
+ EFI_STATUS Status;
+ UINT32 X86State;
+ UINT32 OutputBufferSize;
+ UINT32 ScratchBufferSize;
ASSERT (OutputBuffer != NULL);
ASSERT (InputSection != NULL);
if (IS_SECTION2 (InputSection)) {
- InputGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
- Source = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
- SourceSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
+ InputGuid = &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid);
+ Source = (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;
+ SourceSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;
} else {
- InputGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
- Source = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
- SourceSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
+ InputGuid = &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid);
+ Source = (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;
+ SourceSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;
}
if (!CompareGuid (&gLzmaF86CustomDecompressGuid, InputGuid)) {
@@ -165,33 +169,32 @@ LzmaArchGuidedSectionExtraction (
*AuthenticationStatus = 0;
Status = LzmaUefiDecompress (
- Source,
- SourceSize,
- *OutputBuffer,
- ScratchBuffer
- );
+ Source,
+ SourceSize,
+ *OutputBuffer,
+ ScratchBuffer
+ );
//
// After decompress, the data need to be converted to the raw data.
//
if (!EFI_ERROR (Status)) {
Status = LzmaUefiDecompressGetInfo (
- Source,
- (UINT32) SourceSize,
- &OutputBufferSize,
- &ScratchBufferSize
- );
+ Source,
+ (UINT32)SourceSize,
+ &OutputBufferSize,
+ &ScratchBufferSize
+ );
if (!EFI_ERROR (Status)) {
- x86_Convert_Init(X86State);
- x86_Convert(*OutputBuffer, OutputBufferSize, 0, &X86State, 0);
+ x86_Convert_Init (X86State);
+ x86_Convert (*OutputBuffer, OutputBufferSize, 0, &X86State, 0);
}
}
return Status;
}
-
/**
Register LzmaArchDecompress and LzmaArchDecompressGetInfo handlers with LzmaF86CustomDecompressGuid.
@@ -205,8 +208,8 @@ LzmaArchDecompressLibConstructor (
)
{
return ExtractGuidedSectionRegisterHandlers (
- &gLzmaF86CustomDecompressGuid,
- LzmaArchGuidedSectionGetInfo,
- LzmaArchGuidedSectionExtraction
- );
+ &gLzmaF86CustomDecompressGuid,
+ LzmaArchGuidedSectionGetInfo,
+ LzmaArchGuidedSectionExtraction
+ );
}