Use right LBA to get the backed up WorkSpace in spare block.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14398 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Internal generic functions to operate flash block.
|
Internal generic functions to operate flash block.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -411,7 +411,7 @@ FlushSpareBlockToBootBlock (
|
|||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Write memory buffer currenet spare block. Still top block.
|
// Write memory buffer to current spare block. Still top block.
|
||||||
//
|
//
|
||||||
Ptr = Buffer;
|
Ptr = Buffer;
|
||||||
for (Index = 0; Index < FtwDevice->NumberOfSpareBlock; Index += 1) {
|
for (Index = 0; Index < FtwDevice->NumberOfSpareBlock; Index += 1) {
|
||||||
@ -1147,6 +1147,7 @@ InitFtwProtocol (
|
|||||||
EFI_FAULT_TOLERANT_WRITE_HEADER *FtwHeader;
|
EFI_FAULT_TOLERANT_WRITE_HEADER *FtwHeader;
|
||||||
UINTN Offset;
|
UINTN Offset;
|
||||||
EFI_HANDLE FvbHandle;
|
EFI_HANDLE FvbHandle;
|
||||||
|
EFI_LBA WorkSpaceLbaOffset;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the right SMM Fvb protocol instance for FTW.
|
// Find the right SMM Fvb protocol instance for FTW.
|
||||||
@ -1188,10 +1189,11 @@ InitFtwProtocol (
|
|||||||
//
|
//
|
||||||
// Read from spare block
|
// Read from spare block
|
||||||
//
|
//
|
||||||
|
WorkSpaceLbaOffset = FtwDevice->FtwWorkSpaceLba - FtwDevice->FtwWorkBlockLba;
|
||||||
Length = FtwDevice->FtwWorkSpaceSize;
|
Length = FtwDevice->FtwWorkSpaceSize;
|
||||||
Status = FtwDevice->FtwBackupFvb->Read (
|
Status = FtwDevice->FtwBackupFvb->Read (
|
||||||
FtwDevice->FtwBackupFvb,
|
FtwDevice->FtwBackupFvb,
|
||||||
FtwDevice->FtwSpareLba,
|
FtwDevice->FtwSpareLba + WorkSpaceLbaOffset,
|
||||||
FtwDevice->FtwWorkSpaceBase,
|
FtwDevice->FtwWorkSpaceBase,
|
||||||
&Length,
|
&Length,
|
||||||
FtwDevice->FtwWorkSpace
|
FtwDevice->FtwWorkSpace
|
||||||
|
Reference in New Issue
Block a user