]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c
code scrub on VariableRuntime Dxe driver
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / Reclaim.c
index ed68f12017f737270d28ee2949e14b4a075134b7..e3189c49604b9dd24aa825945f6f7ecaeb299c56 100644 (file)
@@ -16,8 +16,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 \r
 #include "Variable.h"\r
-#include <VariableFormat.h>\r
 \r
+/**\r
+  Gets firmware volume block handle by given address.\r
+\r
+  This function gets firmware volume block handle whose\r
+  address range contains the parameter Address.\r
+\r
+  @param  Address        Address which should be contained\r
+                         by returned FVB handle\r
+  @param  FvbHandle      Pointer to FVB handle for output\r
+\r
+  @retval EFI_SUCCESS    FVB handle successfully returned\r
+  @retval EFI_NOT_FOUND  Fail to find FVB handle by address\r
+\r
+**/\r
 EFI_STATUS\r
 GetFvbHandleByAddress (\r
   IN  EFI_PHYSICAL_ADDRESS   Address,\r
@@ -79,6 +92,23 @@ GetFvbHandleByAddress (
   return Status;\r
 }\r
 \r
+/**\r
+  Gets LBA of block and offset by given address.\r
+\r
+  This function gets the Logical Block Address (LBA) of firmware\r
+  volume block containing the given address, and the offset of\r
+  address on the block.\r
+\r
+  @param  Address        Address which should be contained\r
+                         by returned FVB handle\r
+  @param  Lba            Pointer to LBA for output\r
+  @param  Offset         Pointer to offset for output\r
+\r
+  @retval EFI_SUCCESS    LBA and offset successfully returned\r
+  @retval EFI_NOT_FOUND  Fail to find FVB handle by address\r
+  @retval EFI_ABORTED    Fail to find valid LBA and offset\r
+\r
+**/\r
 EFI_STATUS\r
 GetLbaAndOffsetByAddress (\r
   IN  EFI_PHYSICAL_ADDRESS   Address,\r
@@ -148,28 +178,28 @@ GetLbaAndOffsetByAddress (
   return EFI_ABORTED;\r
 }\r
 \r
+/**\r
+  Writes a buffer to variable storage space, in the working block.\r
+\r
+  This function writes a buffer to variable storage space into firmware\r
+  volume block device. The destination is specified by parameter\r
+  VariableBase. Fault Tolerant Write protocol is used for writing.\r
+\r
+  @param  VariableBase   Base address of variable to write\r
+  @param  Buffer         Point to the data buffer\r
+  @param  BufferSize     The number of bytes of the data Buffer\r
+\r
+  @retval EFI_SUCCESS    The function completed successfully\r
+  @retval EFI_NOT_FOUND  Fail to locate Fault Tolerant Write protocol\r
+  @retval EFI_ABORTED    The function could not complete successfully\r
+\r
+**/\r
 EFI_STATUS\r
 FtwVariableSpace (\r
   IN EFI_PHYSICAL_ADDRESS   VariableBase,\r
   IN UINT8                  *Buffer,\r
   IN UINTN                  BufferSize\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Write a buffer to Variable space, in the working block.\r
-\r
-Arguments:\r
-    FvbHandle        - Indicates a handle to FVB to access variable store\r
-    Buffer           - Point to the input buffer\r
-    BufferSize       - The number of bytes of the input Buffer\r
-\r
-Returns:\r
-    EFI_SUCCESS            - The function completed successfully\r
-    EFI_ABORTED            - The function could not complete successfully\r
-    EFI_NOT_FOUND          - Locate FVB protocol by handle fails\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   EFI_HANDLE            FvbHandle;\r
@@ -224,7 +254,7 @@ Returns:
                               FvbHandle,\r
                               VarLba,         // LBA\r
                               VarOffset,      // Offset\r
-                              &FtwBufferSize, // NumBytes,\r
+                              &FtwBufferSize, // NumBytes\r
                               FtwBuffer\r
                               );\r
 \r