These are the common Fault Tolerant Write (FTW) functions that are shared \r
by DXE FTW driver and SMM FTW driver.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
EFI_FAULT_TOLERANT_WRITE_HEADER *Header;\r
EFI_FAULT_TOLERANT_WRITE_RECORD *Record;\r
UINTN Offset;\r
+ EFI_LBA WorkSpaceLbaOffset;\r
\r
FtwDevice = FTW_CONTEXT_FROM_THIS (This);\r
\r
+ WorkSpaceLbaOffset = FtwDevice->FtwWorkSpaceLba - FtwDevice->FtwWorkBlockLba;\r
+\r
//\r
// Spare Complete but Destination not complete,\r
// Recover the target block with the spare block.\r
Offset = (UINT8 *) Record - FtwDevice->FtwWorkSpace;\r
Status = FtwUpdateFvState (\r
FtwDevice->FtwBackupFvb,\r
- FtwDevice->FtwWorkSpaceLba,\r
+ FtwDevice->FtwSpareLba + WorkSpaceLbaOffset,\r
FtwDevice->FtwWorkSpaceBase + Offset,\r
SPARE_COMPLETED\r
);\r