X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FFaultTolerantWriteDxe%2FFaultTolerantWrite.c;h=2f110167d7cc19cc46f89447d757bea0a0f8c859;hb=7ea4cf3f595f35373ff57cff997cde0bcea6871f;hp=625737eac018affcae37b9f9e6843d9e93bfc1f7;hpb=8a2d49964e371b1715beb3225fde47edfcaa51ca;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c index 625737eac0..2f110167d7 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c @@ -3,7 +3,7 @@ These are the common Fault Tolerant Write (FTW) functions that are shared by DXE FTW driver and SMM FTW driver. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials 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 @@ -193,9 +193,12 @@ FtwWriteRecord ( EFI_FAULT_TOLERANT_WRITE_HEADER *Header; EFI_FAULT_TOLERANT_WRITE_RECORD *Record; UINTN Offset; + EFI_LBA WorkSpaceLbaOffset; FtwDevice = FTW_CONTEXT_FROM_THIS (This); + WorkSpaceLbaOffset = FtwDevice->FtwWorkSpaceLba - FtwDevice->FtwWorkBlockLba; + // // Spare Complete but Destination not complete, // Recover the target block with the spare block. @@ -215,7 +218,7 @@ FtwWriteRecord ( Offset = (UINT8 *) Record - FtwDevice->FtwWorkSpace; Status = FtwUpdateFvState ( FtwDevice->FtwBackupFvb, - FtwDevice->FtwWorkSpaceLba, + FtwDevice->FtwSpareLba + WorkSpaceLbaOffset, FtwDevice->FtwWorkSpaceBase + Offset, SPARE_COMPLETED );