diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-24 07:57:42 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-24 07:57:42 +0000 |
commit | 121ac757204b54316d4762840a52d618243f8d79 (patch) | |
tree | 2ef6b6caafc032073cf6311897da7bd3071ce78d /Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c | |
parent | 5547062df502d26985e47b870107c7f9f6838afb (diff) | |
download | edk2-platforms-121ac757204b54316d4762840a52d618243f8d79.tar.xz |
Update Nt32 FVB driver to provide the valid FvHeader that header checksum is zero.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7930 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c')
-rw-r--r-- | Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c index 350672448f..a3981f6b0f 100644 --- a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c +++ b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c @@ -1104,10 +1104,6 @@ Returns: --*/
{
- UINT16 *Ptr;
- UINT16 HeaderLength;
- UINT16 Checksum;
-
//
// Verify the header revision, header signature, length
// Length of FvBlock cannot be 2**64-1
@@ -1124,26 +1120,10 @@ Returns: //
// Verify the header checksum
//
- HeaderLength = (UINT16) (FwVolHeader->HeaderLength / 2);
- Ptr = (UINT16 *) FwVolHeader;
- Checksum = 0;
- while (HeaderLength > 0) {
- Checksum = (UINT16)(Checksum + (*Ptr));
- HeaderLength--;
- Ptr++;
- }
-
- if (Checksum != 0) {
+ if (CalculateCheckSum16 ((UINT16 *) FwVolHeader, FwVolHeader->HeaderLength) != 0) {
return EFI_NOT_FOUND;
}
- //
- // PI specification defines the name guid of FV exists in extension header.
- //
- if (FwVolHeader->ExtHeaderOffset == 0) {
- return EFI_NOT_FOUND;
- }
-
return EFI_SUCCESS;
}
@@ -1180,7 +1160,7 @@ Returns: UINTN NumOfBlocks;
EFI_PEI_HOB_POINTERS FvHob;
- //
+ //
// Get the DXE services table
//
DxeServices = gDS;
|