summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-04 16:17:47 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-04 16:17:47 +0000
commit090d308851492a7b647fab6451fa1a1bb763d6d5 (patch)
tree072e67ea2532617a72ac7096bac508005b17f4c3 /IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
parent807765a03498215a51ba41e17d904ce14a3a074a (diff)
downloadedk2-platforms-090d308851492a7b647fab6451fa1a1bb763d6d5.tar.xz
IntelFrameworkModulePkg LZMA: Support running LZMA from flash/rom
Previously the code relied upon global variables which could not be modified if the code was running from ROM (or similarly a flash memory which is not easily modified). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9667 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c')
-rw-r--r--IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
index ff91600afd..37dbca0ef0 100644
--- a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
+++ b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
@@ -73,7 +73,7 @@ LzmaGuidedSectionGetInfo (
return LzmaUefiDecompressGetInfo (
(UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
- (*(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
OutputBufferSize,
ScratchBufferSize
);
@@ -137,6 +137,7 @@ LzmaGuidedSectionExtraction (
return LzmaUefiDecompress (
(UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
+ SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset,
*OutputBuffer,
ScratchBuffer
);