]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/EdkFvbServiceLib/Fvb.c
Updated EFI_FVB_ATTRIBUTES to EFI_FVB_ATTRIBUTES_2.
[mirror_edk2.git] / MdeModulePkg / Library / EdkFvbServiceLib / Fvb.c
index 8c2a77e8d6495797c4380ca15cbecd9847cf08e2..733e77b0192c3aeb8a9b54f25527254b6c95dca0 100644 (file)
@@ -1,6 +1,7 @@
 /**@file\r
 \r
-  Firmware Volume Block Protocol Runtime Abstraction\r
+  Firmware Volume Block Protocol Runtime Interface Abstraction\r
+  And FVB Extension protocol Runtime Interface Abstraction\r
 \r
   mFvbEntry is an array of Handle Fvb pairs. The Fvb Lib Instance matches the\r
   index in the mFvbEntry array. This should be the same sequence as the FVB's\r
@@ -9,7 +10,7 @@
 \r
   If you are using any of these lib functions.you must first call FvbInitialize ().\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. 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
@@ -355,9 +356,12 @@ EfiFvbReadBlock (
   IN EFI_LBA                                      Lba,\r
   IN UINTN                                        Offset,\r
   IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
+  OUT UINT8                                       *Buffer\r
   )\r
 {\r
+  ASSERT (NumBytes != NULL);\r
+  ASSERT (Buffer != NULL);\r
+  \r
   if (Instance >= mFvbCount) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -394,6 +398,8 @@ EfiFvbWriteBlock (
   IN UINT8                                        *Buffer\r
   )\r
 {\r
+  ASSERT (NumBytes != NULL);\r
+  \r
   if (Instance >= mFvbCount) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -429,7 +435,7 @@ EfiFvbEraseBlock (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  return mFvbEntry[Instance].Fvb->EraseBlocks (mFvbEntry[Instance].Fvb, Lba, -1);\r
+  return mFvbEntry[Instance].Fvb->EraseBlocks (mFvbEntry[Instance].Fvb, Lba, 1, EFI_LBA_LIST_TERMINATOR);\r
 }\r
 \r
 /**\r
@@ -446,9 +452,11 @@ EfiFvbEraseBlock (
 EFI_STATUS\r
 EfiFvbGetVolumeAttributes (\r
   IN UINTN                                Instance,\r
-  OUT EFI_FVB_ATTRIBUTES                  *Attributes\r
+  OUT EFI_FVB_ATTRIBUTES_2                *Attributes\r
   )\r
 {\r
+  ASSERT (Attributes != NULL);\r
+  \r
   if (Instance >= mFvbCount) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -466,7 +474,7 @@ EfiFvbGetVolumeAttributes (
 \r
    @param Instance        The FV instance whose attributes is going to be\r
                           modified\r
-   @param Attributes      On input, it is a pointer to EFI_FVB_ATTRIBUTES\r
+   @param Attributes      On input, it is a pointer to EFI_FVB_ATTRIBUTES_2\r
                           containing the desired firmware volume settings.\r
                           On successful return, it contains the new settings\r
                           of the firmware volume\r
@@ -478,9 +486,11 @@ EfiFvbGetVolumeAttributes (
 EFI_STATUS\r
 EfiFvbSetVolumeAttributes (\r
   IN     UINTN                                Instance,\r
-  IN OUT EFI_FVB_ATTRIBUTES                   *Attributes\r
+  IN OUT EFI_FVB_ATTRIBUTES_2                 *Attributes\r
   )\r
 {\r
+  ASSERT (Attributes != NULL);\r
+  \r
   if (Instance >= mFvbCount) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -511,6 +521,8 @@ EfiFvbGetPhysicalAddress (
   OUT EFI_PHYSICAL_ADDRESS                *BaseAddress\r
   )\r
 {\r
+  ASSERT (BaseAddress != NULL);\r
+  \r
   if (Instance >= mFvbCount) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -547,6 +559,9 @@ EfiFvbGetBlockSize (
   OUT UINTN                                       *NumOfBlocks\r
   )\r
 {\r
+  ASSERT (BlockSize != NULL);\r
+  ASSERT (NumOfBlocks != NULL);\r
+  \r
   if (Instance >= mFvbCount) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r