mirror of https://github.com/acidanthera/audk.git
Remove the FV header assumption in variable driver.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dong Guo <guo.dong@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com> Reviewed-by: Zeng Star <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16565 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1fcbeaeacd
commit
931aae946f
|
@ -3883,8 +3883,9 @@ GetFvbInfoByAddress (
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_PHYSICAL_ADDRESS FvbBaseAddress;
|
EFI_PHYSICAL_ADDRESS FvbBaseAddress;
|
||||||
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
|
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
|
||||||
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
|
|
||||||
EFI_FVB_ATTRIBUTES_2 Attributes;
|
EFI_FVB_ATTRIBUTES_2 Attributes;
|
||||||
|
UINTN BlockSize;
|
||||||
|
UINTN NumberOfBlocks;
|
||||||
|
|
||||||
HandleBuffer = NULL;
|
HandleBuffer = NULL;
|
||||||
//
|
//
|
||||||
|
@ -3922,8 +3923,15 @@ GetFvbInfoByAddress (
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) FvbBaseAddress);
|
//
|
||||||
if ((Address >= FvbBaseAddress) && (Address < (FvbBaseAddress + FwVolHeader->FvLength))) {
|
// Assume one FVB has one type of BlockSize.
|
||||||
|
//
|
||||||
|
Status = Fvb->GetBlockSize (Fvb, 0, &BlockSize, &NumberOfBlocks);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Address >= FvbBaseAddress) && (Address < (FvbBaseAddress + BlockSize * NumberOfBlocks))) {
|
||||||
if (FvbHandle != NULL) {
|
if (FvbHandle != NULL) {
|
||||||
*FvbHandle = HandleBuffer[Index];
|
*FvbHandle = HandleBuffer[Index];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue