]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/PeiMain.h
Fix function comment to follows doxygen format.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / PeiMain.h
index 35795868586c4e72c544739f14c74a158984fba7..8e87aaae05d6b2afe59bf44d7a05bc06ba210ca1 100644 (file)
@@ -1,5 +1,6 @@
-/*++\r
-\r
+/** @file\r
+  Definition of Pei Core Structures and Services\r
+  \r
 Copyright (c) 2006 - 2007, 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,17 +10,7 @@ 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
-\r
-  PeiMain.h\r
-\r
-Abstract:\r
-\r
-  Definition of Pei Core Structures and Services\r
-\r
-Revision History\r
-\r
---*/\r
+**/\r
 \r
 #ifndef _PEI_MAIN_H_\r
 #define _PEI_MAIN_H_\r
@@ -58,24 +49,22 @@ Revision History
 \r
 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE   0xff\r
 \r
-//\r
-// Pei Core private data structures\r
-//\r
+///\r
+/// Pei Core private data structures\r
+///\r
 typedef union {\r
   EFI_PEI_PPI_DESCRIPTOR      *Ppi;\r
   EFI_PEI_NOTIFY_DESCRIPTOR   *Notify;\r
   VOID                        *Raw;\r
 } PEI_PPI_LIST_POINTERS;\r
 \r
-#define MAX_PPI_DESCRIPTORS 64\r
-\r
 typedef struct {\r
   INTN                    PpiListEnd;\r
   INTN                    NotifyListEnd;\r
   INTN                    DispatchListEnd;\r
   INTN                    LastDispatchedInstall;\r
   INTN                    LastDispatchedNotify;\r
-  PEI_PPI_LIST_POINTERS   PpiListPtrs[MAX_PPI_DESCRIPTORS];\r
+  PEI_PPI_LIST_POINTERS   PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)];\r
 } PEI_PPI_DATABASE;\r
 \r
 \r
@@ -152,9 +141,6 @@ typedef struct{
 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \\r
   CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)\r
 \r
-//\r
-// BUGBUG: Where does this go really?\r
-//\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *PEI_CORE_ENTRY_POINT)(\r
@@ -163,9 +149,9 @@ EFI_STATUS
   IN PEI_CORE_INSTANCE              *OldCoreData\r
   );\r
 \r
