]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/FwVol/FwVolAttrib.c
MdeModulePkg/Core/Dxe: rebase to ARRAY_SIZE()
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / FwVolAttrib.c
index 34067abc2f30cbfa826046c907c433447b0c4241..0a89e707613eee8caa488df75ccee7115d002830 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Implements get/set firmware volume attributes\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\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
 http://opensource.org/licenses/bsd-license.php\r
@@ -12,15 +12,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <DxeMain.h>\r
+#include "DxeMain.h"\r
+#include "FwVolDriver.h"\r
 \r
 \r
 /**\r
   Retrieves attributes, insures positive polarity of attribute bits, returns\r
   resulting attributes in output parameter.\r
 \r
-  @param  This             Calling context \r
-  @param  Attributes       output buffer which contains attributes \r
+  @param  This             Calling context\r
+  @param  Attributes       output buffer which contains attributes\r
 \r
   @retval EFI_SUCCESS      Successfully got volume attributes\r
 \r
@@ -35,30 +36,23 @@ FvGetVolumeAttributes (
   EFI_STATUS                                Status;\r
   FV_DEVICE                                 *FvDevice;\r
   EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL        *Fvb;\r
-  EFI_FVB_ATTRIBUTES                        FvbAttributes;\r
+  EFI_FVB_ATTRIBUTES_2                      FvbAttributes;\r
 \r
   FvDevice = FV_DEVICE_FROM_THIS (This);\r
   Fvb = FvDevice->Fvb;\r
 \r
-  if (FvDevice->CachedFv == NULL) {\r
-    Status = FvCheck (FvDevice);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
   //\r
   // First get the Firmware Volume Block Attributes\r
   //\r
   Status = Fvb->GetAttributes (Fvb, &FvbAttributes);\r
 \r
   //\r
-  // Mask out Fvb bits that are not defined in FV \r
+  // Mask out Fvb bits that are not defined in FV\r
   //\r
   FvbAttributes &= 0xfffff0ff;\r
-  \r
-  *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes; \r
-  \r
+\r
+  *Attributes = (EFI_FV_ATTRIBUTES)FvbAttributes;\r
+\r
   return Status;\r
 }\r
 \r
@@ -67,9 +61,9 @@ FvGetVolumeAttributes (
 /**\r
   Sets current attributes for volume\r
 \r
-  @param  This             Calling context \r
-  @param  Attributes       At input, contains attributes to be set.  At output \r
-                           contains new value of FV \r
+  @param  This             Calling context\r
+  @param  Attributes       At input, contains attributes to be set.  At output\r
+                           contains new value of FV\r
 \r
   @retval EFI_UNSUPPORTED  Could not be set.\r
 \r
@@ -89,11 +83,11 @@ FvSetVolumeAttributes (
   Return information of type InformationType for the requested firmware\r
   volume.\r
 \r
-  @param  This             Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL. \r
-  @param  InformationType  InformationType for requested. \r
-  @param  BufferSize       On input, size of Buffer.On output, the amount of data \r
-                           returned in Buffer. \r
-  @param  Buffer           A poniter to the data buffer to return. \r
+  @param  This             Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r
+  @param  InformationType  InformationType for requested.\r
+  @param  BufferSize       On input, size of Buffer.On output, the amount of data\r
+                           returned in Buffer.\r
+  @param  Buffer           A poniter to the data buffer to return.\r
 \r
   @retval EFI_SUCCESS      Successfully got volume Information.\r
 \r
@@ -116,11 +110,11 @@ FvGetVolumeInfo (
   Set information of type InformationType for the requested firmware\r
   volume.\r
 \r
-  @param  This             Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL. \r
-  @param  InformationType  InformationType for requested. \r
-  @param  BufferSize       On input, size of Buffer.On output, the amount of data \r
-                           returned in Buffer. \r
-  @param  Buffer           A poniter to the data buffer to return. \r
+  @param  This             Pointer to EFI_FIRMWARE_VOLUME2_PROTOCOL.\r
+  @param  InformationType  InformationType for requested.\r
+  @param  BufferSize       On input, size of Buffer.On output, the amount of data\r
+                           returned in Buffer.\r
+  @param  Buffer           A poniter to the data buffer to return.\r
 \r
   @retval EFI_SUCCESS      Successfully set volume Information.\r
 \r