summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-11 08:18:17 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-11 08:18:17 +0000
commit2a86ff1cb089d7fb1589e1da54ea880721371000 (patch)
tree94ee1e7a05b2627219ba3b3afeac7a34eabfecd6 /MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
parent4e5d040ff8f3f741bbf889cb5cb0d431a61b2017 (diff)
downloadedk2-2a86ff1cb089d7fb1589e1da54ea880721371000.zip
edk2-2a86ff1cb089d7fb1589e1da54ea880721371000.tar.gz
edk2-2a86ff1cb089d7fb1589e1da54ea880721371000.tar.bz2
Code Scrub for DxeCrc32GuidedSectionExtractLib library instance.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5455 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c')
-rw-r--r--MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
index 99f7285..7271108 100644
--- a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
+++ b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
@@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
+#define EFI_SECITON_SIZE_MASK 0x00ffffff
+
typedef struct {
EFI_GUID_DEFINED_SECTION GuidedSectionHeader;
UINT32 CRC32Checksum;
@@ -64,7 +66,7 @@ Crc32GuidedSectionGetInfo (
//
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;
*ScratchBufferSize = 0;
- *OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;
+ *OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK;
*OutputBufferSize -= ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
return EFI_SUCCESS;
@@ -117,7 +119,7 @@ Crc32GuidedSectionHandler (
//
Crc32SectionHeader = (CRC32_SECTION_HEADER *) InputSection;
*OutputBuffer = (UINT8 *) InputSection + Crc32SectionHeader->GuidedSectionHeader.DataOffset;
- OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;
+ OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK;
OutputBufferSize -= Crc32SectionHeader->GuidedSectionHeader.DataOffset;
//