]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/FirmwareVolume/FaultTolerantWriteDxe/FtwWorkSpace.c
Clean up FaultTolerantWriteDxe for Doxygen comments requirement.
[mirror_edk2.git] / MdeModulePkg / Universal / FirmwareVolume / FaultTolerantWriteDxe / FtwWorkSpace.c
index d4dbf1ce8e5a3f7a27da5a9fa26b467aef2b7786..3da4d42cd338061d519bd33b5318b56a9f258a04 100644 (file)
@@ -16,23 +16,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <FtwLite.h>\r
 \r
-BOOLEAN\r
-IsValidWorkSpace (\r
-  IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r
-  )\r
-/*++\r
+/**\r
+  Check to see if it is a valid work space.\r
 \r
-Routine Description:\r
-    Check to see if it is a valid work space.\r
 \r
-Arguments:\r
-    WorkingHeader - Pointer of working block header \r
+  @param WorkingHeader   Pointer of working block header\r
 \r
-Returns:\r
-    EFI_SUCCESS   - The function completed successfully\r
-    EFI_ABORTED   - The function could not complete successfully.\r
+  @retval  EFI_SUCCESS    The function completed successfully\r
+  @retval  EFI_ABORTED    The function could not complete successfully.\r
 \r
---*/\r
+**/\r
+BOOLEAN\r
+IsValidWorkSpace (\r
+  IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r
+  )\r
 {\r
   EFI_STATUS                              Status;\r
   EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER WorkingBlockHeader;\r
@@ -85,23 +82,20 @@ Returns:
   return TRUE;\r
 }\r
 \r
