]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Correct comments to match function declaration.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 15 Jan 2010 07:12:08 +0000 (07:12 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 15 Jan 2010 07:12:08 +0000 (07:12 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9773 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Library/HiiLib.h
MdeModulePkg/Library/UefiHiiLib/HiiLib.c

index e39ed8e26044198604d2fde635f1f8fdaf10c5d0..f63f313927b4fa8f860abc17e106729050066ad9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Public include file for the HII Library\r
 \r
-  Copyright (c) 2007 - 2009, Intel Corporation                                                         \r
+  Copyright (c) 2007 - 2010, 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
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -354,12 +354,12 @@ HiiIsConfigHdrMatch (
   Retrieves uncommitted data from the Form Browser and converts it to a binary\r
   buffer.\r
 \r
-  @param[in]  VariableName  Pointer to a Null-terminated Unicode string.  This \r
-                            is an optional parameter that may be NULL.\r
   @param[in]  VariableGuid  Pointer to an EFI_GUID structure.  This is an optional \r
                             parameter that may be NULL.\r
-  @param[in]  BufferSize    Length in bytes of buffer to hold retrived data. \r
-  @param[out] Block         Buffer of data to be updated.\r
+  @param[in]  VariableName  Pointer to a Null-terminated Unicode string.  This \r
+                            is an optional parameter that may be NULL.\r
+  @param[in]  BufferSize    Length in bytes of buffer to hold retrieved data. \r
+  @param[out] Buffer        Buffer of data to be updated.\r
 \r
   @retval FALSE  The uncommitted data could not be retrieved.\r
   @retval TRUE   The uncommitted data was retrieved.\r
@@ -370,8 +370,8 @@ EFIAPI
 HiiGetBrowserData (\r
   IN CONST EFI_GUID  *VariableGuid,  OPTIONAL\r
   IN CONST CHAR16    *VariableName,  OPTIONAL\r
-  IN UINTN           BlockSize,\r
-  OUT UINT8          *Block\r
+  IN UINTN           BufferSize,\r
+  OUT UINT8          *Buffer\r
   );\r
 \r
 /**\r
@@ -379,10 +379,10 @@ HiiGetBrowserData (
 \r
   If Buffer is NULL, then ASSERT().\r
 \r
-  @param[in]  VariableName    Pointer to a Null-terminated Unicode string.  This\r
-                              is an optional parameter that may be NULL.\r
   @param[in]  VariableGuid    Pointer to an EFI_GUID structure.  This is an optional\r
                               parameter that may be NULL.\r
+  @param[in]  VariableName    Pointer to a Null-terminated Unicode string.  This\r
+                              is an optional parameter that may be NULL.\r
   @param[in]  BufferSize      Length, in bytes, of Buffer.\r
   @param[in]  Buffer          Buffer of data to commit.\r
   @param[in]  RequestElement  An optional field to specify which part of the\r
@@ -428,7 +428,7 @@ HiiSetBrowserData (
   (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))\r
 \r
 /**\r
-  Returns a UINT64 value that contains bitfields for Year, Month, and Day.\r
+  Returns a UINT64 value that contains bit fields for Year, Month, and Day.\r
   The lower 16-bits of Year are placed in bits 0..15.  The lower 8-bits of Month \r
   are placed in bits 16..23, and the lower 8-bits of Day are placed in bits \r
   24..31.  This format is selected because it can be easily translated to \r
@@ -458,12 +458,14 @@ HiiAllocateOpCodeHandle (
   );\r
 \r
 /**\r
-  Frees an OpCode Handle that was peviously allocated with HiiAllocateOpCodeHandle().\r
+  Frees an OpCode Handle that was previously allocated with HiiAllocateOpCodeHandle().\r
   When an OpCode Handle is freed, all of the opcodes associated with the OpCode\r
   Handle are also freed.\r
 \r
   If OpCodeHandle is NULL, then ASSERT().\r
 \r
+  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.\r
+\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -632,7 +634,7 @@ HiiCreateActionOpCode (
   @param[in]  Prompt      String ID for Prompt\r
   @param[in]  Help        String ID for Help\r
   @param[in]  Flags       Subtitle opcode flags\r
-  @param[in]  Scope       1 if this opcpde is the beginning of a new scope.\r
+  @param[in]  Scope       1 if this opcode is the beginning of a new scope.\r
                           0 if this opcode is within the current scope.\r
 \r
   @retval NULL   There is not enough space left in Buffer to add the opcode.\r
@@ -882,22 +884,22 @@ HiiCreateOrderedListOpCode (
   The form to update is specified by Handle, FormSetGuid, and FormId.  Binary \r
   comparisons of IFR opcodes are performed from the beginning of the form being \r
   updated until an IFR opcode is found that exactly matches the first IFR opcode \r
-  specifed by StartOpCodeHandle.  The following rules are used to determine if\r
+  specified by StartOpCodeHandle.  The following rules are used to determine if\r
   an insert, replace, or delete operation is performed:\r
   \r
   1) If no matches are found, then NULL is returned.  \r
   2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
-     from StartOpcodeHandle except the first opcode are inserted immediately after \r
-     the matching IFR opcode in the form beng updated.\r
+     from StartOpCodeHandle except the first opcode are inserted immediately after \r
+     the matching IFR opcode in the form to be updated.\r
   3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made \r
      from the matching IFR opcode until an IFR opcode exactly matches the first \r
      IFR opcode specified by EndOpCodeHandle.  If no match is found for the first\r
      IFR opcode specified by EndOpCodeHandle, then NULL is returned.  If a match\r
      is found, then all of the IFR opcodes between the start match and the end \r
      match are deleted from the form being updated and all of the IFR opcodes\r
-     from StartOpcodeHandle except the first opcode are inserted immediately after \r
+     from StartOpCodeHandle except the first opcode are inserted immediately after \r
      the matching start IFR opcode.  If StartOpCcodeHandle only contains one\r
-     IFR instruction, then the result of ths operation will delete all of the IFR\r
+     IFR instruction, then the result of this operation will delete all of the IFR\r
      opcodes between the start end matches.\r
 \r
   If HiiHandle is NULL, then ASSERT().\r
@@ -938,8 +940,8 @@ HiiUpdateForm (
   IN EFI_HII_HANDLE  HiiHandle,\r
   IN EFI_GUID        *FormSetGuid,        OPTIONAL\r
   IN EFI_FORM_ID     FormId,\r
-  IN VOID            *StartOpcodeHandle,\r
-  IN VOID            *EndOpcodeHandle     OPTIONAL\r
+  IN VOID            *StartOpCodeHandle,\r
+  IN VOID            *EndOpCodeHandle     OPTIONAL\r
   );\r
 \r
 #endif\r
index 56bf55bcaa77b158c492d7cc1a9ce94f68ea7a4a..3d7a4e5f5f2d1acf519481e5954e18422790d521 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HII Library implementation that uses DXE protocols and services.\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2010, Intel Corporation<BR>\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
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -376,9 +376,9 @@ HiiGetHiiHandles (
   Converts all hex dtring characters in range ['A'..'F'] to ['a'..'f'] for \r
   hex digits that appear between a '=' and a '&' in a config string.\r
 \r
-  If String is NULL, then ASSERT().\r
+  If ConfigString is NULL, then ASSERT().\r
 \r
-  @param[in] String  Pointer to a Null-terminated Unicode string.\r
+  @param[in] ConfigString  Pointer to a Null-terminated Unicode string.\r
 \r
   @return  Pointer to the Null-terminated Unicode result string.\r
 \r
@@ -463,10 +463,10 @@ InternalHiiBlockToConfig (
   allocated using AllocatePool().  The caller is then responsible for freeing \r
   the buffer using FreePool().\r
 \r
-  @param[in]  VariableName    Pointer to a Null-terminated Unicode string.  This \r
-                              is an optional parameter that may be NULL.\r
   @param[in]  VariableGuid    Pointer to an EFI_GUID structure.  This is an optional \r
                               parameter that may be NULL.\r
+  @param[in]  VariableName    Pointer to a Null-terminated Unicode string.  This \r
+                              is an optional parameter that may be NULL.\r
   @param[in]  SetResultsData  If not NULL, then this parameter specified the buffer\r
                               of uncommited data to set.  If this parameter is NULL,\r
                               then the caller is requesting to get the uncommited data\r
@@ -976,7 +976,7 @@ InternalHiiValidateCurrentSetting (
   StringPtr = StrStr (ConfigResp, L"&OFFSET");\r
   if (StringPtr == NULL) {\r
     //\r
-    // No ConfigBlock value is requied to be validated.\r
+    // No ConfigBlock value is required to be validated.\r
     // EFI_SUCCESS directly return.\r
     //\r
     return EFI_SUCCESS;\r
@@ -1179,7 +1179,7 @@ InternalHiiValidateCurrentSetting (
   }\r
 \r
   //\r
-  // 2. Check IFR value is in block data, then Validate Vaule\r
+  // 2. Check IFR value is in block data, then Validate Value\r
   //\r
   ZeroMem (&VarBlockData, sizeof (VarBlockData));\r
   VarValue      = 0;\r
@@ -1857,7 +1857,7 @@ InternalHiiIfrValueAction (
     \r
     //\r
     // 3. Call ConfigRouting GetAltCfg(ConfigRoute, <ConfigResponse>, Guid, Name, DevicePath, AltCfgId, AltCfgResp)\r
-    //    Get the default configuration string according to the found defaultname string ID.\r
+    //    Get the default configuration string according to the found default name string ID.\r
     //\r
     Status = gHiiConfigRouting->GetAltConfig (\r
                                   gHiiConfigRouting,\r
@@ -2087,7 +2087,7 @@ HiiSetToDefaults (
   @param StartSearchString  Pointer to the Null-terminated Unicode string that \r
                             marks the start of the value string to compare.\r
   @param StopSearchString   Pointer to the Null-terminated Unicode string that \r
-                            marks the end of the vakue string to compare.\r
+                            marks the end of the value string to compare.\r
 \r
   @retval FALSE             StartSearchString is not present in FirstString. \r
   @retval FALSE             StartSearchString is not present in SecondString.\r
@@ -2203,15 +2203,15 @@ HiiIsConfigHdrMatch (
 }\r
 \r
 /**\r
-  Retrieves uncommited data from the Form Browser and converts it to a binary\r
+  Retrieves uncommitted data from the Form Browser and converts it to a binary\r
   buffer.\r
 \r
-  @param[in]  VariableName  Pointer to a Null-terminated Unicode string.  This \r
-                            is an optional parameter that may be NULL.\r
   @param[in]  VariableGuid  Pointer to an EFI_GUID structure.  This is an optional \r
                             parameter that may be NULL.\r
-  @param[in]  BufferSize    Length in bytes of buffer to hold retrived data. \r
-  @param[out] Block         Buffer of data to be updated.\r
+  @param[in]  VariableName  Pointer to a Null-terminated Unicode string.  This \r
+                            is an optional parameter that may be NULL.\r
+  @param[in]  BufferSize    Length in bytes of buffer to hold retrieved data. \r
+  @param[out] Buffer        Buffer of data to be updated.\r
 \r
   @retval FALSE  The uncommitted data could not be retrieved.\r
   @retval TRUE   The uncommitted data was retrieved.\r
@@ -2222,8 +2222,8 @@ EFIAPI
 HiiGetBrowserData (\r
   IN CONST EFI_GUID  *VariableGuid,  OPTIONAL\r
   IN CONST CHAR16    *VariableName,  OPTIONAL\r
-  IN UINTN           BlockSize,\r
-  OUT UINT8          *Block\r
+  IN UINTN           BufferSize,\r
+  OUT UINT8          *Buffer\r
   )\r
 {\r
   EFI_STRING  ResultsData;\r
@@ -2262,8 +2262,8 @@ HiiGetBrowserData (
   Status = gHiiConfigRouting->ConfigToBlock (\r
                                 gHiiConfigRouting,\r
                                 ConfigResp,\r
-                                Block,\r
-                                &BlockSize,\r
+                                Buffer,\r
+                                &BufferSize,\r
                                 &Progress\r
                                 );\r
   //\r
@@ -2283,10 +2283,10 @@ HiiGetBrowserData (
 \r
   If Buffer is NULL, then ASSERT().\r
 \r
-  @param[in]  VariableName    Pointer to a Null-terminated Unicode string.  This\r
-                              is an optional parameter that may be NULL.\r
   @param[in]  VariableGuid    Pointer to an EFI_GUID structure.  This is an optional\r
                               parameter that may be NULL.\r
+  @param[in]  VariableName    Pointer to a Null-terminated Unicode string.  This\r
+                              is an optional parameter that may be NULL.\r
   @param[in]  BufferSize      Length, in bytes, of Buffer.\r
   @param[in]  Buffer          Buffer of data to commit.\r
   @param[in]  RequestElement  An optional field to specify which part of the\r
@@ -2418,12 +2418,14 @@ HiiAllocateOpCodeHandle (
 }\r
 \r
 /**\r
-  Frees an OpCode Handle that was peviously allocated with HiiAllocateOpCodeHandle().\r
+  Frees an OpCode Handle that was previously allocated with HiiAllocateOpCodeHandle().\r
   When an OpCode Handle is freed, all of the opcodes associated with the OpCode\r
   Handle are also freed.\r
 \r
   If OpCodeHandle is NULL, then ASSERT().\r
 \r
+  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.\r
+\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -2442,6 +2444,13 @@ HiiFreeOpCodeHandle (
   FreePool (OpCodeBuffer);\r
 }\r
 \r
+/**\r
+  Internal function gets the current position of opcode buffer.\r
+  \r
+  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.\r
+\r
+  @return Current position of opcode buffer.\r
+**/\r
 UINTN\r
 EFIAPI\r
 InternalHiiOpCodeHandlePosition (\r
@@ -2451,6 +2460,13 @@ InternalHiiOpCodeHandlePosition (
   return ((HII_LIB_OPCODE_BUFFER  *)OpCodeHandle)->Position;\r
 }\r
 \r
+/**\r
+  Internal function gets the start pointer of opcode buffer.\r
+  \r
+  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.\r
+\r
+  @return Pointer to the opcode buffer base.\r
+**/\r
 UINT8 *\r
 EFIAPI\r
 InternalHiiOpCodeHandleBuffer (\r
@@ -2460,11 +2476,20 @@ InternalHiiOpCodeHandleBuffer (
   return ((HII_LIB_OPCODE_BUFFER  *)OpCodeHandle)->Buffer;\r
 }\r
 \r
+/**\r
+  Internal function reserves the enough buffer for current opcode.\r
+  When the buffer is not enough, Opcode buffer will be extended.\r
+  \r
+  @param[in]  OpCodeHandle   Handle to the buffer of opcodes.\r
+  @param[in]  Size           Size of current opcode.\r
+\r
+  @return Pointer to the current opcode.\r
+**/\r
 UINT8 *\r
 EFIAPI\r
 InternalHiiGrowOpCodeHandle (\r
-  VOID   *OpCodeHandle,\r
-  UINTN  Size\r
+  IN VOID   *OpCodeHandle,\r
+  IN UINTN  Size\r
   )\r
 {\r
   HII_LIB_OPCODE_BUFFER  *OpCodeBuffer;\r
@@ -2490,6 +2515,18 @@ InternalHiiGrowOpCodeHandle (
   return Buffer;\r
 }\r
 \r
+/**\r
+  Internal function creates opcode based on the template opcode.\r
+  \r
+  @param[in]  OpCodeHandle    Handle to the buffer of opcodes.\r
+  @param[in]  OpCodeTemplate  Pointer to the template buffer of opcode.\r
+  @param[in]  OpCode          OpCode IFR value.\r
+  @param[in]  OpCodeSize      Size of opcode.\r
+  @param[in]  ExtensionSize   Size of extended opcode.\r
+  @param[in]  Scope           Scope bit of opcode.\r
+\r
+  @return Pointer to the current opcode with opcode data.\r
+**/\r
 UINT8 *\r
 EFIAPI\r
 InternalHiiCreateOpCodeExtended (\r
@@ -2515,6 +2552,16 @@ InternalHiiCreateOpCodeExtended (
   return (UINT8 *)CopyMem (Buffer, Header, OpCodeSize);\r
 }\r
 \r
+/**\r
+  Internal function creates opcode based on the template opcode for the normal opcode.\r
+  \r
+  @param[in]  OpCodeHandle    Handle to the buffer of opcodes.\r
+  @param[in]  OpCodeTemplate  Pointer to the template buffer of opcode.\r
+  @param[in]  OpCode          OpCode IFR value.\r
+  @param[in]  OpCodeSize      Size of opcode.\r
+\r
+  @return Pointer to the current opcode with opcode data.\r
+**/\r
 UINT8 *\r
 EFIAPI\r
 InternalHiiCreateOpCode (\r
@@ -3226,13 +3273,17 @@ HiiCreateOrderedListOpCode (
   This is the internal worker function to update the data in\r
   a form specified by FormSetGuid, FormId and Label.\r
 \r
-  @param FormSetGuid     The optional Formset GUID.\r
-  @param FormId          The Form ID.\r
-  @param Package         The package header.\r
-\r
-  @param TempPacakge     The resultant package.\r
+  @param[in] FormSetGuid       The optional Formset GUID.\r
+  @param[in] FormId            The Form ID.\r
+  @param[in] Package           The package header.\r
+  @param[in] OpCodeBufferStart An OpCode buffer that contains the set of IFR \r
+                               opcodes to be inserted or replaced in the form.\r
+  @param[in] OpCodeBufferEnd   An OpCcode buffer that contains the IFR opcode\r
+                               that marks the end of a replace operation in the form.\r
+  @param[out] TempPackage      The resultant package.\r
 \r
   @retval EFI_SUCCESS    The function completes successfully.\r
+  @retval EFI_NOT_FOUND  The updated opcode or endopcode is not found.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -3388,22 +3439,22 @@ InternalHiiUpdateFormPackageData (
   The form to update is specified by Handle, FormSetGuid, and FormId.  Binary \r
   comparisons of IFR opcodes are performed from the beginning of the form being \r
   updated until an IFR opcode is found that exactly matches the first IFR opcode \r
-  specifed by StartOpCodeHandle.  The following rules are used to determine if\r
+  specified by StartOpCodeHandle.  The following rules are used to determine if\r
   an insert, replace, or delete operation is performed.\r
   \r
   1) If no matches are found, then NULL is returned.  \r
   2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
-     from StartOpcodeHandle except the first opcode are inserted immediately after \r
-     the matching IFR opcode in the form beng updated.\r
+     from StartOpCodeHandle except the first opcode are inserted immediately after \r
+     the matching IFR opcode in the form to be updated.\r
   3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made \r
-     from the matching IFR opcode until an IFR opcode exatly matches the first \r
+     from the matching IFR opcode until an IFR opcode exactly matches the first \r
      IFR opcode specified by EndOpCodeHandle.  If no match is found for the first\r
      IFR opcode specified by EndOpCodeHandle, then NULL is returned.  If a match\r
      is found, then all of the IFR opcodes between the start match and the end \r
      match are deleted from the form being updated and all of the IFR opcodes\r
-     from StartOpcodeHandle except the first opcode are inserted immediately after \r
+     from StartOpCodeHandle except the first opcode are inserted immediately after \r
      the matching start IFR opcode.  If StartOpCcodeHandle only contains one\r
-     IFR instruction, then the result of ths operation will delete all of the IFR\r
+     IFR instruction, then the result of this operation will delete all of the IFR\r
      opcodes between the start end matches.\r
 \r
   If HiiHandle is NULL, then ASSERT().\r
@@ -3444,8 +3495,8 @@ HiiUpdateForm (
   IN EFI_HII_HANDLE  HiiHandle,           \r
   IN EFI_GUID        *FormSetGuid,        OPTIONAL\r
   IN EFI_FORM_ID     FormId,\r
-  IN VOID            *StartOpcodeHandle,\r
-  IN VOID            *EndOpcodeHandle     OPTIONAL\r
+  IN VOID            *StartOpCodeHandle,\r
+  IN VOID            *EndOpCodeHandle     OPTIONAL\r
   )\r
 {\r
   EFI_STATUS                   Status;\r
@@ -3466,19 +3517,19 @@ HiiUpdateForm (
   // Input update data can't be NULL.\r
   //\r
   ASSERT (HiiHandle != NULL);\r
-  ASSERT (StartOpcodeHandle != NULL);\r
+  ASSERT (StartOpCodeHandle != NULL);\r
   UpdatePackageList = NULL;\r
   TempPacakge       = NULL;\r
   HiiPackageList    = NULL;\r
   \r
   //\r
-  // Restrive buffer data from Opcode Handle\r
+  // Retrieve buffer data from Opcode Handle\r
   //\r
-  OpCodeBufferStart = (HII_LIB_OPCODE_BUFFER *) StartOpcodeHandle;\r
-  OpCodeBufferEnd   = (HII_LIB_OPCODE_BUFFER *) EndOpcodeHandle;\r
+  OpCodeBufferStart = (HII_LIB_OPCODE_BUFFER *) StartOpCodeHandle;\r
+  OpCodeBufferEnd   = (HII_LIB_OPCODE_BUFFER *) EndOpCodeHandle;\r
   \r
   //\r
-  // Get the orginal package list\r
+  // Get the original package list\r
   //\r
   BufferSize = 0;\r
   HiiPackageList   = NULL;\r
@@ -3529,7 +3580,7 @@ HiiUpdateForm (
   UpdateBufferPos += sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
   \r
   //\r
-  // Go through each package to find the matched pacakge and update one by one\r
+  // Go through each package to find the matched package and update one by one\r
   //\r
   Updated = FALSE;\r
   Offset  = sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
@@ -3545,7 +3596,7 @@ HiiUpdateForm (
       //\r
       Status = InternalHiiUpdateFormPackageData (FormSetGuid, FormId, Package, OpCodeBufferStart, OpCodeBufferEnd, TempPacakge);\r
       //\r
-      // The matched package is found. Its pacakge buffer will be updated by the input new data.\r
+      // The matched package is found. Its package buffer will be updated by the input new data.\r
       //\r
       if (!EFI_ERROR(Status)) {\r
         //\r
@@ -3575,7 +3626,7 @@ HiiUpdateForm (
     WriteUnaligned32 (&UpdatePackageList->PackageLength, (UINT32) BufferSize);\r
     \r
     //\r
-    // Update Pacakge to show form\r
+    // Update Package to show form\r
     //\r
     Status = gHiiDatabase->UpdatePackageList (gHiiDatabase, HiiHandle, UpdatePackageList);\r
   } else {\r