]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrVariable.c
Fix typo in comment.
[mirror_edk2.git] / IntelFrameworkPkg / Library / FrameworkIfrSupportLib / IfrVariable.c
index c48c497bdd23533a8b8d91e56ce117397b6ac2b3..5974a2640f9b6987145d160c14d40a16b5eb3362 100644 (file)
@@ -1,5 +1,6 @@
 /** @file\r
-\r
+  Variable/Map manipulations routines\r
+  \r
 Copyright (c) 2006, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
@@ -9,12 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
-Module Name:\r
-  IfrVariable.c\r
-\r
-Abstract:\r
-  Variable/Map manipulations routines\r
-\r
 **/\r
 \r
 //\r
@@ -22,6 +17,16 @@ Abstract:
 //\r
 #include "IfrSupportLibInternal.h"\r
 \r
+/**\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
+**/\r
 VOID\r
 EfiLibHiiVariablePackGetMap (\r
   IN    EFI_HII_VARIABLE_PACK       *Pack,  \r
@@ -31,25 +36,7 @@ EfiLibHiiVariablePackGetMap (
   OUT   VOID                        **Var,   OPTIONAL\r
   OUT   UINTN                       *Size    OPTIONAL\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-\r
-  Extracts a variable form a Pack.\r
-\r
-Arguments:\r
-\r
-  Pack - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID\r
-  \r
---*/\r
 {\r
   if (NULL != Name) {\r
     *Name = (VOID *) (Pack + 1);\r
@@ -73,28 +60,17 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  Finds a count of the variables/maps in the List.\r
+\r
+  @param List - List of variables\r
 \r
+  @return The number of map count.\r
+**/\r
 UINTN\r
 EfiLibHiiVariablePackListGetMapCnt (\r
   IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
   )\r
-  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a count of the variables/maps in the List.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-\r
-Returns: \r
-\r
-  UINTN - The number of map count.\r
-\r
---*/\r
-\r
 {\r
   UINTN   Cnt = 0;\r
   while (NULL != List) {\r
@@ -104,29 +80,20 @@ Returns:
   return Cnt;\r
 }\r
 \r
+/**\r
+  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
+**/\r
 VOID\r
 EfiLibHiiVariablePackListForEachVar (\r
   IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
   IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
   )\r
-/*++\r
-\r
-Routine Description:\r
 \r
-  Will iterate all variable/maps as appearing \r
-  in List and for each, it will call the Callback.\r
-\r
-Arguments:\r
-\r
-  List     - List of variables\r
-  Callback - Routine to be called for each iterated variable.\r
-\r
-Returns: \r
-\r
-  VOID\r
-  \r
---*/\r
 \r
 {\r
   CHAR16    *MapName;\r
@@ -145,7 +112,21 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  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
 \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
@@ -157,28 +138,7 @@ EfiLibHiiVariablePackListGetMapByIdx (
   OUT   UINTN                       *Size\r
   )\r
 \r
-/*++\r
 \r
-Routine Description:\r
-\r
-  Finds a variable form List given \r
-  the order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Idx  - The index of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
 {\r
   CHAR16     *MapName;\r
   EFI_GUID   *MapGuid;\r
@@ -214,7 +174,21 @@ Returns:
   return EFI_NOT_FOUND; \r
 }\r
 \r
+/**\r
+  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
+\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariablePackListGetMapById (\r
   IN    UINT16                        Id,  \r
@@ -224,30 +198,6 @@ EfiLibHiiVariablePackListGetMapById (
   OUT   VOID                          **Var,\r
   OUT   UINTN                         *Size\r
   )\r
-  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form List given the \r
-  order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Id   - The ID of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-\r
 { \r
   CHAR16    *MapName;\r
   EFI_GUID  *MapGuid;\r
@@ -279,7 +229,19 @@ Returns:
   return EFI_NOT_FOUND; \r
 }\r
 \r
+/**\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
+\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
@@ -289,28 +251,6 @@ EfiLibHiiVariablePackListGetMap (
   OUT   VOID                         **Var, \r
   OUT   UINTN                        *Size\r
   )\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-  Name - Name of the variable/map to be found\r
-  Guid - GUID of the variable/map to be found\r
-  Var  - Pointer to the variable/map found\r
-  Size - Size of the variable/map in bytes found\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-\r
 { \r
   VOID      *Map;\r
   UINTN     MapSize;\r
@@ -334,6 +274,21 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+  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
+\r
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariableRetrieveFromNv (\r
   IN  CHAR16                 *Name,\r
@@ -341,22 +296,7 @@ EfiLibHiiVariableRetrieveFromNv (
   IN  UINTN                   Size,\r
   OUT VOID                  **Var\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  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
-Arguments:\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  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
-Returns:\r
-  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
 {\r
   EFI_STATUS                  Status;\r
   UINTN                       SizeNv;\r
@@ -394,8 +334,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Overrrides the variable with NV data if found.\r
+  But it only does it if the Name ends with specified Suffix.\r
+  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
+  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
+                            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
+**/\r
 EFI_STATUS\r
 EfiLibHiiVariableOverrideIfSuffix (\r
   IN  CHAR16                 *Suffix,\r
@@ -404,27 +359,6 @@ EfiLibHiiVariableOverrideIfSuffix (
   IN  UINTN                   Size,\r
   OUT VOID                   *Var\r
   )  \r
-/*++\r
-\r
-Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the Name ends with specified Suffix.\r
-  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
-  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
-Arguments:\r
-  Suffix           - Suffix the Name should end with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
-Returns:\r
-  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
-  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
 {\r
   UINTN         StrLength;\r
   UINTN         StrLenSuffix;\r
@@ -440,35 +374,32 @@ Returns:
   return EfiLibHiiVariableRetrieveFromNv (Name, Guid, Size, &Var);\r
 }\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
-\r
-Routine Description:\r
+/**\r
   Overrrides the variable with NV data if found.\r
   But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
   For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
   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
-Arguments:\r
-  Suffix           - Suffix the variable will be appended with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\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
-Returns:\r
-  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  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_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
 --*/\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
 {\r
   EFI_STATUS    Status;\r
   CHAR16       *NameSuffixed;\r