]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/FwVol/FwVol.c
Code Scrub for Dxe Core.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / FwVol / FwVol.c
index f14cce05c7c820e1983c84df0409eda9fbe172fd..8c91641834078ff290c02e0a574901327deeb13e 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
   Firmware File System driver that produce Firmware Volume protocol.\r
-  Layers on top of Firmware Block protocol to produce a file abstraction \r
+  Layers on top of Firmware Block protocol to produce a file abstraction\r
   of FV based files.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
@@ -56,13 +56,13 @@ FV_DEVICE mFvDevice = {
   given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and\r
   copy the volume header into it.\r
 \r
-  @param  Fvb                   The FW_VOL_BLOCK_PROTOCOL instance from which to \r
-                                read the volume header \r
-  @param  FwVolHeader           Pointer to pointer to allocated buffer in which \r
-                                the volume header is returned. \r
+  @param  Fvb                   The FW_VOL_BLOCK_PROTOCOL instance from which to\r
+                                read the volume header\r
+  @param  FwVolHeader           Pointer to pointer to allocated buffer in which\r
+                                the volume header is returned.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  No enough buffer could be allocated. \r
-  @retval EFI_SUCCESS           Successfully read volume header to the allocated \r
+  @retval EFI_OUT_OF_RESOURCES  No enough buffer could be allocated.\r
+  @retval EFI_SUCCESS           Successfully read volume header to the allocated\r
                                 buffer.\r
 \r
 **/\r
@@ -109,7 +109,7 @@ GetFwVolHeader (
     //\r
     CoreFreePool (*FwVolHeader);\r
   }\r
\r
+\r
   return Status;\r
 }\r
 \r
