]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
OvmfPkg EmuVariableFvbRuntimeDxe: Let FaultTolerantWriteDxe to init working block...
[mirror_edk2.git] / OvmfPkg / EmuVariableFvbRuntimeDxe / Fvb.c
index 72efba091045acb7791586ff9ba1e8a46087ce25..c7c3fcb36ffef910042bcef71857454a3e03e2bc 100644 (file)
@@ -2,7 +2,7 @@
   Firmware Block Services to support emulating non-volatile variables\r
   by pretending that a memory buffer is storage for the NV variables.\r
 \r
-  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, 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
@@ -781,52 +781,6 @@ InitializeFvAndVariableStoreHeaders (
   Fv->Checksum = CalculateCheckSum16 (Ptr, Fv->HeaderLength);\r
 }\r
 \r
-\r
-/**\r
-  Initializes the Fault Tolerant Write data structure\r
-\r
-  This data structure is used by the Fault Tolerant Write driver.\r
-\r
-  @param[in]  Buffer - Location for the FTW data structure\r
-\r
-**/\r
-VOID\r
-InitializeFtwState (\r
-  IN  VOID   *Buffer\r
-  )\r
-{\r
-  EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *Hdr;\r
-  UINT32                                  TempCrc;\r
-  STATIC EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER DefaultFtw = {\r
-    EFI_SYSTEM_NV_DATA_FV_GUID, // EFI_GUID  Signature;\r
-    ERASED_UINT32,              // UINT32    Crc;\r
-    ERASED_BIT,                 // UINT8     WorkingBlockValid : 1;\r
-    ERASED_BIT,                 // UINT8     WorkingBlockInvalid : 1;\r
-    0,                          // UINT8     Reserved : 6;\r
-    { 0, 0, 0 },                // UINT8     Reserved3[3];\r
-    FTW_WRITE_QUEUE_SIZE        // UINT64    WriteQueueSize;\r
-  };\r
-\r
-  CopyMem (Buffer, (VOID*) &DefaultFtw, sizeof (DefaultFtw));\r
-\r
-  Hdr = (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER*) Buffer;\r
-\r
-  //\r
-  // Calculate checksum.\r
-  //\r
-  // The Crc, WorkingBlockValid and WorkingBlockInvalid bits should\r
-  // be set to the erased state before computing the checksum.\r
-  //\r
-  gBS->CalculateCrc32 (Buffer, sizeof (DefaultFtw), &TempCrc);\r
-  Hdr->Crc = TempCrc;\r
-\r
-  //\r
-  // Mark as valid.\r
-  //\r
-  Hdr->WorkingBlockValid = NOT_ERASED_BIT;\r
-}\r
-\r
-\r
 /**\r
   Main entry point.\r
 \r
@@ -908,9 +862,6 @@ FvbInitialize (
   // Initialize the Fault Tolerant Write data area\r
   //\r
   SubPtr = (VOID*) ((UINT8*) Ptr + PcdGet32 (PcdVariableStoreSize));\r
-  if (Initialize) {\r
-    InitializeFtwState (SubPtr);\r
-  }\r
   PcdSet32 (PcdFlashNvStorageFtwWorkingBase, (UINT32)(UINTN) SubPtr);\r
 \r
   //\r