]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/FwVol/Ffs.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / Ffs.c
index 7673352bbadb0643203415cee643bf16b93ff796..aec08b221b9b91af14800ff810dd28fae737e7d3 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   FFS file access utilities.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2008, 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
@@ -13,16 +13,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 \r
-#include <DxeMain.h>\r
-\r
-#define PHYSICAL_ADDRESS_TO_POINTER(Address) ((VOID *)((UINTN)(Address)))\r
+#include "DxeMain.h"\r
+#include "FwVolDriver.h"\r
 \r
 \r
 /**\r
   Get the FFS file state by checking the highest bit set in the header's state field.\r
 \r
-  @param  ErasePolarity  Erase polarity attribute of the firmware volume \r
-  @param  FfsHeader      Points to the FFS file header \r
+  @param  ErasePolarity  Erase polarity attribute of the firmware volume\r
+  @param  FfsHeader      Points to the FFS file header\r
 \r
   @return FFS File state\r
 \r
@@ -47,7 +46,7 @@ GetFileState (
     HighestBit >>= 1;\r
   }\r
 \r
-  return (EFI_FFS_FILE_STATE)HighestBit;\r
+  return (EFI_FFS_FILE_STATE) HighestBit;\r
 }\r
 \r
 \r
@@ -55,11 +54,11 @@ GetFileState (
 /**\r
   Check if a block of buffer is erased.\r
 \r
-  @param  ErasePolarity  Erase polarity attribute of the firmware volume \r
-  @param  InBuffer       The buffer to be checked \r
-  @param  BufferSize     Size of the buffer in bytes \r
+  @param  ErasePolarity  Erase polarity attribute of the firmware volume\r
+  @param  InBuffer       The buffer to be checked\r
+  @param  BufferSize     Size of the buffer in bytes\r
 \r
-  @retval TRUE           The block of buffer is erased \r
+  @retval TRUE           The block of buffer is erased\r
   @retval FALSE          The block of buffer is not erased\r
 \r
 **/\r
@@ -95,9 +94,9 @@ IsBufferErased (
 /**\r
   Verify checksum of the firmware volume header.\r
 \r
-  @param  FvHeader       Points to the firmware volume header to be checked \r
+  @param  FvHeader       Points to the firmware volume header to be checked\r
 \r
-  @retval TRUE           Checksum verification passed \r
+  @retval TRUE           Checksum verification passed\r
   @retval FALSE          Checksum verification failed\r
 \r
 **/\r
@@ -130,9 +129,9 @@ VerifyFvHeaderChecksum (
 /**\r
   Verify checksum of the FFS file header.\r
 \r
-  @param  FfsHeader      Points to the FFS file header to be checked \r
+  @param  FfsHeader      Points to the FFS file header to be checked\r
 \r
-  @retval TRUE           Checksum verification passed \r
+  @retval TRUE           Checksum verification passed\r
   @retval FALSE          Checksum verification failed\r
 \r
 **/\r
@@ -165,11 +164,11 @@ VerifyHeaderChecksum (
 /**\r
   Check if it's a valid FFS file header.\r
 \r
-  @param  ErasePolarity  Erase polarity attribute of the firmware volume \r
-  @param  FfsHeader      Points to the FFS file header to be checked \r
-  @param  FileState      FFS file state to be returned \r
+  @param  ErasePolarity  Erase polarity attribute of the firmware volume\r
+  @param  FfsHeader      Points to the FFS file header to be checked\r
+  @param  FileState      FFS file state to be returned\r
 \r
-  @retval TRUE           Valid FFS file header \r
+  @retval TRUE           Valid FFS file header\r
   @retval FALSE          Invalid FFS file header\r
 \r
 **/\r
@@ -183,32 +182,31 @@ IsValidFfsHeader (
   *FileState = GetFileState (ErasePolarity, FfsHeader);\r
 \r
   switch (*FileState) {\r
-    case EFI_FILE_HEADER_VALID:\r
-    case EFI_FILE_DATA_VALID:\r
-    case EFI_FILE_MARKED_FOR_UPDATE:\r
-    case EFI_FILE_DELETED:\r
-      //\r
-      // Here we need to verify header checksum\r
-      //\r
-      return VerifyHeaderChecksum (FfsHeader);\r
-    \r
-    case EFI_FILE_HEADER_CONSTRUCTION:\r
-    case EFI_FILE_HEADER_INVALID:\r
-    default:\r
-      return FALSE;\r
+  case EFI_FILE_HEADER_VALID:\r
+  case EFI_FILE_DATA_VALID:\r
+  case EFI_FILE_MARKED_FOR_UPDATE:\r
+  case EFI_FILE_DELETED:\r
+    //\r
+    // Here we need to verify header checksum\r
+    //\r
+    return VerifyHeaderChecksum (FfsHeader);\r
+\r
+  case EFI_FILE_HEADER_CONSTRUCTION:\r
+  case EFI_FILE_HEADER_INVALID:\r
+  default:\r
+    return FALSE;\r
   }\r
 }\r
 \r
 \r
-\r
 /**\r
   Check if it's a valid FFS file.\r
   Here we are sure that it has a valid FFS file header since we must call IsValidFfsHeader() first.\r
 \r
-  @param  ErasePolarity  Erase polarity attribute of the firmware volume \r
-  @param  FfsHeader      Points to the FFS file to be checked \r
+  @param  ErasePolarity  Erase polarity attribute of the firmware volume\r
+  @param  FfsHeader      Points to the FFS file to be checked\r
 \r
-  @retval TRUE           Valid FFS file \r
+  @retval TRUE           Valid FFS file\r
   @retval FALSE          Invalid FFS file\r
 \r
 **/\r
@@ -223,17 +221,17 @@ IsValidFfsFile (
   FileState = GetFileState (ErasePolarity, FfsHeader);\r
   switch (FileState) {\r
 \r
-    case EFI_FILE_DELETED:\r
-    case EFI_FILE_DATA_VALID:\r
-    case EFI_FILE_MARKED_FOR_UPDATE:\r
-      //\r
-      // Some other vliadation like file content checksum might be done here.\r
-      // For performance issue, Tiano only do FileState check.\r
-      //\r
-      return TRUE;\r
+  case EFI_FILE_DELETED:\r
+  case EFI_FILE_DATA_VALID:\r
+  case EFI_FILE_MARKED_FOR_UPDATE:\r
+    //\r
+    // Some other vliadation like file content checksum might be done here.\r
+    // For performance issue, Tiano only do FileState check.\r
+    //\r
+    return TRUE;\r
 \r
-    default:\r
-      return FALSE;\r
+  default:\r
+    return FALSE;\r
   }\r
 }\r
 \r