]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c
OvmfPkg PlatformFvbLib: Change PlatformFvbDataWritten
[mirror_edk2.git] / OvmfPkg / EmuVariableFvbRuntimeDxe / Fvb.c
index 48d0555abc968e0ae4e1c809432db76f079dfcdc..2076a8c6e9bb071e224da1494f359fc2f414eaf4 100644 (file)
@@ -2,8 +2,8 @@
   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 - 2009, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2006 - 2011, 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
   http://opensource.org/licenses/bsd-license.php\r
@@ -189,7 +189,7 @@ FvbProtocolGetBlockSize (
   FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
 \r
   *BlockSize = FvbDevice->BlockSize;\r
-  *NumberOfBlocks = 2 - Lba;\r
+  *NumberOfBlocks = (UINTN) (2 - (UINTN) Lba);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -364,7 +364,7 @@ FvbProtocolEraseBlocks (
   if ((Erase & BIT0) != 0) {\r
     EraseSize = EraseSize + FvbDevice->BlockSize;\r
   } else {\r
-    ErasePtr = ErasePtr + FvbDevice->BlockSize;\r
+    ErasePtr = (VOID*) ((UINT8*)ErasePtr + FvbDevice->BlockSize);\r
   }\r
 \r
   if ((Erase & BIT1) != 0) {\r
@@ -468,12 +468,12 @@ FvbProtocolWrite (
 \r
   FvbDataPtr =\r
     (UINT8*) FvbDevice->BufferPtr +\r
-    MultU64x32 (Lba, FvbDevice->BlockSize) +\r
+    MultU64x32 (Lba, (UINT32) FvbDevice->BlockSize) +\r
     Offset;\r
 \r
   if (*NumBytes > 0) {\r
     CopyMem (FvbDataPtr, Buffer, *NumBytes);\r
-    PlatformFvbDataWritten (This, Lba);\r
+    PlatformFvbDataWritten (This, Lba, Offset, *NumBytes, Buffer);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -552,7 +552,7 @@ FvbProtocolRead (
 \r
   FvbDataPtr =\r
     (UINT8*) FvbDevice->BufferPtr +\r
-    MultU64x32 (Lba, FvbDevice->BlockSize) +\r
+    MultU64x32 (Lba, (UINT32) FvbDevice->BlockSize) +\r
     Offset;\r
 \r
   if (*NumBytes > 0) {\r
@@ -769,8 +769,8 @@ FvbInitialize (
   // Verify that the PCD's are set correctly.\r
   //\r
   if (\r
-       (FixedPcdGet32 (PcdVariableStoreSize) +\r
-        FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize)\r
+       (PcdGet32 (PcdVariableStoreSize) +\r
+        PcdGet32 (PcdFlashNvStorageFtwWorkingSize)\r
        ) >\r
        EMU_FVB_BLOCK_SIZE\r
      ) {\r
@@ -820,7 +820,7 @@ FvbInitialize (
   //\r
   // Initialize the Fault Tolerant Write data area\r
   //\r
-  SubPtr = (VOID*) ((UINT8*) Ptr + FixedPcdGet32 (PcdVariableStoreSize));\r
+  SubPtr = (VOID*) ((UINT8*) Ptr + PcdGet32 (PcdVariableStoreSize));\r
   if (Initialize) {\r
     InitializeFtwState (SubPtr);\r
   }\r