@@ -118,7 +118,7 @@ GetFwVolHeader (
 /**\r
   Free FvDevice resource when error happens\r
 \r
-  @param  FvDevice              pointer to the FvDevice to be freed. \r
+  @param  FvDevice              pointer to the FvDevice to be freed.\r
 \r
 **/\r
 VOID\r
@@ -135,7 +135,7 @@ FreeFvDeviceResource (
   FfsFileEntry = (FFS_FILE_LIST_ENTRY *)FvDevice->FfsFileListHeader.ForwardLink;\r
   while (&FfsFileEntry->Link != &FvDevice->FfsFileListHeader) {\r
     NextEntry = (&FfsFileEntry->Link)->ForwardLink;\r
-    \r
+\r
     if (FfsFileEntry->StreamHandle != 0) {\r
       //\r
       // Close stream and free resources from SEP\r
@@ -167,10 +167,10 @@ FreeFvDeviceResource (
 /**\r
   Check if an FV is consistent and allocate cache for it.\r
 \r
-  @param  FvDevice              A pointer to the FvDevice to be checked. \r
+  @param  FvDevice              A pointer to the FvDevice to be checked.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  No enough buffer could be allocated. \r
-  @retval EFI_SUCCESS           FV is consistent and cache is allocated. \r
+  @retval EFI_OUT_OF_RESOURCES  No enough buffer could be allocated.\r
+  @retval EFI_SUCCESS           FV is consistent and cache is allocated.\r
   @retval EFI_VOLUME_CORRUPTED  File system is corrupted.\r
 \r
 **/\r
@@ -199,7 +199,7 @@ FvCheck (
 \r
   Fvb = FvDevice->Fvb;\r
   FwVolHeader = FvDevice->FwVolHeader;\r
\r
+\r
   Status = Fvb->GetAttributes (Fvb, &FvbAttributes);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -230,7 +230,7 @@ FvCheck (
   LbaIndex = 0;\r
   LbaOffset = FwVolHeader->HeaderLength;\r
   while ((BlockMap->NumBlocks != 0) || (BlockMap->Length != 0)) {\r
-    \r
+\r
     for (Index = 0; Index < BlockMap->NumBlocks; Index ++) {\r
 \r
       Size = BlockMap->Length;\r
@@ -252,7 +252,7 @@ FvCheck (
       if (EFI_ERROR (Status)) {\r
         goto Done;\r
       }\r
-      \r
+\r
       //\r
       // After we skip Fv Header always read from start of block\r
       //\r
@@ -271,7 +271,7 @@ FvCheck (
     FvDevice->ErasePolarity = 1;\r
   } else {\r
     FvDevice->ErasePolarity = 0;\r
-  } \r
+  }\r
 \r
 \r
   //\r
@@ -301,7 +301,7 @@ FvCheck (
     }\r
 \r
     if (!IsValidFfsHeader (FvDevice->ErasePolarity, FfsHeader, &FileState)) {\r
-      if ((FileState == EFI_FILE_HEADER_INVALID) || \r
+      if ((FileState == EFI_FILE_HEADER_INVALID) ||\r
           (FileState == EFI_FILE_HEADER_CONSTRUCTION)) {\r
         FfsHeader++;\r
         continue;\r
@@ -328,7 +328,7 @@ FvCheck (
     FileLength = *(UINT32 *)&FfsHeader->Size[0] & 0x00FFFFFF;\r
 \r
     FileState = GetFileState (FvDevice->ErasePolarity, FfsHeader);\r
-    \r
+\r
     //\r
     // check for non-deleted file\r
     //\r
@@ -341,18 +341,18 @@ FvCheck (
         Status = EFI_OUT_OF_RESOURCES;\r
         goto Done;\r
       }\r
-    \r
+\r
       FfsFileEntry->FfsHeader = FfsHeader;\r
       InsertTailList (&FvDevice->FfsFileListHeader, &FfsFileEntry->Link);\r
     }\r
 \r
     FfsHeader =  (EFI_FFS_FILE_HEADER *)(((UINT8 *)FfsHeader) + FileLength);\r
-    \r
+\r
     //\r
     // Adjust pointer to the next 8-byte aligned boundry.\r
     //\r
     FfsHeader = (EFI_FFS_FILE_HEADER *)(((UINTN)FfsHeader + 7) & ~0x07);\r
-    \r
+\r
   }\r
 \r
 Done:\r
@@ -371,7 +371,7 @@ Done:
   EFI_FIRMWARE_VOLUME2_PROTOCOL on the same handle.  This is the function where\r
   the actual initialization of the EFI_FIRMWARE_VOLUME2_PROTOCOL is done.\r
 \r
-  @param  Event                 The event that occured \r
+  @param  Event                 The event that occured\r
   @param  Context               For EFI compatiblity.  Not used.\r
 \r
 **/\r
@@ -415,13 +415,13 @@ NotifyFwVolBlock (
     if (EFI_ERROR (Status)) {\r
       continue;\r
     }\r
-    \r
+\r
     //\r
     // Get the FirmwareVolumeBlock protocol on that handle\r
     //\r
-    Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); \r
+    Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb);\r
     ASSERT_EFI_ERROR (Status);\r
-    \r
+\r
 \r
     //\r
     // Make sure the Fv Header is O.K.\r
@@ -469,12 +469,12 @@ NotifyFwVolBlock (
       if (FvDevice == NULL) {\r
         return;\r
       }\r
-      \r
+\r
       FvDevice->Fvb             = Fvb;\r
       FvDevice->Handle          = Handle;\r
       FvDevice->FwVolHeader     = FwVolHeader;\r
       FvDevice->Fv.ParentHandle = Fvb->ParentHandle;\r
-      \r
+\r
       //\r
       // Install an New FV protocol on the existing handle\r
       //\r
@@ -487,7 +487,7 @@ NotifyFwVolBlock (
       ASSERT_EFI_ERROR (Status);\r
     }\r
   }\r
-  \r
+\r
   return;\r
 }\r
 \r
@@ -498,8 +498,8 @@ NotifyFwVolBlock (
   libraries, and registers two notification functions.  These notification\r
   functions are responsible for building the FV stack dynamically.\r
 \r
-  @param  ImageHandle           The image handle. \r
-  @param  SystemTable           The system table. \r
+  @param  ImageHandle           The image handle.\r
+  @param  SystemTable           The system table.\r
 \r
   @retval EFI_SUCCESS           Function successfully returned.\r
 \r