]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c
Coding style modification.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / SectionExtractionDxe / SectionExtraction.c
index d25e186fc00af5c537bada0729cb01a0fa74b56f..2c7441b3e0a7d9065710e767b6cfe2a3ea61e3ff 100644 (file)
@@ -1,20 +1,4 @@
 /**@file\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
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-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
-\r
-  SectionExtraction.c\r
-  \r
-Abstract:\r
-\r
   Section Extraction Protocol implementation.\r
   \r
   Stream database is implemented as a linked list of section streams,\r
@@ -42,7 +26,17 @@ Abstract:
      \r
   3) A support protocol is not found, and the data is not available to be read\r
      without it.  This results in EFI_PROTOCOL_ERROR.\r
-  \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
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+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
+\r
 **/\r
 \r
 #include "SectionExtraction.h"\r
@@ -235,27 +229,23 @@ EFI_SECTION_EXTRACTION_PROTOCOL mSectionExtraction = {
   CloseSectionStream\r
 };\r
 \r
+/**\r
+  Entry point of the section extraction code. Initializes an instance of the \r
+  section extraction interface and installs it on a new handle.\r
+\r
+  @param ImageHandle   EFI_HANDLE: A handle for the image that is initializing this driver\r
+  @param SystemTable   EFI_SYSTEM_TABLE: A pointer to the EFI system table        \r
+\r
+  @retval EFI_SUCCESS            Driver initialized successfully\r
+  @retval EFI_OUT_OF_RESOURCES   Could not allocate needed resources\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SectionExtractionEntryPoint (\r
   IN EFI_HANDLE                   ImageHandle,\r
   IN EFI_SYSTEM_TABLE             *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description: \r
-  Entry point of the section extraction code. Initializes an instance of the \r
-  section extraction interface and installs it on a new handle.\r
-\r
-Arguments:  \r
-  ImageHandle   EFI_HANDLE: A handle for the image that is initializing this driver\r
-  SystemTable   EFI_SYSTEM_TABLE: A pointer to the EFI system table        \r
-\r
-Returns:  \r
-  EFI_SUCCESS:  Driver initialized successfully\r
-  EFI_OUT_OF_RESOURCES:   Could not allocate needed resources\r
-\r
---*/\r
 {\r
   EFI_STATUS                         Status;\r
 \r
@@ -273,6 +263,22 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  SEP member function.  This function creates and returns a new section stream\r
+  handle to represent the new section stream.\r
+\r
+  @param This                 Indicates the calling context.\r
+  @param SectionStreamLength  Size in bytes of the section stream.\r
+  @param SectionStream        Buffer containing the new section stream.\r
+  @param SectionStreamHandle  A pointer to a caller allocated UINTN that on output\r
+                              contains the new section stream handle.\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_OUT_OF_RESOURCES  memory allocation failed.\r
+  @retval EFI_INVALID_PARAMETER section stream does not end concident with end of\r
+                                last section.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
@@ -282,26 +288,6 @@ OpenSectionStream (
   IN     VOID                                      *SectionStream,\r
      OUT UINTN                                     *SectionStreamHandle\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  SEP member function.  This function creates and returns a new section stream\r
-  handle to represent the new section stream.\r
-\r
-Arguments:\r
-  This                - Indicates the calling context.\r
-  SectionStreamLength - Size in bytes of the section stream.\r
-  SectionStream       - Buffer containing the new section stream.\r
-  SectionStreamHandle - A pointer to a caller allocated UINTN that on output\r
-                        contains the new section stream handle.\r
-\r
-Returns:\r
-  EFI_SUCCESS\r
-  EFI_OUT_OF_RESOURCES - memory allocation failed.\r
-  EFI_INVALID_PARAMETER - section stream does not end concident with end of\r
-                          last section.\r
-\r
---*/\r
 {\r
   //\r
   // Check to see section stream looks good...\r
@@ -319,6 +305,49 @@ Returns:
           );\r
 }\r
   \r
+/**\r
+  SEP member function.  Retrieves requested section from section stream.\r
+\r
+  @param This:                 Pointer to SEP instance.\r
+  @param SectionStreamHandle:  The section stream from which to extract the requested\r
+                               section.\r
+  @param SectionType:         A pointer to the type of section to search for.\r
+  @param SectionDefinitionGuid: If the section type is EFI_SECTION_GUID_DEFINED, then\r
+                                SectionDefinitionGuid indicates which of these types\r
+                                of sections to search for.\r
+  @param SectionInstance:      Indicates which instance of the requested section to\r
+                               return.\r
+  @param Buffer:               Double indirection to buffer.  If *Buffer is non-null on\r
+                               input, then the buffer is caller allocated.  If\r
+                               *Buffer is NULL, then the buffer is callee allocated.\r
+                               In either case, the requried buffer size is returned\r
+                               in *BufferSize.\r
+  @param BufferSize:           On input, indicates the size of *Buffer if *Buffer is\r
+                               non-null on input.  On output, indicates the required\r
+                               size (allocated size if callee allocated) of *Buffer.\r
+  @param AuthenticationStatus: Indicates the authentication status of the retrieved\r
+                               section.\r
+\r
\r
+  @retval EFI_SUCCESS:        Section was retrieved successfully\r
+  @retval EFI_PROTOCOL_ERROR: A GUID defined section was encountered in the section \r
+                        stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED\r
+                        bit set, but there was no corresponding GUIDed Section \r
+                        Extraction Protocol in the handle database.  *Buffer is \r
+                        unmodified.\r
+  @retval EFI_NOT_FOUND:      An error was encountered when parsing the SectionStream.\r
+                        This indicates the SectionStream  is not correctly \r
+                        formatted.\r
+  @retval EFI_NOT_FOUND:      The requested section does not exist.\r
+  @retval EFI_OUT_OF_RESOURCES: The system has insufficient resources to process the \r
+                        request.\r
+  @retval EFI_INVALID_PARAMETER: The SectionStreamHandle does not exist.\r
+  @retval EFI_WARN_TOO_SMALL: The size of the caller allocated input buffer is \r
+                        insufficient to contain the requested section.  The \r
+                        input buffer is filled and contents are section contents\r
+                        are truncated.\r
+\r
+**/  \r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
@@ -332,52 +361,7 @@ GetSection (
   IN OUT UINTN                                          *BufferSize,\r
   OUT UINT32                                            *AuthenticationStatus\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-  SEP member function.  Retrieves requested section from section stream.\r
-\r
-Arguments:  \r
-  This:                 Pointer to SEP instance.\r
-  SectionStreamHandle:  The section stream from which to extract the requested\r
-                          section.\r
-  SectionType:         A pointer to the type of section to search for.\r
-  SectionDefinitionGuid: If the section type is EFI_SECTION_GUID_DEFINED, then\r
-                        SectionDefinitionGuid indicates which of these types\r
-                          of sections to search for.\r
-  SectionInstance:      Indicates which instance of the requested section to\r
-                          return.\r
-  Buffer:               Double indirection to buffer.  If *Buffer is non-null on\r
-                          input, then the buffer is caller allocated.  If\r
-                          *Buffer is NULL, then the buffer is callee allocated.\r
-                          In either case, the requried buffer size is returned\r
-                          in *BufferSize.\r
-  BufferSize:           On input, indicates the size of *Buffer if *Buffer is\r
-                          non-null on input.  On output, indicates the required\r
-                          size (allocated size if callee allocated) of *Buffer.\r
-  AuthenticationStatus: Indicates the authentication status of the retrieved\r
-                          section.\r
-\r
-Returns:  \r
-  EFI_SUCCESS:        Section was retrieved successfully\r
-  EFI_PROTOCOL_ERROR: A GUID defined section was encountered in the section \r
-                        stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED\r
-                        bit set, but there was no corresponding GUIDed Section \r
-                        Extraction Protocol in the handle database.  *Buffer is \r
-                        unmodified.\r
-  EFI_NOT_FOUND:      An error was encountered when parsing the SectionStream.\r
-                        This indicates the SectionStream  is not correctly \r
-                        formatted.\r
-  EFI_NOT_FOUND:      The requested section does not exist.\r
-  EFI_OUT_OF_RESOURCES: The system has insufficient resources to process the \r
-                        request.\r
-  EFI_INVALID_PARAMETER: The SectionStreamHandle does not exist.\r
-  EFI_WARN_TOO_SMALL: The size of the caller allocated input buffer is \r
-                        insufficient to contain the requested section.  The \r
-                        input buffer is filled and contents are section contents\r
-                        are truncated.\r
-\r
---*/\r
 {\r
   CORE_SECTION_STREAM_NODE                              *StreamNode;\r
   EFI_TPL                                               OldTpl;\r
@@ -461,7 +445,18 @@ GetSection_Done:
   return Status;\r
 }\r
 \r
+/**\r
+  SEP member function.  Deletes an existing section stream\r
+\r
+  @param This                - Indicates the calling context.\r
+  @param StreamHandleToClose - Indicates the stream to close\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_OUT_OF_RESOURCES - memory allocation failed.\r
+  @retval EFI_INVALID_PARAMETER - section stream does not end concident with end of\r
+                          last section.\r
 \r
+**/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
@@ -469,22 +464,7 @@ CloseSectionStream (
   IN  EFI_SECTION_EXTRACTION_PROTOCOL           *This,\r
   IN  UINTN                                     StreamHandleToClose\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  SEP member function.  Deletes an existing section stream\r
-\r
-Arguments:\r
-  This                - Indicates the calling context.\r
-  StreamHandleToClose - Indicates the stream to close\r
 \r
-Returns:\r
-  EFI_SUCCESS\r
-  EFI_OUT_OF_RESOURCES - memory allocation failed.\r
-  EFI_INVALID_PARAMETER - section stream does not end concident with end of\r
-                          last section.\r
-\r
---*/\r
 {\r
   CORE_SECTION_STREAM_NODE                      *StreamNode;\r
   EFI_TPL                                       OldTpl;\r
@@ -519,7 +499,19 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Worker function.  Determine if the input stream:child matches the input type.\r
+\r
+  @param Stream              - Indicates the section stream associated with the child\r
+  @param Child               - Indicates the child to check\r
+  @param SearchType          - Indicates the type of section to check against for\r
+  @param SectionDefinitionGuid - Indicates the GUID to check against if the type is\r
+                        EFI_SECTION_GUID_DEFINED\r
+\r
+  @retval TRUE                - The child matches\r
+  @retval FALSE               - The child doesn't match\r
 \r
+**/\r
 STATIC\r
 BOOLEAN\r
 ChildIsType (\r
@@ -528,22 +520,6 @@ ChildIsType (
   IN EFI_SECTION_TYPE         SearchType,\r
   IN EFI_GUID                 *SectionDefinitionGuid\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Worker function.  Determine if the input stream:child matches the input type.\r
-\r
-Arguments:\r
-  Stream              - Indicates the section stream associated with the child\r
-  Child               - Indicates the child to check\r
-  SearchType          - Indicates the type of section to check against for\r
-  SectionDefinitionGuid - Indicates the GUID to check against if the type is\r
-                        EFI_SECTION_GUID_DEFINED\r
-Returns:\r
-  TRUE                - The child matches\r
-  FALSE               - The child doesn't match\r
-\r
---*/\r
 {\r
   EFI_GUID_DEFINED_SECTION    *GuidedSection;\r
   \r
@@ -560,7 +536,30 @@ Returns:
   return CompareGuid (&GuidedSection->SectionDefinitionGuid, SectionDefinitionGuid);\r
 }\r
 \r
+/**\r
+  Worker function  Recursively searches / builds section stream database\r
+  looking for requested section.\r
 \r
+\r
+  @param SourceStream        - Indicates the section stream in which to do the search.\r
+  @param SearchType          - Indicates the type of section to search for.\r
+  @param SectionInstance     - Indicates which instance of section to find.  This is\r
+                        an in/out parameter to deal with recursions.\r
+  @param SectionDefinitionGuid  - Guid of section definition\r
+  @param FoundChild          - Output indicating the child node that is found.\r
+  @param FoundStream         - Output indicating which section stream the child was\r
+                        found in.  If this stream was generated as a result of\r
+                        an encapsulation section, the streamhandle is visible\r
+                        within the SEP driver only.\r
+  @param AuthenticationStatus- Indicates the authentication status of the found section.\r
+\r
+  @retval EFI_SUCCESS         - Child node was found and returned.\r
+  @retval EFI_OUT_OF_RESOURCES- Memory allocation failed.\r
+  @retval EFI_NOT_FOUND       - Requested child node does not exist.\r
+  @retval EFI_PROTOCOL_ERROR  - a required GUIDED section extraction protocol does not\r
+                        exist\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 FindChildNode (\r
@@ -572,33 +571,7 @@ FindChildNode (
   OUT    CORE_SECTION_STREAM_NODE                   **FoundStream,\r
   OUT    UINT32                                     *AuthenticationStatus\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-  Worker function  Recursively searches / builds section stream database\r
-  looking for requested section.\r
-\r
-Arguments:\r
-  SourceStream        - Indicates the section stream in which to do the search.\r
-  SearchType          - Indicates the type of section to search for.\r
-  SectionInstance     - Indicates which instance of section to find.  This is\r
-                        an in/out parameter to deal with recursions.\r
-  SectionDefinitionGuid  - Guid of section definition\r
-  FoundChild          - Output indicating the child node that is found.\r
-  FoundStream         - Output indicating which section stream the child was\r
-                        found in.  If this stream was generated as a result of\r
-                        an encapsulation section, the streamhandle is visible\r
-                        within the SEP driver only.\r
-  AuthenticationStatus- Indicates the authentication status of the found section.\r
-\r
-Returns:\r
-  EFI_SUCCESS         - Child node was found and returned.\r
-  EFI_OUT_OF_RESOURCES- Memory allocation failed.\r
-  EFI_NOT_FOUND       - Requested child node does not exist.\r
-  EFI_PROTOCOL_ERROR  - a required GUIDED section extraction protocol does not\r
-                        exist\r
-\r
---*/\r
 {\r
   CORE_SECTION_CHILD_NODE                       *CurrentChildNode;\r
   CORE_SECTION_CHILD_NODE                       *RecursedChildNode;\r
@@ -715,36 +688,31 @@ Returns:
   }\r
 }\r
 \r
-\r
-STATIC\r
-EFI_STATUS\r
-CreateChildNode (\r
-  IN     CORE_SECTION_STREAM_NODE              *Stream,\r
-  IN     UINT32                                ChildOffset,\r
-     OUT CORE_SECTION_CHILD_NODE               **ChildNode\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
   Worker function.  Constructor for new child nodes.\r
 \r
-Arguments:\r
-  Stream              - Indicates the section stream in which to add the child.\r
-  ChildOffset         - Indicates the offset in Stream that is the beginning\r
+  @param Stream              - Indicates the section stream in which to add the child.\r
+  @param ChildOffset         - Indicates the offset in Stream that is the beginning\r
                         of the child section.\r
-  ChildNode           - Indicates the Callee allocated and initialized child.\r
+  @param ChildNode           - Indicates the Callee allocated and initialized child.\r
 \r
-Returns:\r
-  EFI_SUCCESS         - Child node was found and returned.\r
-  EFI_OUT_OF_RESOURCES- Memory allocation failed.\r
-  EFI_PROTOCOL_ERROR  - Encapsulation sections produce new stream handles when\r
+  @retval EFI_SUCCESS         - Child node was found and returned.\r
+  @retval EFI_OUT_OF_RESOURCES- Memory allocation failed.\r
+  @retval EFI_PROTOCOL_ERROR  - Encapsulation sections produce new stream handles when\r
                         the child node is created.  If the section type is GUID\r
                         defined, and the extraction GUID does not exist, and\r
                         producing the stream requires the GUID, then a protocol\r
                         error is generated and no child is produced.\r
   Values returned by OpenSectionStreamEx.\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+CreateChildNode (\r
+  IN     CORE_SECTION_STREAM_NODE              *Stream,\r
+  IN     UINT32                                ChildOffset,\r
+     OUT CORE_SECTION_CHILD_NODE               **ChildNode\r
+  )\r
 {\r
   EFI_STATUS                                   Status;\r
   EFI_COMMON_SECTION_HEADER                    *SectionHeader;\r
@@ -997,27 +965,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Worker function.  Constructor for RPN event if needed to keep AuthenticationStatus\r
+  cache correct when a missing GUIDED_SECTION_EXTRACTION_PROTOCOL appears...\r
 \r
+  @param ParentStream        - Indicates the parent of the ecnapsulation section (child)\r
+  @param ChildNode           - Indicates the child node that is the encapsulation section.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 CreateGuidedExtractionRpnEvent (\r
   IN CORE_SECTION_STREAM_NODE       *ParentStream,\r
   IN CORE_SECTION_CHILD_NODE        *ChildNode\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Worker function.  Constructor for RPN event if needed to keep AuthenticationStatus\r
-  cache correct when a missing GUIDED_SECTION_EXTRACTION_PROTOCOL appears...\r
-\r
-Arguments:\r
-  ParentStream        - Indicates the parent of the ecnapsulation section (child)\r
-  ChildNode           - Indicates the child node that is the encapsulation section.\r
-\r
-Returns:\r
-  None\r
-\r
---*/\r
 {\r
   RPN_EVENT_CONTEXT *Context;\r
   \r
@@ -1040,7 +1001,15 @@ Returns:
                     );\r
 }\r
   \r
-  \r
+/**\r
+  RPN callback function.  Removes a stale section stream and re-initializes it\r
+  with an updated AuthenticationStatus.\r
+\r
+  @param Event               - The event that fired\r
+  @param RpnContext          - A pointer to the context that allows us to identify\r
+                        the relevent encapsulation...\r
+\r
+**/  \r
 STATIC\r
 VOID\r
 EFIAPI\r
@@ -1048,21 +1017,6 @@ NotifyGuidedExtraction (
   IN   EFI_EVENT   Event,\r
   IN   VOID        *RpnContext\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  RPN callback function.  Removes a stale section stream and re-initializes it\r
-  with an updated AuthenticationStatus.\r
-\r
-Arguments:\r
-  Event               - The event that fired\r
-  RpnContext          - A pointer to the context that allows us to identify\r
-                        the relevent encapsulation...\r
-\r
-Returns:\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                              Status;\r
   EFI_GUID_DEFINED_SECTION                *GuidedHeader;\r
@@ -1120,24 +1074,18 @@ Returns:
   gBS->FreePool (Context);\r
 }  \r
   \r
+/**\r
+  Worker function.  Destructor for child nodes.\r
 \r
+  @param ChildNode           - Indicates the node to destroy\r
+\r
+**/\r
 STATIC\r
 VOID\r
 FreeChildNode (\r
   IN  CORE_SECTION_CHILD_NODE                   *ChildNode\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-  Worker function.  Destructor for child nodes.\r
-\r
-Arguments:\r
-  ChildNode           - Indicates the node to destroy\r
-\r
-Returns:\r
-  none\r
-\r
---*/\r
 {\r
   ASSERT (ChildNode->Signature == CORE_SECTION_CHILD_SIGNATURE);\r
   //\r
@@ -1158,7 +1106,22 @@ Returns:
   gBS->FreePool (ChildNode);\r
 }  \r
 \r
+/**\r
+  Worker function.  Constructor for section streams.\r
+\r
+  @param SectionStreamLength - Size in bytes of the section stream.\r
+  @param SectionStream       - Buffer containing the new section stream.\r
+  @param AllocateBuffer      - Indicates whether the stream buffer is to be copied\r
+                          or the input buffer is to be used in place.\r
+  @param AuthenticationStatus- Indicates the default authentication status for the\r
+                          new stream.\r
+  @param SectionStreamHandle - A pointer to a caller allocated section stream handle.\r
+\r
+  \r
+  @retval EFI_SUCCESS         - Stream was added to stream database.\r
+  @retval EFI_OUT_OF_RESOURCES - memory allocation failed.\r
 \r
+**/\r
 STATIC\r
 EFI_STATUS\r
 OpenSectionStreamEx (\r
@@ -1168,25 +1131,7 @@ OpenSectionStreamEx (
   IN     UINT32                                    AuthenticationStatus,   \r
      OUT UINTN                                     *SectionStreamHandle\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Worker function.  Constructor for section streams.\r
-\r
-  Arguments:\r
-    SectionStreamLength - Size in bytes of the section stream.\r
-    SectionStream       - Buffer containing the new section stream.\r
-    AllocateBuffer      - Indicates whether the stream buffer is to be copied\r
-                          or the input buffer is to be used in place.\r
-    AuthenticationStatus- Indicates the default authentication status for the\r
-                          new stream.\r
-    SectionStreamHandle - A pointer to a caller allocated section stream handle.\r
-\r
-  Returns:\r
-    EFI_SUCCESS         - Stream was added to stream database.\r
-    EFI_OUT_OF_RESOURCES - memory allocation failed.\r
 \r
---*/\r
 {\r
   CORE_SECTION_STREAM_NODE    *NewStream;\r
   EFI_TPL                     OldTpl;\r
@@ -1250,28 +1195,24 @@ OpenSectionStreamEx (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Worker function.  Search stream database for requested stream handle.\r
 \r
+  @param SearchHandle        - Indicates which stream to look for.\r
+  @param FoundStream         - Output pointer to the found stream.\r
+\r
+  @retval EFI_SUCCESS         - StreamHandle was found and *FoundStream contains\r
+                          the stream node.\r
+  @retval EFI_NOT_FOUND       - SearchHandle was not found in the stream database.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 FindStreamNode (\r
   IN  UINTN                                     SearchHandle,\r
   OUT CORE_SECTION_STREAM_NODE                  **FoundStream\r
   )\r
-/*++\r
 \r
-  Routine Description:\r
-    Worker function.  Search stream database for requested stream handle.\r
-\r
-  Arguments:\r
-    SearchHandle        - Indicates which stream to look for.\r
-    FoundStream         - Output pointer to the found stream.\r
-\r
-  Returns:\r
-    EFI_SUCCESS         - StreamHandle was found and *FoundStream contains\r
-                          the stream node.\r
-    EFI_NOT_FOUND       - SearchHandle was not found in the stream database.\r
-\r
---*/\r
 {  \r
   CORE_SECTION_STREAM_NODE                      *StreamNode;\r
   \r
@@ -1292,27 +1233,22 @@ FindStreamNode (
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+\r
+  Check if a stream is valid.\r
+\r
+  @param SectionStream         - The section stream to be checked\r
+  @param SectionStreamLength   - The length of section stream\r
 \r
+  @return if a stream is valid.\r
+**/\r
 STATIC\r
 BOOLEAN\r
 IsValidSectionStream (\r
   IN  VOID              *SectionStream,\r
   IN  UINTN             SectionStreamLength\r
   )\r
-/*++\r
 \r
-Routine Description:\r
-  Check if a stream is valid.\r
-\r
-Arguments:\r
-  SectionStream         - The section stream to be checked\r
-  SectionStreamLength   - The length of section stream\r
-\r
-Returns:\r
-  TRUE\r
-  FALSE\r
-\r
---*/\r
 {\r
   UINTN                       TotalLength;\r
   UINTN                       SectionLength;\r
@@ -1348,41 +1284,34 @@ Returns:
   return FALSE;\r
 }\r
 \r
-EFI_EVENT\r
-CoreCreateProtocolNotifyEvent (\r
-  IN EFI_GUID             *ProtocolGuid,\r
-  IN EFI_TPL              NotifyTpl,\r
-  IN EFI_EVENT_NOTIFY     NotifyFunction,\r
-  IN VOID                 *NotifyContext,\r
-  OUT VOID                **Registration,\r
-  IN  BOOLEAN             SignalFlag\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Create a protocol notification event and return it.\r
 \r
-Arguments:\r
-\r
-  ProtocolGuid    - Protocol to register notification event on.\r
+  @param ProtocolGuid    - Protocol to register notification event on.\r
 \r
-  NotifyTpl        - Maximum TPL to signal the NotifyFunction.\r
+  @param NotifyTpl        - Maximum TPL to signal the NotifyFunction.\r
 \r
-  NotifyFuncition  - EFI notification routine.\r
+  @param NotifyFuncition  - EFI notification routine.\r
 \r
-  NotifyContext   - Context passed into Event when it is created.\r
+  @param NotifyContext   - Context passed into Event when it is created.\r
 \r
-  Registration    - Registration key returned from RegisterProtocolNotify().\r
+  @param Registration    - Registration key returned from RegisterProtocolNotify().\r
 \r
-  SignalFlag      -  Boolean value to decide whether kick the event after register or not.\r
+  @param SignalFlag      -  Boolean value to decide whether kick the event after register or not.\r
 \r
-Returns:\r
+  @Return  The EFI_EVENT that has been registered to be signaled when a ProtocolGuid\r
+           is added to the system.\r
 \r
-  The EFI_EVENT that has been registered to be signaled when a ProtocolGuid\r
-  is added to the system.\r
-\r
---*/\r
+**/\r
+EFI_EVENT\r
+CoreCreateProtocolNotifyEvent (\r
+  IN EFI_GUID             *ProtocolGuid,\r
+  IN EFI_TPL              NotifyTpl,\r
+  IN EFI_EVENT_NOTIFY     NotifyFunction,\r
+  IN VOID                 *NotifyContext,\r
+  OUT VOID                **Registration,\r
+  IN  BOOLEAN             SignalFlag\r
+  )\r
 {\r
   EFI_STATUS              Status;\r
   EFI_EVENT               Event;\r