-//\r
-// Union of temporarily used function pointers (to save stack space)\r
-//\r
+///\r
+/// Union of temporarily used function pointers (to save stack space)\r
+///\r
 typedef union {\r
   PEI_CORE_ENTRY_POINT         PeiCore;\r
   EFI_PEIM_ENTRY_POINT2        PeimEntry;\r
@@ -187,47 +173,42 @@ typedef struct {
 //\r
 // PeiCore function\r
 //\r
-EFI_STATUS\r
-EFIAPI\r
-PeiCore (\r
-  IN CONST EFI_SEC_PEI_HAND_OFF        *SecCoreData,\r
-  IN CONST EFI_PEI_PPI_DESCRIPTOR      *PpList,\r
-  IN VOID                              *Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   The entry routine to Pei Core, invoked by PeiMain during transition\r
   from SEC to PEI. After switching stack in the PEI core, it will restart\r
   with the old core data.\r
 \r
-Arguments:\r
 \r
-  PeiStartupDescriptor - Information and services provided by SEC phase.\r
-  OldCoreData          - Pointer to old core data that is used to initialize the\r
+  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
+                         environment, such as the size and location of temporary RAM, the stack location and\r
+                         the BFV location.\r
+  @param PpiList         Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r
+                         An empty PPI list consists of a single descriptor with the end-tag\r
+                         EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r
+                         phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such\r
+                         that both the PEI Foundation and any modules can leverage the associated service\r
+                         calls and/or code in these early PPIs\r
+  @param Data            Pointer to old core data that is used to initialize the\r
                          core's data areas.\r
 \r
-Returns:\r
-\r
-  This function never returns\r
-  EFI_NOT_FOUND        - Never reach\r
+  @retval EFI_NOT_FOUND  Never reach\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiCore (\r
+  IN CONST EFI_SEC_PEI_HAND_OFF        *SecCoreData,\r
+  IN CONST EFI_PEI_PPI_DESCRIPTOR      *PpList,\r
+  IN VOID                              *Data\r
+  )\r
 ;\r
 \r
 //\r
 // Dispatcher support functions\r
 //\r
 \r
-BOOLEAN\r
-PeimDispatchReadiness (\r
-  IN EFI_PEI_SERVICES   **PeiServices,\r
-  IN VOID               *DependencyExpression\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   This is the POSTFIX version of the dependency evaluator.  When a\r
   PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on\r
@@ -236,208 +217,117 @@ Routine Description:
   some time savings as not all PPIs must be checked for certain\r
   operation types (AND, OR).\r
 \r
-Arguments:\r
-\r
-  PeiServices               - Calling context.\r
 \r
-  DependencyExpression      - Pointer to a dependency expression.  The Grammar adheres to\r
-                              the BNF described above and is stored in postfix notation.\r
+  @param PeiServices            Calling context.\r
+  @param DependencyExpression   Pointer to a dependency expression.  The Grammar adheres to\r
+                                the BNF described above and is stored in postfix notation.\r
 \r
-Returns:\r
+  @retval TRUE      if it is a well-formed Grammar\r
+  @retval FALSE     if the dependency expression overflows the evaluation stack\r
+                    if the dependency expression underflows the evaluation stack\r
+                    if the dependency expression is not a well-formed Grammar.\r
 \r
-  Status = EFI_SUCCESS            if it is a well-formed Grammar\r
-           EFI_INVALID_PARAMETER  if the dependency expression overflows\r
-                                  the evaluation stack\r
-           EFI_INVALID_PARAMETER  if the dependency expression underflows\r
-                                  the evaluation stack\r
-           EFI_INVALID_PARAMETER  if the dependency expression is not a\r
-                                  well-formed Grammar.\r
---*/\r
+**/\r
+BOOLEAN\r
+PeimDispatchReadiness (\r
+  IN EFI_PEI_SERVICES   **PeiServices,\r
+  IN VOID               *DependencyExpression\r
+  )\r
 ;\r
 \r
+/**\r
+  Conduct PEIM dispatch.\r
+\r
+  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
+                         environment, such as the size and location of temporary RAM, the stack location and\r
+                         the BFV location.\r
+                         PrivateData          - Pointer to the private data passed in from caller\r
+                         DispatchData         - Pointer to PEI_CORE_DISPATCH_DATA data.\r
+  @param Private         EDES_TODO: Add parameter description\r
+\r
+  @retval EFI_SUCCESS    Successfully dispatched PEIM.\r
+  @retval EFI_NOT_FOUND  The dispatch failed.\r
 \r
+**/\r
 VOID\r
 PeiDispatcher (\r
   IN CONST EFI_SEC_PEI_HAND_OFF  *SecCoreData,\r
   IN PEI_CORE_INSTANCE           *PrivateData\r
   )\r
+;\r
 \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Conduct PEIM dispatch.\r
-\r
-Arguments:\r
-\r
-  PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR\r
-  PrivateData          - Pointer to the private data passed in from caller\r
-  DispatchData         - Pointer to PEI_CORE_DISPATCH_DATA data.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Successfully dispatched PEIM.\r
-  EFI_NOT_FOUND - The dispatch failed.\r
+/**\r
+  Initialize the Dispatcher's data members\r
 \r
---*/\r
-;\r
+  @param PrivateData     PeiCore's private data structure\r
+  @param OldCoreData     Old data from SecCore\r
+                         NULL if being run in non-permament memory mode.\r
+  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
+                         environment, such as the size and location of temporary RAM, the stack location and\r
+                         the BFV location.\r
 \r
+  @return None.\r
 \r
+**/\r
 VOID\r
 InitializeDispatcherData (\r
   IN PEI_CORE_INSTANCE            *PrivateData,\r
   IN PEI_CORE_INSTANCE            *OldCoreData,\r
   IN CONST EFI_SEC_PEI_HAND_OFF   *SecCoreData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Dispatcher's data members\r
-\r
-Arguments:\r
-\r
-  PeiServices          - The PEI core services table.\r
-  OldCoreData          - Pointer to old core data (before switching stack).\r
-                         NULL if being run in non-permament memory mode.\r
-  PeiStartupDescriptor - Information and services provided by SEC phase.\r
-\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-;\r
-\r
-\r
-EFI_STATUS\r
-FindNextPeim (\r
-  IN EFI_PEI_SERVICES            **PeiServices,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER     **PeimFileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching file in the\r
-    FFS volume. The search starts from FileHeader inside\r
-    the Firmware Volume defined by FwVolHeader.\r
-\r
-Arguments:\r
-    PeiServices - Pointer to the PEI Core Services Table.\r
-\r
-    FwVolHeader - Pointer to the FV header of the volume to search.\r
-                     This parameter must point to a valid FFS volume.\r
-\r
-    PeimFileHeader  - Pointer to the current file from which to begin searching.\r
-                  This pointer will be updated upon return to reflect the file found.\r
-\r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-Dispatched (\r
-  IN UINT8  CurrentPeim,\r
-  IN UINT32 DispatchedPeimBitMap\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine checks to see if a particular PEIM has been dispatched during\r
-  the PEI core dispatch.\r
-\r
-Arguments:\r
-  CurrentPeim - The PEIM/FV in the bit array to check.\r
-  DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.\r
-\r
-Returns:\r
-  TRUE if PEIM already dispatched\r
-  FALSE if not\r
-\r
---*/\r
 ;\r
 \r
-VOID\r
-SetDispatched (\r
-  IN EFI_PEI_SERVICES   **PeiServices,\r
-  IN UINT8              CurrentPeim,\r
-  OUT UINT32            *DispatchedPeimBitMap\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine sets a PEIM as having been dispatched once its entry\r
-  point has been invoked.\r
-\r
-Arguments:\r
+/**\r
+  This routine parses the Dependency Expression, if available, and\r
+  decides if the module can be executed.\r
 \r
-  PeiServices          - The PEI core services table.\r
-  CurrentPeim          - The PEIM/FV in the bit array to check.\r
-  DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.\r
 \r
-Returns:\r
-  None\r
+  @param Private         PeiCore's private data structure\r
+  @param FileHandle      PEIM's file handle\r
+  @param PeimCount       Peim count in all dispatched PEIMs.\r
 \r
---*/\r
-;\r
+  @retval TRUE   Can be dispatched\r
+  @retval FALSE  Cannot be dispatched\r
 \r
+**/\r
 BOOLEAN\r
 DepexSatisfied (\r
   IN PEI_CORE_INSTANCE          *Private,\r
   IN EFI_PEI_FILE_HANDLE        FileHandle,\r
   IN UINTN                      PeimCount\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine parses the Dependency Expression, if available, and\r
-  decides if the module can be executed.\r
-\r
-Arguments:\r
-  PeiServices - The PEI Service Table\r
-  CurrentPeimAddress - Address of the PEIM Firmware File under investigation\r
-\r
-Returns:\r
-  TRUE  - Can be dispatched\r
-  FALSE - Cannot be dispatched\r
-\r
---*/\r
 ;\r
 \r
 //\r
 // PPI support functions\r
 //\r
+/**\r
+\r
+  Initialize PPI services.\r
+\r
+\r
+  @param PrivateData     Pointer to the PEI Core data.\r
+  @param OldCoreData     Pointer to old PEI Core data. \r
+                         NULL if being run in non-permament memory mode.\r
+\r
+**/\r
 VOID\r
 InitializePpiServices (\r
   IN PEI_CORE_INSTANCE   *PrivateData,\r
   IN PEI_CORE_INSTANCE   *OldCoreData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize PPI services.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices - The PEI core services table.\r
-  OldCoreData - Pointer to the PEI Core data.\r
-                NULL if being run in non-permament memory mode.\r
+/**\r
 \r
-Returns:\r
-  Nothing\r
+  Migrate the Hob list from the CAR stack to PEI installed memory.\r
 \r
---*/\r
-;\r
+  @param PeiServices         The PEI core services table.\r
+  @param OldCheckingBottom   The old checking bottom.\r
+  @param OldCheckingTop      The old checking top.\r
+  @param NewHandOffHob       The new handoff HOB list.\r
 \r
+**/\r
 VOID\r
 ConvertPpiPointers (\r
   IN CONST EFI_PEI_SERVICES                     **PeiServices,\r
@@ -445,51 +335,43 @@ ConvertPpiPointers (
   IN UINTN                         OldCheckingTop,\r
   IN EFI_HOB_HANDOFF_INFO_TABLE    *NewHandOffHob\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Migrate the Hob list from the CAR stack to PEI installed memory.\r
+;\r
 \r
-Arguments:\r
+/**\r
 \r
-  PeiServices       - The PEI core services table.\r
-  OldCheckingBottom - The old checking bottom.\r
-  OldCheckingTop    - The old checking top.\r
-  NewHandOffHob     - The new handoff HOB list.\r
+  Install PPI services.\r
 \r
-Returns:\r
+  @param PeiServices     - Pointer to the PEI Service Table\r
+  @param PpiList         - Pointer to a list of PEI PPI Descriptors.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS             - if all PPIs in PpiList are successfully installed.\r
+  @retval EFI_INVALID_PARAMETER   - if PpiList is NULL pointer\r
+  @retval EFI_INVALID_PARAMETER   - if any PPI in PpiList is not valid\r
+  @retval EFI_OUT_OF_RESOURCES    - if there is no more memory resource to install PPI\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiInstallPpi (\r
   IN CONST EFI_PEI_SERVICES        **PeiServices,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Install PPI services.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices - Pointer to the PEI Service Table\r
-  PpiList     - Pointer to a list of PEI PPI Descriptors.\r
+/**\r
 \r
-Returns:\r
+  Re-Install PPI services.\r
 \r
-    EFI_SUCCESS             - if all PPIs in PpiList are successfully installed.\r
-    EFI_INVALID_PARAMETER   - if PpiList is NULL pointer\r
-    EFI_INVALID_PARAMETER   - if any PPI in PpiList is not valid\r
-    EFI_OUT_OF_RESOURCES    - if there is no more memory resource to install PPI\r
+  @param PeiServices     - Pointer to the PEI Service Table\r
+  @param OldPpi          - Pointer to the old PEI PPI Descriptors.\r
+  @param NewPpi          - Pointer to the new PEI PPI Descriptors.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS           - if the operation was successful\r
+  @retval EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL\r
+  @retval EFI_INVALID_PARAMETER - if NewPpi is not valid\r
+  @retval EFI_NOT_FOUND         - if the PPI was not in the database\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiReInstallPpi (\r
@@ -497,28 +379,24 @@ PeiReInstallPpi (
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *OldPpi,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *NewPpi\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Re-Install PPI services.\r
+;\r
 \r
-Arguments:\r
+/**\r
 \r
-  PeiServices - Pointer to the PEI Service Table\r
-  OldPpi      - Pointer to the old PEI PPI Descriptors.\r
-  NewPpi      - Pointer to the new PEI PPI Descriptors.\r
+  Locate a given named PPI.\r
 \r
-Returns:\r
 \r
-  EFI_SUCCESS           - if the operation was successful\r
-  EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL\r
-  EFI_INVALID_PARAMETER - if NewPpi is not valid\r
-  EFI_NOT_FOUND         - if the PPI was not in the database\r
+  @param PeiServices     - Pointer to the PEI Service Table\r
+  @param Guid            - Pointer to GUID of the PPI.\r
+  @param Instance        - Instance Number to discover.\r
+  @param PpiDescriptor   - Pointer to reference the found descriptor. If not NULL,\r
+                         returns a pointer to the descriptor (includes flags, etc)\r
+  @param Ppi             - Pointer to reference the found PPI\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS   if the PPI is in the database\r
+  @retval EFI_NOT_FOUND if the PPI is not in the database\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiLocatePpi (\r
@@ -528,73 +406,54 @@ PeiLocatePpi (
   IN OUT EFI_PEI_PPI_DESCRIPTOR  **PpiDescriptor,\r
   IN OUT VOID                    **Ppi\r
   )\r
-/*++\r
-\r
-Routine Description:\r
+;\r
 \r
-  Locate a given named PPI.\r
+/**\r
 \r
-Arguments:\r
+  Install a notification for a given PPI.\r
 \r
-  PeiServices   - Pointer to the PEI Service Table\r
-  Guid          - Pointer to GUID of the PPI.\r
-  Instance      - Instance Number to discover.\r
-  PpiDescriptor - Pointer to reference the found descriptor. If not NULL,\r
-                returns a pointer to the descriptor (includes flags, etc)\r
-  Ppi           - Pointer to reference the found PPI\r
 \r
-Returns:\r
+  @param PeiServices     - Pointer to the PEI Service Table\r
+  @param NotifyList      - Pointer to list of Descriptors to notify upon.\r
 \r
-  Status -  EFI_SUCCESS   if the PPI is in the database\r
-            EFI_NOT_FOUND if the PPI is not in the database\r
---*/\r
-;\r
+  @retval EFI_SUCCESS           if successful\r
+  @retval EFI_OUT_OF_RESOURCES  if no space in the database\r
+  @retval EFI_INVALID_PARAMETER if not a good decriptor\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiNotifyPpi (\r
   IN CONST EFI_PEI_SERVICES           **PeiServices,\r
   IN CONST EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyList\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Install a notification for a given PPI.\r
-\r
-Arguments:\r
-\r
-  PeiServices - Pointer to the PEI Service Table\r
-  NotifyList  - Pointer to list of Descriptors to notify upon.\r
+;\r
 \r
-Returns:\r
+/**\r
 \r
-  Status - EFI_SUCCESS          if successful\r
-           EFI_OUT_OF_RESOURCES if no space in the database\r
-           EFI_INVALID_PARAMETER if not a good decriptor\r
+  Process the Notify List at dispatch level.\r
 \r
---*/\r
-;\r
+  @param PrivateData  PeiCore's private data structure.\r
 \r
+**/\r
 VOID\r
 ProcessNotifyList (\r
   IN PEI_CORE_INSTANCE  *PrivateData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Process the Notify List at dispatch level.\r
+;\r
 \r
-Arguments:\r
+/**\r
 \r
-  PeiServices - Pointer to the PEI Service Table\r
+  Dispatch notifications.\r
 \r
-Returns:\r
-\r
---*/\r
-;\r
+  @param PrivateData        PeiCore's private data structure\r
+  @param NotifyType         Type of notify to fire.\r
+  @param InstallStartIndex  Install Beginning index.\r
+  @param InstallStopIndex   Install Ending index.\r
+  @param NotifyStartIndex   Notify Beginning index.\r
+  @param NotifyStopIndex    Notify Ending index.\r
 \r
+**/\r
 VOID\r
 DispatchNotify (\r
   IN PEI_CORE_INSTANCE  *PrivateData,\r
@@ -604,178 +463,138 @@ DispatchNotify (
   IN INTN                NotifyStartIndex,\r
   IN INTN                NotifyStopIndex\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Dispatch notifications.\r
-\r
-Arguments:\r
-\r
-  PeiServices         - Pointer to the PEI Service Table\r
-  NotifyType          - Type of notify to fire.\r
-  InstallStartIndex   - Install Beginning index.\r
-  InstallStopIndex    - Install Ending index.\r
-  NotifyStartIndex    - Notify Beginning index.\r
-  NotifyStopIndex    - Notify Ending index.\r
-\r
-Returns:  None\r
-\r
---*/\r
 ;\r
 \r
 //\r
 // Boot mode support functions\r
 //\r
+/**\r
+  This service enables PEIMs to ascertain the present value of the boot mode.\r
+\r
+  @param PeiServices            The PEI core services table.\r
+  @param BootMode               A pointer to contain the value of the boot mode.\r
+\r
+  @retval EFI_SUCCESS           The boot mode was returned successfully.\r
+  @retval EFI_INVALID_PARAMETER BootMode is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiGetBootMode (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
   IN OUT EFI_BOOT_MODE *BootMode\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This service enables PEIMs to ascertain the present value of the boot mode.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices    - The PEI core services table.\r
-  BootMode       - A pointer to contain the value of the boot mode.\r
+/**\r
+  This service enables PEIMs to update the boot mode variable.\r
 \r
-Returns:\r
 \r
-  EFI_SUCCESS           - The boot mode was returned successfully.\r
-  EFI_INVALID_PARAMETER - BootMode is NULL.\r
+  @param PeiServices     - The PEI core services table.\r
+  @param BootMode        - The value of the boot mode to set.\r
 \r
---*/\r
-;\r
+  @return EFI_SUCCESS    - The value was successfully updated\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiSetBootMode (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
   IN EFI_BOOT_MODE     BootMode\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This service enables PEIMs to update the boot mode variable.\r
-\r
-Arguments:\r
-\r
-  PeiServices    - The PEI core services table.\r
-  BootMode       - The value of the boot mode to set.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS    - The value was successfully updated\r
-\r
---*/\r
 ;\r
 \r
 //\r
 // Security support functions\r
 //\r
+/**\r
+\r
+  Initialize the security services.\r
+\r
+\r
+  @param PeiServices     - The PEI core services table.\r
+  @param OldCoreData     - Pointer to the old core data.\r
+                         NULL if being run in non-permament memory mode.\r
+\r
+**/\r
 VOID\r
 InitializeSecurityServices (\r
   IN EFI_PEI_SERVICES  **PeiServices,\r
   IN PEI_CORE_INSTANCE *OldCoreData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the security services.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices - The PEI core services table.\r
-  OldCoreData - Pointer to the old core data.\r
-                NULL if being run in non-permament memory mode.\r
-Returns:\r
+/**\r
+  Verify a Firmware volume\r
 \r
-  None\r
+  @param CurrentFvAddress - Pointer to the current Firmware Volume under consideration\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS             - Firmware Volume is legal\r
+  @retval EFI_SECURITY_VIOLATION  - Firmware Volume fails integrity test\r
 \r
+**/\r
 EFI_STATUS\r
 VerifyFv (\r
   IN EFI_FIRMWARE_VOLUME_HEADER  *CurrentFvAddress\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Provide a callout to the OEM FV verification service.\r
-\r
-Arguments:\r
+;\r
 \r
-  CurrentFvAddress       - Pointer to the FV under investigation.\r
+/**\r
 \r
-Returns:\r
+  Provide a callout to the security verification service.\r
 \r
-  Status - EFI_SUCCESS\r
 \r
---*/\r
-;\r
+  @param PrivateData     PeiCore's private data structure\r
+  @param VolumeHandle    Handle of FV\r
+  @param FileHandle      Handle of PEIM's ffs\r
 \r
+  @retval EFI_SUCCESS              Image is OK\r
+  @retval EFI_SECURITY_VIOLATION   Image is illegal\r
 \r
+**/\r
 EFI_STATUS\r
 VerifyPeim (\r
   IN PEI_CORE_INSTANCE      *PrivateData,\r
   IN EFI_PEI_FV_HANDLE      VolumeHandle,\r
   IN EFI_PEI_FILE_HANDLE    FileHandle\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Provide a callout to the security verification service.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices          - The PEI core services table.\r
-  CurrentPeimAddress   - Pointer to the Firmware File under investigation.\r
+/**\r
 \r
-Returns:\r
+  Gets the pointer to the HOB List.\r
 \r
-  EFI_SUCCESS             - Image is OK\r
-  EFI_SECURITY_VIOLATION  - Image is illegal\r
 \r
---*/\r
-;\r
+  @param PeiServices                   The PEI core services table.\r
+  @param HobList                       Pointer to the HOB List.\r
 \r
+  @retval EFI_SUCCESS                  Get the pointer of HOB List\r
+  @retval EFI_NOT_AVAILABLE_YET        the HOB List is not yet published\r
+  @retval EFI_INVALID_PARAMETER        HobList is NULL (in debug mode)\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiGetHobList (\r
   IN CONST EFI_PEI_SERVICES  **PeiServices,\r
   IN OUT VOID          **HobList\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Gets the pointer to the HOB List.\r
-\r
-Arguments:\r
-\r
-  PeiServices - The PEI core services table.\r
-  HobList     - Pointer to the HOB List.\r
+;\r
 \r
-Returns:\r
+/**\r
+  Add a new HOB to the HOB List.\r
 \r
-  EFI_SUCCESS                 - Get the pointer of HOB List\r
-  EFI_NOT_AVAILABLE_YET       - the HOB List is not yet published\r
-  EFI_INVALID_PARAMETER       - HobList is NULL (in debug mode)\r
+  @param PeiServices     - The PEI core services table.\r
+  @param Type            - Type of the new HOB.\r
+  @param Length          - Length of the new HOB to allocate.\r
+  @param Hob             - Pointer to the new HOB.\r
 \r
---*/\r
-;\r
+  @return  EFI_SUCCESS           Success to create hob.\r
+  @retval  EFI_INVALID_PARAMETER if Hob is NULL\r
+  @retval  EFI_NOT_AVAILABLE_YET if HobList is still not available.\r
+  @retval  EFI_OUT_OF_RESOURCES  if there is no more memory to grow the Hoblist.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiCreateHob (\r
@@ -784,58 +603,47 @@ PeiCreateHob (
   IN UINT16            Length,\r
   IN OUT VOID          **Hob\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add a new HOB to the HOB List.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices - The PEI core services table.\r
-  Type        - Type of the new HOB.\r
-  Length      - Length of the new HOB to allocate.\r
-  Hob         - Pointer to the new HOB.\r
+/**\r
 \r
-Returns:\r
+  Builds a Handoff Information Table HOB\r
 \r
-  Status  - EFI_SUCCESS\r
-          - EFI_INVALID_PARAMETER if Hob is NULL\r
-          - EFI_NOT_AVAILABLE_YET if HobList is still not available.\r
-          - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.\r
+  @param BootMode        - Current Bootmode\r
+  @param MemoryBegin     - Start Memory Address.\r
+  @param MemoryLength    - Length of Memory.\r
 \r
---*/\r
-;\r
+  @return EFI_SUCCESS Always success to initialize HOB.\r
 \r
+**/\r
 EFI_STATUS\r
 PeiCoreBuildHobHandoffInfoTable (\r
   IN EFI_BOOT_MODE         BootMode,\r
   IN EFI_PHYSICAL_ADDRESS  MemoryBegin,\r
   IN UINT64                MemoryLength\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Builds a Handoff Information Table HOB\r
-\r
-Arguments:\r
-\r
-  BootMode      - Current Bootmode\r
-  MemoryBegin   - Start Memory Address.\r
-  MemoryLength  - Length of Memory.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-\r
---*/\r
 ;\r
 \r
 \r
 //\r
 // FFS Fw Volume support functions\r
 //\r
+/**\r
+  Given the input file pointer, search for the next matching file in the\r
+  FFS volume as defined by SearchType. The search starts from FileHeader inside\r
+  the Firmware Volume defined by FwVolHeader.\r
+\r
+\r
+  @param PeiServices     Pointer to the PEI Core Services Table.\r
+  @param SearchType      Filter to find only files of this type.\r
+                         Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
+  @param VolumeHandle    Pointer to the FV header of the volume to search.\r
+  @param FileHandle      Pointer to the current file from which to begin searching.\r
+                         This pointer will be updated upon return to reflect the file found.\r
+  @retval EFI_NOT_FOUND  No files matching the search criteria were found\r
+  @retval EFI_SUCCESS    Success to find next file in given volume\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiFfsFindNextFile (\r
@@ -844,32 +652,23 @@ PeiFfsFindNextFile (
   IN EFI_PEI_FV_HANDLE           FwVolHeader,\r
   IN OUT EFI_PEI_FILE_HANDLE     *FileHeader\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching file in the\r
-    FFS volume as defined by SearchType. The search starts from FileHeader inside\r
-    the Firmware Volume defined by FwVolHeader.\r
-\r
-Arguments:\r
-    PeiServices - Pointer to the PEI Core Services Table.\r
+;\r
 \r
-    SearchType - Filter to find only files of this type.\r
-      Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
+/**\r
+  Given the input file pointer, search for the next matching section in the\r
+  FFS volume.\r
 \r
-    FwVolHeader - Pointer to the FV header of the volume to search.\r
-      This parameter must point to a valid FFS volume.\r
 \r
-    FileHeader  - Pointer to the current file from which to begin searching.\r
-      This pointer will be updated upon return to reflect the file found.\r
+  @param PeiServices     Pointer to the PEI Core Services Table.\r
+  @param SectionType     Filter to find only sections of this type.\r
+  @param FileHandle      Pointer to the current file to search.\r
+  @param SectionData     Pointer to the Section matching SectionType in FfsFileHeader.\r
+                         NULL if section not found\r
 \r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
-;\r
+  @retval EFI_NOT_FOUND  No files matching the search criteria were found\r
+  @retval EFI_SUCCESS    Success to find section data in given file\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiFfsFindSectionData (\r
@@ -878,26 +677,19 @@ PeiFfsFindSectionData (
   IN EFI_PEI_FILE_HANDLE         FfsFileHeader,\r
   IN OUT VOID                    **SectionData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching section in the\r
-    FFS volume.\r
+;\r
 \r
-Arguments:\r
-    PeiServices - Pointer to the PEI Core Services Table.\r
-    SearchType - Filter to find only sections of this type.\r
-    FfsFileHeader  - Pointer to the current file to search.\r
-    SectionData - Pointer to the Section matching SectionType in FfsFileHeader.\r
-                - NULL if section not found\r
+/**\r
+  search the firmware volumes by index\r
 \r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
+  @param PeiServices     The PEI core services table.\r
+  @param Instance        Instance of FV to find\r
+  @param VolumeHandle    Pointer to found Volume.\r
 \r
---*/\r
-;\r
+  @retval EFI_INVALID_PARAMETER  FwVolHeader is NULL\r
+  @retval EFI_SUCCESS            Firmware volume instance successfully found.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiFvFindNextVolume (\r
@@ -905,61 +697,44 @@ PeiFvFindNextVolume (
   IN UINTN                           Instance,\r
   IN OUT EFI_PEI_FV_HANDLE           *FwVolHeader\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Return the BFV location\r
-\r
-  BugBug -- Move this to the location of this code to where the\r
-  other FV and FFS support code lives.\r
-  Also, update to use FindFV for instances #'s >= 1.\r
-\r
-Arguments:\r
-\r
-  PeiServices - The PEI core services table.\r
-  Instance    - Instance of FV to find\r
-  FwVolHeader - Pointer to contain the data to return\r
-\r
-Returns:\r
-  Pointer to the Firmware Volume instance requested\r
-\r
-  EFI_INVALID_PARAMETER     - FwVolHeader is NULL\r
-\r
-  EFI_SUCCESS               - Firmware volume instance successfully found.\r
-\r
---*/\r
 ;\r
 \r
 //\r
 // Memory support functions\r
 //\r
+/**\r
+\r
+  Initialize the memory services.\r
+\r
+\r
+  @param PrivateData     Add parameter description\r
+  @param SecCoreData     Points to a data structure containing information about the PEI core's operating\r
+                         environment, such as the size and location of temporary RAM, the stack location and\r
+                         the BFV location.\r
+  @param OldCoreData     Pointer to the PEI Core data.\r
+                         NULL if being run in non-permament memory mode.\r
+\r
+**/\r
 VOID\r
 InitializeMemoryServices (\r
   IN PEI_CORE_INSTANCE           *PrivateData,\r
   IN CONST EFI_SEC_PEI_HAND_OFF  *SecCoreData,\r
   IN PEI_CORE_INSTANCE           *OldCoreData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the memory services.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices          - The PEI core services table.\r
-  PeiStartupDescriptor - Information and services provided by SEC phase.\r
-  OldCoreData          - Pointer to the PEI Core data.\r
-                         NULL if being run in non-permament memory mode.\r
+/**\r
 \r
-Returns:\r
+  Install the permanent memory is now available.\r
+  Creates HOB (PHIT and Stack).\r
 \r
-  None\r
+  @param PeiServices     - The PEI core services table.\r
+  @param MemoryBegin     - Start of memory address.\r
+  @param MemoryLength    - Length of memory.\r
 \r
---*/\r
-;\r
+  @return EFI_SUCCESS Always success.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiInstallPeiMemory (\r
@@ -967,26 +742,26 @@ PeiInstallPeiMemory (
   IN EFI_PHYSICAL_ADDRESS  MemoryBegin,\r
   IN UINT64                MemoryLength\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Install the permanent memory is now available.\r
-  Creates HOB (PHIT and Stack).\r
+;\r
 \r
-Arguments:\r
+/**\r
 \r
-  PeiServices   - The PEI core services table.\r
-  MemoryBegin   - Start of memory address.\r
-  MemoryLength  - Length of memory.\r
+  Memory allocation service on permanent memory,\r
+  not usable prior to the memory installation.\r
 \r
-Returns:\r
 \r
-  Status  - EFI_SUCCESS\r
+  @param PeiServices     - The PEI core services table.\r
+  @param MemoryType      - Type of memory to allocate.\r
+  @param Pages           - Number of pages to allocate.\r
+  @param Memory          - Pointer of memory allocated.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS              The allocation was successful\r
+  @retval EFI_INVALID_PARAMETER    Only AllocateAnyAddress is supported.\r
+  @retval EFI_NOT_AVAILABLE_YET    Called with permanent memory not available\r
+  @retval EFI_OUT_OF_RESOURCES     There is not enough HOB heap to satisfy the requirement\r
+                                   to allocate the number of pages.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiAllocatePages (\r
@@ -995,32 +770,22 @@ PeiAllocatePages (
   IN UINTN                      Pages,\r
   OUT EFI_PHYSICAL_ADDRESS      *Memory\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Memory allocation service on permanent memory,\r
-  not usable prior to the memory installation.\r
+;\r
 \r
-Arguments:\r
+/**\r
 \r
-  PeiServices - The PEI core services table.\r
-  Type        - Type of allocation.\r
-  MemoryType  - Type of memory to allocate.\r
-  Pages       - Number of pages to allocate.\r
-  Memory      - Pointer of memory allocated.\r
+  Memory allocation service on the CAR.\r
 \r
-Returns:\r
 \r
-  Status - EFI_SUCCESS              The allocation was successful\r
-           EFI_INVALID_PARAMETER    Only AllocateAnyAddress is supported.\r
-           EFI_NOT_AVAILABLE_YET    Called with permanent memory not available\r
-           EFI_OUT_OF_RESOURCES     There is not enough HOB heap to satisfy the requirement\r
-                                    to allocate the number of pages.\r
+  @param PeiServices     - The PEI core services table.\r
+  @param Size            - Amount of memory required\r
+  @param Buffer          - Address of pointer to the buffer\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS              The allocation was successful\r
+  @retval EFI_OUT_OF_RESOURCES     There is not enough heap to satisfy the requirement\r
+                                   to allocate the requested size.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiAllocatePool (\r
@@ -1028,29 +793,23 @@ PeiAllocatePool (
   IN UINTN                      Size,\r
   OUT VOID                      **Buffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Memory allocation service on the CAR.\r
-\r
-Arguments:\r
-\r
-  PeiServices - The PEI core services table.\r
+;\r
 \r
-  Size        - Amount of memory required\r
+/**\r
 \r
-  Buffer      - Address of pointer to the buffer\r
+  Routine for load image file.\r
 \r
-Returns:\r
 \r
-  Status - EFI_SUCCESS              The allocation was successful\r
-           EFI_OUT_OF_RESOURCES     There is not enough heap to satisfy the requirement\r
-                                    to allocate the requested size.\r
+  @param PeiServices     - The PEI core services table.\r
+  @param FileHandle      - Pointer to the FFS file header of the image.\r
+  @param EntryPoint      - Pointer to entry point of specified image file for output.\r
+  @param AuthenticationState - Pointer to attestation authentication state of image.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS    - Image is successfully loaded.\r
+  @retval EFI_NOT_FOUND  - Fail to locate necessary PPI\r
+  @retval Others         - Fail to load file.\r
 \r
+**/\r
 EFI_STATUS\r
 PeiLoadImage (\r
   IN  EFI_PEI_SERVICES            **PeiServices,\r
@@ -1058,28 +817,24 @@ PeiLoadImage (
   OUT    EFI_PHYSICAL_ADDRESS     *EntryPoint,\r
   OUT    UINT32                   *AuthenticationState\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get entry point of a Peim file.\r
-\r
-Arguments:\r
-\r
-  PeiServices                 - Calling context.\r
-\r
-  PeimFileHeader              - Peim file's header.\r
+;\r
 \r
-  EntryPoint                  - Entry point of that Peim file.\r
+/**\r
 \r
-Returns:\r
+  Core version of the Status Code reporter\r
 \r
-  Status code.\r
 \r
---*/\r
-;\r
+  @param PeiServices     The PEI core services table.\r
+  @param CodeType        Type of Status Code.\r
+  @param Value           Value to output for Status Code.\r
+  @param Instance        Instance Number of this status code.\r
+  @param CallerId        ID of the caller of this status code.\r
+  @param Data            Optional data associated with this status code.\r
 \r
+  @retval EFI_SUCCESS             if status code is successfully reported\r
+  @retval EFI_NOT_AVAILABLE_YET   if StatusCodePpi has not been installed\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiReportStatusCode (\r
@@ -1090,81 +845,56 @@ PeiReportStatusCode (
   IN CONST EFI_GUID                 *CallerId,\r
   IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Core version of the Status Code reporter\r
-\r
-Arguments:\r
-\r
-  PeiServices - The PEI core services table.\r
-\r
-  CodeType    - Type of Status Code.\r
-\r
-  Value       - Value to output for Status Code.\r
-\r
-  Instance    - Instance Number of this status code.\r
-\r
-  CallerId    - ID of the caller of this status code.\r
+;\r
 \r
-  Data        - Optional data associated with this status code.\r
+/**\r
 \r
-Returns:\r
+  Core version of the Reset System\r
 \r
-  Status  - EFI_SUCCESS             if status code is successfully reported\r
-          - EFI_NOT_AVAILABLE_YET   if StatusCodePpi has not been installed\r
 \r
---*/\r
-;\r
+  @param PeiServices     - The PEI core services table.\r
 \r
+  @retval EFI_NOT_AVAILABLE_YET     PPI not available yet.\r
+  @retval EFI_DEVICE_ERROR          Did not reset system.\r
+                                    Otherwise, resets the system.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiResetSystem (\r
   IN CONST EFI_PEI_SERVICES   **PeiServices\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Core version of the Reset System\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices - The PEI core services table.\r
+/**\r
 \r
-Returns:\r
+  Initialize PeiCore Fv List.\r
 \r
-  Status  - EFI_NOT_AVAILABLE_YET. PPI not available yet.\r
-          - EFI_DEVICE_ERROR.   Did not reset system.\r
 \r
-  Otherwise, resets the system.\r
+  @param PrivateData     - Pointer to PEI_CORE_INSTANCE.\r
+  @param SecCoreData     - Pointer to EFI_SEC_PEI_HAND_OFF.\r
 \r
---*/\r
-;\r
+  @return NONE\r
 \r
+**/\r
 VOID\r
 PeiInitializeFv (\r
   IN  PEI_CORE_INSTANCE           *PrivateData,\r
   IN CONST EFI_SEC_PEI_HAND_OFF   *SecCoreData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
+;\r
 \r
-  Initialize PeiCore Fv List.\r
+/**\r
+  Process Firmware Volum Information once FvInfoPPI install.\r
 \r
-Arguments:\r
-  PrivateData     - Pointer to PEI_CORE_INSTANCE.\r
-  SecCoreData     - Pointer to EFI_SEC_PEI_HAND_OFF.\r
 \r
-Returns:\r
-  NONE\r
+  @param PeiServices     - General purpose services available to every PEIM.\r
+  @param NotifyDescriptor EDES_TODO: Add parameter description\r
+  @param Ppi             EDES_TODO: Add parameter description\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS if the interface could be successfully installed\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 FirmwareVolmeInfoPpiNotifyCallback (\r
@@ -1172,25 +902,21 @@ FirmwareVolmeInfoPpiNotifyCallback (
   IN EFI_PEI_NOTIFY_DESCRIPTOR     *NotifyDescriptor,\r
   IN VOID                          *Ppi\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Process Firmware Volum Information once FvInfoPPI install.\r
-\r
-Arguments:\r
+;\r
 \r
-  PeiServices - General purpose services available to every PEIM.\r
+/**\r
 \r
-Returns:\r
+  Given the input VolumeHandle, search for the next matching name file.\r
 \r
-  Status -  EFI_SUCCESS if the interface could be successfully\r
-            installed\r
 \r
---*/\r
-;\r
+  @param FileName        - File name to search.\r
+  @param VolumeHandle    - The current FV to search.\r
+  @param FileHandle      - Pointer to the file matching name in VolumeHandle.\r
+                         - NULL if file not found\r
 \r
+  @return EFI_STATUS\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiFfsFindFileByName (\r
@@ -1198,103 +924,55 @@ PeiFfsFindFileByName (
   IN  EFI_PEI_FV_HANDLE     VolumeHandle,\r
   OUT EFI_PEI_FILE_HANDLE   *FileHandle\r
   )\r
-/*++\r
+;\r
 \r
-Routine Description:\r
+/**\r
 \r
-  Given the input VolumeHandle, search for the next matching name file.\r
+  Returns information about a specific file.\r
 \r
-Arguments:\r
 \r
-  FileName      - File name to search.\r
-  VolumeHandle  - The current FV to search.\r
-  FileHandle    - Pointer to the file matching name in VolumeHandle.\r
-                - NULL if file not found\r
-Returns:\r
-  EFI_STATUS\r
-\r
---*/\r
-;\r
+  @param FileHandle      - The handle to file.\r
+  @param FileInfo        - Pointer to the file information.\r
 \r
+  @retval EFI_INVALID_PARAMETER Invalid FileHandle or FileInfo.\r
+  @retval EFI_SUCCESS           Success to collect file info.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiFfsGetFileInfo (\r
   IN EFI_PEI_FILE_HANDLE  FileHandle,\r
   OUT EFI_FV_FILE_INFO    *FileInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
+;\r
 \r
-  Collect information of given file.\r
+/**\r
 \r
-Arguments:\r
-  FileHandle   - The handle to file.\r
-  FileInfo     - Pointer to the file information.\r
+  Collect information of given Fv Volume.\r
 \r
-Returns:\r
-  EFI_STATUS\r
-\r
---*/\r
-;\r
+  @param VolumeHandle    - The handle to Fv Volume.\r
+  @param VolumeInfo      - The pointer to volume information.\r
 \r
+  @retval EFI_INVALID_PARAMETER VolumeInfo is NULL\r
+  @retval EFI_SUCCESS           Success to collect fv info.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiFfsGetVolumeInfo (\r
   IN EFI_PEI_FV_HANDLE  VolumeHandle,\r
   OUT EFI_FV_INFO       *VolumeInfo\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Collect information of given Fv Volume.\r
-\r
-Arguments:\r
-  VolumeHandle    - The handle to Fv Volume.\r
-  VolumeInfo      - The pointer to volume information.\r
-\r
-Returns:\r
-  EFI_STATUS\r
-\r
---*/\r
-;\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeiRegisterForShadow (\r
-  IN EFI_PEI_FILE_HANDLE       FileHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine enable a PEIM to register itself to shadow when PEI Foundation\r
-  discovery permanent memory.\r
-\r
-Arguments:\r
-  FileHandle  - File handle of a PEIM.\r
-\r
-Returns:\r
-  EFI_NOT_FOUND        - The file handle doesn't point to PEIM itself.\r
-  EFI_ALREADY_STARTED  - Indicate that the PEIM has been registered itself.\r
-  EFI_SUCCESS          - Successfully to register itself.\r
-\r
---*/\r
 ;\r
 \r
-\r
 /**\r
   This routine enable a PEIM to register itself to shadow when PEI Foundation\r
   discovery permanent memory.\r
 \r
-       @param FileHandle       File handle of a PEIM.\r
+  @param FileHandle             File handle of a PEIM.\r
 \r
-  @retval EFI_NOT_FOUND                                The file handle doesn't point to PEIM itself.\r
-  @retval EFI_ALREADY_STARTED          Indicate that the PEIM has been registered itself.\r
-  @retval EFI_SUCCESS                                          Successfully to register itself.\r
+  @retval EFI_NOT_FOUND         The file handle doesn't point to PEIM itself.\r
+  @retval EFI_ALREADY_STARTED   Indicate that the PEIM has been registered itself.\r
+  @retval EFI_SUCCESS           Successfully to register itself.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1304,6 +982,23 @@ PeiRegisterForShadow (
   )\r
 ;\r
 \r
+/**\r
+  Given the input file pointer, search for the next matching file in the\r
+  FFS volume as defined by SearchType. The search starts from FileHeader inside\r
+  the Firmware Volume defined by FwVolHeader.\r
+\r
+\r
+  @param FvHandle        Pointer to the FV header of the volume to search\r
+  @param FileName        File name\r
+  @param SearchType      Filter to find only files of this type.\r
+                         Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
+  @param FileHandle      This parameter must point to a valid FFS volume.\r
+  @param AprioriFile     Pointer to AprioriFile image in this FV if has\r
+\r
+  @return EFI_NOT_FOUND  No files matching the search criteria were found\r
+  @retval EFI_SUCCESS    Success to search given file\r
+\r
+**/\r
 EFI_STATUS\r
 PeiFindFileEx (\r
   IN  CONST EFI_PEI_FV_HANDLE        FvHandle,\r
@@ -1312,63 +1007,34 @@ PeiFindFileEx (
   IN OUT    EFI_PEI_FILE_HANDLE      *FileHandle,\r
   IN OUT    EFI_PEI_FV_HANDLE        *AprioriFile  OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching file in the\r
-    FFS volume as defined by SearchType. The search starts from FileHeader inside\r
-    the Firmware Volume defined by FwVolHeader.\r
-\r
-Arguments:\r
-    PeiServices - Pointer to the PEI Core Services Table.\r
-    SearchType - Filter to find only files of this type.\r
-      Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
-    FwVolHeader - Pointer to the FV header of the volume to search.\r
-      This parameter must point to a valid FFS volume.\r
-    FileHeader  - Pointer to the current file from which to begin searching.\r
-      This pointer will be updated upon return to reflect the file found.\r
-    Flag        - Indicator for if this is for PEI Dispath search\r
-\r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
 ;\r
 \r
-VOID\r
-InitializeImageServices (\r
-  IN  PEI_CORE_INSTANCE   *PrivateData,\r
-  IN  PEI_CORE_INSTANCE   *OldCoreData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Install Pei Load File PPI.\r
 \r
-Arguments:\r
-\r
-  PrivateData    - Pointer to PEI_CORE_INSTANCE.\r
-  OldCoreData    - Pointer to PEI_CORE_INSTANCE.\r
 \r
-Returns:\r
+  @param PrivateData     - Pointer to PEI_CORE_INSTANCE.\r
+  @param OldCoreData     - Pointer to PEI_CORE_INSTANCE.\r
 \r
-  NONE.\r
-\r
---*/\r
+**/\r
+VOID\r
+InitializeImageServices (\r
+  IN  PEI_CORE_INSTANCE   *PrivateData,\r
+  IN  PEI_CORE_INSTANCE   *OldCoreData\r
+  )\r
 ;\r
 \r
 /**\r
   Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
 \r
-       @param PeiServices          Pointer to the PEI Core Services Table.\r
-       @param FileHandle               File handle of a Fv type file.\r
+  @param PeiServices          Pointer to the PEI Core Services Table.\r
+  @param FileHandle           File handle of a Fv type file.\r
   @param AuthenticationState  Pointer to attestation authentication state of image.\r
 \r
 \r
-  @retval EFI_NOT_FOUND                                FV image can't be found.\r
-  @retval EFI_SUCCESS                                          Successfully to process it.\r
+  @retval EFI_NOT_FOUND       FV image can't be found.\r
+  @retval EFI_SUCCESS         Successfully to process it.\r
 \r
 **/\r
 EFI_STATUS\r