-EFI_STATUS\r
-InitWorkSpaceHeader (\r
-  IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r
-  )\r
-/*++\r
+/**\r
+  Initialize a work space when there is no work space.\r
 \r
-Routine Description:\r
-    Initialize a work space when there is no work space.\r
 \r
-Arguments:\r
-    WorkingHeader - Pointer of working block header \r
+  @param WorkingHeader   Pointer of working block header\r
 \r
-Returns:\r
-    EFI_SUCCESS   - The function completed successfully\r
-    EFI_ABORTED   - The function could not complete successfully.\r
+  @retval  EFI_SUCCESS    The function completed successfully\r
+  @retval  EFI_ABORTED    The function could not complete successfully.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+InitWorkSpaceHeader (\r
+  IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -143,6 +137,24 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Update a bit of state on a block device. The location of the bit is\r
+  calculated by the (Lba, Offset, bit). Here bit is determined by the\r
+  the name of a certain bit.\r
+\r
+\r
+  @param FvBlock         FVB Protocol interface to access SrcBlock and DestBlock\r
+  @param Lba             Lba of a block\r
+  @param Offset          Offset on the Lba\r
+  @param NewBit          New value that will override the old value if it can be change\r
+\r
+  @retval  EFI_SUCCESS    A state bit has been updated successfully\r
+  @retval  Others         Access block device error.\r
+                          Notes:\r
+                          Assume all bits of State are inside the same BYTE.\r
+  @retval  EFI_ABORTED    Read block fail\r
+\r
+**/\r
 EFI_STATUS\r
 FtwUpdateFvState (\r
   IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *FvBlock,\r
@@ -150,28 +162,6 @@ FtwUpdateFvState (
   IN UINTN                               Offset,\r
   IN UINT8                               NewBit\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Update a bit of state on a block device. The location of the bit is \r
-    calculated by the (Lba, Offset, bit). Here bit is determined by the \r
-    the name of a certain bit.\r
-\r
-Arguments:\r
-    FvBlock    - FVB Protocol interface to access SrcBlock and DestBlock\r
-    Lba        - Lba of a block\r
-    Offset     - Offset on the Lba\r
-    NewBit     - New value that will override the old value if it can be change\r
-\r
-Returns:\r
-    EFI_SUCCESS   - A state bit has been updated successfully\r
-    Others        - Access block device error.\r
-\r
-Notes:\r
-    Assume all bits of State are inside the same BYTE. \r
-\r
-    EFI_ABORTED   - Read block fail\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINT8       State;\r
@@ -199,27 +189,24 @@ Notes:
   return Status;\r
 }\r
 \r
+/**\r
+  Get the last Write record pointer.\r
+  The last record is the record whose 'complete' state hasn't been set.\r
+  After all, this header may be a EMPTY header entry for next Allocate.\r
+\r
+\r
+  @param FtwLiteDevice   Private data of this driver\r
+  @param FtwLastRecord   Pointer to retrieve the last write record\r
+\r
+  @retval  EFI_SUCCESS      Get the last write record successfully\r
+  @retval  EFI_ABORTED      The FTW work space is damaged\r
+\r
+**/\r
 EFI_STATUS\r
 FtwGetLastRecord (\r
   IN  EFI_FTW_LITE_DEVICE  *FtwLiteDevice,\r
   OUT EFI_FTW_LITE_RECORD  **FtwLastRecord\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Get the last Write record pointer. \r
-    The last record is the record whose 'complete' state hasn't been set.\r
-    After all, this header may be a EMPTY header entry for next Allocate. \r
-\r
-Arguments:\r
-    FtwLiteDevice   - Private data of this driver\r
-    FtwLastRecord   - Pointer to retrieve the last write record\r
-\r
-Returns:\r
-    EFI_SUCCESS     - Get the last write record successfully\r
-    EFI_ABORTED     - The FTW work space is damaged\r
-\r
---*/\r
 {\r
   EFI_FTW_LITE_RECORD *Record;\r
 \r
@@ -241,23 +228,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-WorkSpaceRefresh (\r
-  IN EFI_FTW_LITE_DEVICE  *FtwLiteDevice\r
-  )\r
-/*++\r
+/**\r
+  Read from working block to refresh the work space in memory.\r
 \r
-Routine Description:\r
-    Read from working block to refresh the work space in memory.\r
 \r
-Arguments:\r
-    FtwLiteDevice     - Point to private data of FTW driver\r
+  @param FtwLiteDevice   Point to private data of FTW driver\r
 \r
-Returns:\r
-    EFI_SUCCESS   - The function completed successfully\r
-    EFI_ABORTED   - The function could not complete successfully.\r
+  @retval  EFI_SUCCESS    The function completed successfully\r
+  @retval  EFI_ABORTED    The function could not complete successfully.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+WorkSpaceRefresh (\r
+  IN EFI_FTW_LITE_DEVICE  *FtwLiteDevice\r
+  )\r
 {\r
   EFI_STATUS          Status;\r
   UINTN               Length;\r
@@ -313,29 +297,26 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Reclaim the work space. Get rid of all the completed write records\r
+  and write records in the Fault Tolerant work space.\r
+\r
+\r
+  @param FtwLiteDevice   Point to private data of FTW driver\r
+  @param FtwSpaceBuffer  Buffer to contain the reclaimed clean data\r
+  @param BufferSize      Size of the FtwSpaceBuffer\r
+\r
+  @retval  EFI_SUCCESS            The function completed successfully\r
+  @retval  EFI_BUFFER_TOO_SMALL   The FtwSpaceBuffer is too small\r
+  @retval  EFI_ABORTED            The function could not complete successfully.\r
+\r
+**/\r
 EFI_STATUS\r
 CleanupWorkSpace (\r
   IN EFI_FTW_LITE_DEVICE  *FtwLiteDevice,\r
   IN OUT UINT8            *FtwSpaceBuffer,\r
   IN UINTN                BufferSize\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Reclaim the work space. Get rid of all the completed write records\r
-    and write records in the Fault Tolerant work space.\r
-\r
-Arguments:\r
-    FtwLiteDevice   - Point to private data of FTW driver\r
-    FtwSpaceBuffer  - Buffer to contain the reclaimed clean data\r
-    BufferSize      - Size of the FtwSpaceBuffer\r
-\r
-Returns:\r
-    EFI_SUCCESS           - The function completed successfully\r
-    EFI_BUFFER_TOO_SMALL  - The FtwSpaceBuffer is too small\r
-    EFI_ABORTED           - The function could not complete successfully.\r
-\r
---*/\r
 {\r
   UINTN               Length;\r
   EFI_FTW_LITE_RECORD *Record;\r
@@ -376,24 +357,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-FtwReclaimWorkSpace (\r
-  IN EFI_FTW_LITE_DEVICE  *FtwLiteDevice\r
-  )\r
-/*++\r
+/**\r
+  Reclaim the work space on the working block.\r
 \r
-Routine Description:\r
-    Reclaim the work space on the working block.\r
 \r
-Arguments:\r
-    FtwLiteDevice     - Point to private data of FTW driver\r
+  @param FtwLiteDevice   Point to private data of FTW driver\r
 \r
-Returns:\r
-    EFI_SUCCESS           - The function completed successfully\r
-    EFI_OUT_OF_RESOURCES  - Allocate memory error\r
-    EFI_ABORTED           - The function could not complete successfully\r
+  @retval  EFI_SUCCESS            The function completed successfully\r
+  @retval  EFI_OUT_OF_RESOURCES   Allocate memory error\r
+  @retval  EFI_ABORTED            The function could not complete successfully\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+FtwReclaimWorkSpace (\r
+  IN EFI_FTW_LITE_DEVICE  *FtwLiteDevice\r
+  )\r
 {\r
   EFI_STATUS                              Status;\r
   UINT8                                   *TempBuffer;\r