Currently, CapsulePei assumes ScatterGatherList are all related. But, UEFI spec has no such requirement, ScatterGatherList may be standalone. So update CapsulePei to only ignore the invalid ScatterGatherList, and still keep the valid ScatterGatherList.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13305 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lzeng14 2012-05-11 01:41:28 +00:00
parent 240bc4ee8f
commit 31abeada42
1 changed files with 18 additions and 24 deletions

View File

@ -720,32 +720,26 @@ BuildCapsuleDescriptors (
Index = 0;
while (BlockListBuffer[Index] != 0) {
if (Index == 0) {
//
// For the first Capsule Image, test integrity of descriptors.
//
LastBlock = ValidateCapsuleIntegrity ((EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]);
//
// Test integrity of descriptors.
//
TempBlock = ValidateCapsuleIntegrity ((EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]);
if (TempBlock != NULL) {
if (LastBlock == NULL) {
return EFI_NOT_FOUND;
LastBlock = TempBlock;
//
// Return the base of the block descriptors
//
HeadBlock = (EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index];
} else {
//
// Combine the different BlockList into single BlockList.
//
LastBlock->Union.DataBlock = (EFI_PHYSICAL_ADDRESS)(UINTN)BlockListBuffer[Index];
LastBlock->Length = 0;
LastBlock = TempBlock;
}
//
// Return the base of the block descriptors
//
HeadBlock = (EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index];
} else {
//
// Test integrity of descriptors.
//
TempBlock = ValidateCapsuleIntegrity ((EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)BlockListBuffer[Index]);
if (TempBlock == NULL) {
return EFI_NOT_FOUND;
}
//
// Combine the different BlockList into single BlockList.
//
LastBlock->Union.DataBlock = (EFI_PHYSICAL_ADDRESS)(UINTN)BlockListBuffer[Index];
LastBlock->Length = 0;
LastBlock = TempBlock;
}
Index ++;
}