]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrVariable.c
correct some coding style issues.
[mirror_edk2.git] / IntelFrameworkPkg / Library / FrameworkIfrSupportLib / IfrVariable.c
index 5e927b4c31df167d30ae3742253230365f744e5b..533332b5a5ffb51c27a099bc527ef0acd4d54a3a 100644 (file)
@@ -17,23 +17,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 /**\r
   Extracts a variable form a Pack.\r
 \r
-  @param Pack - List of variables\r
-  @param Name - Name of the variable/map\r
-  @param Guid - GUID of the variable/map\r
-  @param Id   - The index of the variable/map to retrieve\r
-  @param Var  - Pointer to the variable/map\r
-  @param Size - Size of the variable/map in bytes\r
+  @param  Pack              List of variables\r
+  @param  Name              Name of the variable/map\r
+  @param  Guid              GUID of the variable/map\r
+  @param  Id                The index of the variable/map to retrieve\r
+  @param  Var               Pointer to the variable/map\r
+  @param  Size              Size of the variable/map in bytes\r
 **/\r
 VOID\r
 EfiLibHiiVariablePackGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK       *Pack,  \r
-  OUT   CHAR16                      **Name,  OPTIONAL\r
-  OUT   EFI_GUID                    **Guid,  OPTIONAL\r
-  OUT   UINT16                      *Id,     OPTIONAL\r
-  OUT   VOID                        **Var,   OPTIONAL\r
-  OUT   UINTN                       *Size    OPTIONAL\r
+  IN      EFI_HII_VARIABLE_PACK     *Pack,  \r
+     OUT  CHAR16                    **Name, OPTIONAL\r
+     OUT  EFI_GUID                  **Guid, OPTIONAL\r
+     OUT  UINT16                    *Id,    OPTIONAL\r
+     OUT  VOID                      **Var,  OPTIONAL\r
+     OUT  UINTN                     *Size   OPTIONAL\r
   )\r
-\r
 {\r
   if (NULL != Name) {\r
     *Name = (VOID *) (Pack + 1);\r
@@ -60,16 +59,18 @@ EfiLibHiiVariablePackGetMap (
 /**\r
   Finds a count of the variables/maps in the List.\r
 \r
-  @param List - List of variables\r
+  @param  List              List of variables\r
 \r
-  @return The number of map count.\r
+  @return                   The number of map count.\r
 **/\r
 UINTN\r
 EfiLibHiiVariablePackListGetMapCnt (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
+  IN  EFI_HII_VARIABLE_PACK_LIST    *List\r
   )\r
 {\r
-  UINTN   Cnt = 0;\r
+  UINTN                             Cnt;\r
+  \r
+  Cnt = 0;\r
   while (NULL != List) {\r
     Cnt++;\r
     List = List->NextVariablePack;\r
@@ -81,23 +82,20 @@ EfiLibHiiVariablePackListGetMapCnt (
   Will iterate all variable/maps as appearing \r
   in List and for each, it will call the Callback.\r
 \r
-  @param List     - List of variables\r
-  @param Callback - Routine to be called for each iterated variable.\r
-\r
+  @param  List              List of variables\r
+  @param  Callback          Routine to be called for each iterated variable.\r
 **/\r
 VOID\r
 EfiLibHiiVariablePackListForEachVar (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
-  IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
+  IN  EFI_HII_VARIABLE_PACK_LIST               *List,\r
+  IN  EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
   )\r
-\r
-\r
 {\r
-  CHAR16    *MapName;\r
-  EFI_GUID  *MapGuid;\r
-  UINT16    MapId;\r
-  VOID      *Map;\r
-  UINTN     MapSize;\r
+  CHAR16                            *MapName;\r
+  EFI_GUID                          *MapGuid;\r
+  UINT16                            MapId;\r
+  VOID                              *Map;\r
+  UINTN                             MapSize;\r
 \r
   while (NULL != List) {\r
     EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
@@ -113,35 +111,33 @@ EfiLibHiiVariablePackListForEachVar (
   Finds a variable form List given \r
   the order number as appears in the List.\r
 \r
-  @param Idx  - The index of the variable/map to retrieve\r
-  @param List - List of variables\r
-  @param Name - Name of the variable/map\r
-  @param Guid - GUID of the variable/map\r
-  @param Id   - Id of the variable/map\r
-  @param Var  - Pointer to the variable/map\r
-  @param Size - Size of the variable/map in bytes\r
+  @param  Idx            The index of the variable/map to retrieve\r
+  @param  List           List of variables\r
+  @param  Name           Name of the variable/map\r
+  @param  Guid           GUID of the variable/map\r
+  @param  Id             Id of the variable/map\r
+  @param  Var            Pointer to the variable/map\r
+  @param  Size           Size of the variable/map in bytes\r
 \r
-  @return EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  @return EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+  @return EFI_SUCCESS    Variable is found, OUT parameters are valid\r
+  @return EFI_NOT_FOUND  Variable is not found, OUT parameters are not valid\r
 **/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMapByIdx (\r
-  IN    UINTN                       Idx,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST  *List,  \r
-  OUT   CHAR16                      **Name,  OPTIONAL\r
-  OUT   EFI_GUID                    **Guid,  OPTIONAL\r
-  OUT   UINT16                      *Id,     OPTIONAL\r
-  OUT   VOID                        **Var,\r
-  OUT   UINTN                       *Size\r
+  IN      UINTN                      Idx,  \r
+  IN      EFI_HII_VARIABLE_PACK_LIST *List,  \r
+     OUT  CHAR16                     **Name, OPTIONAL\r
+     OUT  EFI_GUID                   **Guid, OPTIONAL\r
+     OUT  UINT16                     *Id,    OPTIONAL\r
+     OUT  VOID                       **Var,\r
+     OUT  UINTN                      *Size\r
   )\r
-\r
-\r
 {\r
-  CHAR16     *MapName;\r
-  EFI_GUID   *MapGuid;\r
-  UINT16     MapId;\r
-  VOID       *Map;\r
-  UINTN      MapSize;\r
+  CHAR16                            *MapName;\r
+  EFI_GUID                          *MapGuid;\r
+  UINT16                            MapId;\r
+  VOID                              *Map;\r
+  UINTN                             MapSize;\r
 \r
   while (NULL != List) {\r
     EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
@@ -175,32 +171,31 @@ EfiLibHiiVariablePackListGetMapByIdx (
   Finds a variable form List given the \r
   order number as appears in the List.\r
 \r
-  @param Id   - The ID of the variable/map to retrieve\r
-  @param List - List of variables\r
-  @param Name - Name of the variable/map\r
-  @param Guid - GUID of the variable/map\r
-  @param Var  - Pointer to the variable/map\r
-  @param Size - Size of the variable/map in bytes\r
-\r
-  @retval EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  @retval EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+  @param  Id             The ID of the variable/map to retrieve\r
+  @param  List           List of variables\r
+  @param  Name           Name of the variable/map\r
+  @param  Guid           GUID of the variable/map\r
+  @param  Var            Pointer to the variable/map\r
+  @param  Size           Size of the variable/map in bytes\r
 \r
+  @retval EFI_SUCCESS    Variable is found, OUT parameters are valid\r
+  @retval EFI_NOT_FOUND  Variable is not found, OUT parameters are not valid\r
 **/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMapById (\r
-  IN    UINT16                        Id,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST    *List,\r
-  OUT   CHAR16                        **Name,  OPTIONAL\r
-  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
-  OUT   VOID                          **Var,\r
-  OUT   UINTN                         *Size\r
+  IN      UINT16                     Id,  \r
+  IN      EFI_HII_VARIABLE_PACK_LIST *List,\r
+     OUT  CHAR16                     **Name, OPTIONAL\r
+     OUT  EFI_GUID                   **Guid, OPTIONAL\r
+     OUT  VOID                       **Var,\r
+     OUT  UINTN                      *Size\r
   )\r
 { \r
-  CHAR16    *MapName;\r
-  EFI_GUID  *MapGuid;\r
-  UINT16    MapId;\r
-  VOID      *Map;\r
-  UINTN     MapSize;\r
+  CHAR16                            *MapName;\r
+  EFI_GUID                          *MapGuid;\r
+  UINT16                            MapId;\r
+  VOID                              *Map;\r
+  UINTN                             MapSize;\r
 \r
   while (NULL != List) {\r
     EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
@@ -229,31 +224,31 @@ EfiLibHiiVariablePackListGetMapById (
 /**\r
   Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
 \r
-  @param List - List of variables\r
-  @param Name - Name of the variable/map to be found\r
-  @param Guid - GUID of the variable/map to be found\r
-  @param Id   - Id of the variable/map to be found\r
-  @param Var  - Pointer to the variable/map found\r
-  @param Size - Size of the variable/map in bytes found\r
+  @param  List           List of variables\r
+  @param  Name           Name of the variable/map to be found\r
+  @param  Guid           GUID of the variable/map to be found\r
+  @param  Id             Id of the variable/map to be found\r
+  @param  Var            Pointer to the variable/map found\r
+  @param  Size           Size of the variable/map in bytes found\r
 \r
-  @retval EFI_SUCCESS   - variable is found, OUT parameters are valid\r
-  @retval EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
+  @retval EFI_SUCCESS    variable is found, OUT parameters are valid\r
+  @retval EFI_NOT_FOUND  variable is not found, OUT parameters are not valid\r
 **/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
-  IN    CHAR16                       *Name,\r
-  IN    EFI_GUID                     *Guid,\r
-  OUT   UINT16                       *Id,\r
-  OUT   VOID                         **Var, \r
-  OUT   UINTN                        *Size\r
+  IN      EFI_HII_VARIABLE_PACK_LIST *List,\r
+  IN      CHAR16                     *Name,\r
+  IN      EFI_GUID                   *Guid,\r
+     OUT  UINT16                     *Id,\r
+     OUT  VOID                       **Var, \r
+     OUT  UINTN                      *Size\r
   )\r
 { \r
-  VOID      *Map;\r
-  UINTN     MapSize;\r
-  UINT16    MapId;\r
-  CHAR16    *MapName;\r
-  EFI_GUID  *MapGuid;\r
+  VOID                              *Map;\r
+  UINTN                             MapSize;\r
+  UINT16                            MapId;\r
+  CHAR16                            *MapName;\r
+  EFI_GUID                          *MapGuid;\r
 \r
   while (NULL != List) {\r
     EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
@@ -275,28 +270,27 @@ EfiLibHiiVariablePackListGetMap (
   Finds out if a variable of specific Name/Guid/Size exists in NV. \r
   If it does, it will retrieve it into the Var. \r
 \r
-  @param Name  Parameters of the variable to retrieve. Must match exactly.\r
-  @param Guid  Parameters of the variable to retrieve. Must match exactly.\r
-  @param Size  Parameters of the variable to retrieve. Must match exactly.\r
-  @param Var   Variable will be retrieved into buffer pointed by this pointer.\r
-               If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
-\r
-  @retval EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
-  @retval EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  @retval EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+  @param  Name            Parameters of the variable to retrieve. Must match exactly.\r
+  @param  Guid            Parameters of the variable to retrieve. Must match exactly.\r
+  @param  Size            Parameters of the variable to retrieve. Must match exactly.\r
+  @param  Var             Variable will be retrieved into buffer pointed by this pointer.\r
+                          If pointing to NULL, the buffer will be allocated. \r
+                          Caller is responsible for releasing the buffer.\r
 \r
+  @retval EFI_SUCCESS     The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
+  @retval EFI_NOT_FOUND   The variable of this Name/Guid was not found in the NV.\r
+  @retval EFI_LOAD_ERROR  The variable in the NV was of different size, or NV API returned error.\r
 **/\r
 EFI_STATUS\r
 EfiLibHiiVariableRetrieveFromNv (\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                  **Var\r
+  IN      CHAR16                    *Name,\r
+  IN      EFI_GUID                  *Guid,\r
+  IN      UINTN                     Size,\r
+     OUT  VOID                      **Var\r
   )\r
-\r
 {\r
-  EFI_STATUS                  Status;\r
-  UINTN                       SizeNv;\r
+  EFI_STATUS                        Status;\r
+  UINTN                             SizeNv;\r
 \r
   //\r
   // Test for existence of the variable.\r
@@ -338,27 +332,29 @@ EfiLibHiiVariableRetrieveFromNv (
   the Suffix matches the end of Name, so the variable will be loaded from NV\r
   provided the variable exists and the GUID and Size matches.\r
 \r
-  @param Suffix             Suffix the Name should end with.\r
-  @param Name, Guid, Size   Parameters of the variable to retrieve. Must match exactly.\r
-  @param Var                Variable will be retrieved into this buffer.\r
+  @param  Suffix            Suffix the Name should end with.\r
+  @param  Name              Name of the variable to retrieve.\r
+  @Param  Guid              Guid of the variable to retrieve.\r
+  @Param  Size              Parameters of the variable to retrieve.\r
+  @param  Var               Variable will be retrieved into this buffer.\r
                             Caller is responsible for providing storage of exactly Size size in bytes.\r
 \r
-  @retval EFI_SUCCESS           The variable was overriden with NV variable of same Name/Guid/Size.\r
-  @retval EFI_INVALID_PARAMETER The name of the variable does not end with <Suffix>.\r
-  @retval EFI_NOT_FOUND         The variable of this Name/Guid was not found in the NV.\r
-  @retval EFI_LOAD_ERROR        The variable in the NV was of different size, or NV API returned error.\r
+  @retval EFI_SUCCESS           The variable was overriden with NV variable of same Name/Guid/Size.\r
+  @retval EFI_INVALID_PARAMETER The name of the variable does not end with <Suffix>.\r
+  @retval EFI_NOT_FOUND         The variable of this Name/Guid was not found in the NV.\r
+  @retval EFI_LOAD_ERROR        The variable in the NV was of different size, or NV API returned error.\r
 **/\r
 EFI_STATUS\r
 EfiLibHiiVariableOverrideIfSuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
+  IN      CHAR16                    *Suffix,\r
+  IN      CHAR16                    *Name,\r
+  IN      EFI_GUID                  *Guid,\r
+  IN      UINTN                     Size,\r
+     OUT  VOID                      *Var\r
   )  \r
 {\r
-  UINTN         StrLength;\r
-  UINTN         StrLenSuffix;\r
+  UINTN                             StrLength;\r
+  UINTN                             StrLenSuffix;\r
 \r
   StrLength       = StrLen (Name);\r
   StrLenSuffix    = StrLen (Suffix);\r
@@ -378,30 +374,30 @@ EfiLibHiiVariableOverrideIfSuffix (
   the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
   will be loaded from NV provided the variable exists and the GUID and Size matches.\r
 \r
-  @param Suffix            Suffix the variable will be appended with.\r
-  @param Name, Guid, Size  Parameters of the variable to retrieve. Must match exactly.\r
-  @param Var               Variable will be retrieved into this buffer.\r
-                           Caller is responsible for providing storage of exactly Size size in bytes.\r
-\r
-  @retval EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  @retval EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  @retval EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+  @param  Suffix          Suffix the variable will be appended with.\r
+  @param  Name            Parameters of the Name variable to retrieve.\r
+  @param  Guid            Parameters of the Guid variable to retrieve.\r
+  @param  Size            Parameters of the Size variable to retrieve.\r
+  @param  Var             Variable will be retrieved into this buffer.\r
+                          Caller is responsible for providing storage of exactly Size size in bytes.\r
 \r
---*/\r
+  @retval EFI_SUCCESS     The variable was overriden with NV variable of same Name/Guid/Size.\r
+  @retval EFI_NOT_FOUND   The variable of this Name/Guid was not found in the NV.\r
+  @retval EFI_LOAD_ERROR  The variable in the NV was of different size, or NV API returned error.\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariableOverrideBySuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  ) \r
-\r
+  IN      CHAR16                    *Suffix,\r
+  IN      CHAR16                    *Name,\r
+  IN      EFI_GUID                  *Guid,\r
+  IN      UINTN                     Size,\r
+     OUT  VOID                      *Var\r
+  )\r
 {\r
-  EFI_STATUS    Status;\r
-  CHAR16       *NameSuffixed;\r
-  UINTN         NameLength;\r
-  UINTN         SuffixLength;\r
+  EFI_STATUS                        Status;\r
+  CHAR16                            *NameSuffixed;\r
+  UINTN                             NameLength;\r
+  UINTN                             SuffixLength;\r
 \r
   //\r
   // enough to concatenate both strings.\r