]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Image/Image.c
Add doxygen style comments for functions in DxeMain.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Image / Image.c
index 95528b89961e2808a20f9e1c98bb181fd878c384..7c66f07d760dc4f56f2b0c9797504b75a9d08e12 100644 (file)
@@ -72,26 +72,20 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage  = {
 };\r
 \r
 \r
-EFI_STATUS\r
-CoreInitializeImageServices (\r
-  IN  VOID *HobStart\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Add the Image Services to EFI Boot Services Table and install the protocol\r
   interfaces for this image.\r
 \r
-Arguments:\r
+  @param  HobStart                The HOB to initialize \r
 \r
-  HobStart        - The HOB to initialize\r
+  @return Status code.\r
 \r
-Returns:\r
-\r
-  Status code.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+CoreInitializeImageServices (\r
+  IN  VOID *HobStart\r
+  )\r
 {\r
   EFI_STATUS                        Status;\r
   LOADED_IMAGE_PRIVATE_DATA         *Image;\r
@@ -161,6 +155,28 @@ Returns:
            );\r
 }\r
 \r
+\r
+/**\r
+  Loads, relocates, and invokes a PE/COFF image\r
+\r
+  @param  BootPolicy              If TRUE, indicates that the request originates \r
+                                  from the boot manager, and that the boot \r
+                                  manager is attempting to load FilePath as a \r
+                                  boot selection. \r
+  @param  Pe32Handle              The handle of PE32 image \r
+  @param  Image                   PE image to be loaded \r
+  @param  DstBuffer               The buffer to store the image \r
+  @param  EntryPoint              A pointer to the entry point \r
+  @param  Attribute               The bit mask of attributes to set for the load \r
+                                  PE image \r
+\r
+  @retval EFI_SUCCESS             The file was loaded, relocated, and invoked \r
+  @retval EFI_OUT_OF_RESOURCES    There was not enough memory to load and \r
+                                  relocate the PE/COFF file \r
+  @retval EFI_INVALID_PARAMETER   Invalid parameter \r
+  @retval EFI_BUFFER_TOO_SMALL    Buffer for image is too small\r
+\r
+**/\r
 EFI_STATUS\r
 CoreLoadPeImage (\r
   IN BOOLEAN                     BootPolicy,  \r
@@ -170,32 +186,6 @@ CoreLoadPeImage (
   OUT EFI_PHYSICAL_ADDRESS       *EntryPoint  OPTIONAL,\r
   IN  UINT32                     Attribute\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads, relocates, and invokes a PE/COFF image\r
-\r
-Arguments:\r
-  BootPolicy       - If TRUE, indicates that the request originates from the boot manager,\r
-                     and that the boot manager is attempting to load FilePath as a boot selection.\r
-  Pe32Handle       - The handle of PE32 image\r
-  Image            - PE image to be loaded\r
-  DstBuffer        - The buffer to store the image\r
-  EntryPoint       - A pointer to the entry point\r
-  Attribute        - The bit mask of attributes to set for the load PE image\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS          - The file was loaded, relocated, and invoked\r
-\r
-  EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file\r
-\r
-  EFI_INVALID_PARAMETER - Invalid parameter\r
-\r
-  EFI_BUFFER_TOO_SMALL  - Buffer for image is too small\r
-\r
---*/\r
 {\r
   EFI_STATUS                Status;\r
   BOOLEAN                   DstBufAlocated;\r
@@ -477,7 +467,7 @@ Returns:
     CHAR8 EfiFileName[256];\r
     \r
     if (Image->ImageContext.Machine != IMAGE_FILE_MACHINE_IA64) {\r
-      DEBUG ((EFI_D_INFO | EFI_D_LOAD, \r
+      DEBUG ((DEBUG_INFO | DEBUG_LOAD, \r
               "Loading driver at 0x%10p EntryPoint=0x%10p ", \r
               (VOID *)(UINTN)Image->ImageContext.ImageAddress, \r
               (VOID *)(UINTN)Image->ImageContext.EntryPoint));\r
@@ -485,7 +475,7 @@ Returns:
       //\r
       // For IPF Image, the real entry point should be print.\r
       //      \r
-      DEBUG ((EFI_D_INFO | EFI_D_LOAD, \r
+      DEBUG ((DEBUG_INFO | DEBUG_LOAD, \r
               "Loading driver at 0x%10p EntryPoint=0x%10p ", \r
               (VOID *)(UINTN)Image->ImageContext.ImageAddress, \r
               (VOID *)(UINTN)(*(UINT64 *)(UINTN)Image->ImageContext.EntryPoint)));\r
@@ -517,9 +507,9 @@ Returns:
           break;\r
         }\r
       }\r
-      DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a", EfiFileName)); // &Image->ImageContext.PdbPointer[StartIndex]));\r
+      DEBUG ((DEBUG_INFO | DEBUG_LOAD, "%a", EfiFileName)); // &Image->ImageContext.PdbPointer[StartIndex]));\r
     }\r
-    DEBUG ((EFI_D_INFO | EFI_D_LOAD, "\n"));\r
+    DEBUG ((DEBUG_INFO | DEBUG_LOAD, "\n"));\r
 \r
   DEBUG_CODE_END ();\r
 \r
@@ -543,25 +533,19 @@ Done:
 }\r
 \r
 \r
-LOADED_IMAGE_PRIVATE_DATA *\r
-CoreLoadedImageInfo (\r
-  IN EFI_HANDLE  ImageHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Get the image's private data from its handle.\r
 \r
-Arguments:\r
+  @param  ImageHandle             The image handle \r
 \r
-  ImageHandle     - The image handle\r
+  @return Return the image private data associated with ImageHandle.\r
 \r
-Returns:\r
-\r
-  Return the image private data associated with ImageHandle.\r
-\r
---*/\r
+**/\r
+LOADED_IMAGE_PRIVATE_DATA *\r
+CoreLoadedImageInfo (\r
+  IN EFI_HANDLE  ImageHandle\r
+  )\r
 {\r
   EFI_STATUS                 Status;\r
   EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;\r
@@ -575,13 +559,50 @@ Returns:
   if (!EFI_ERROR (Status)) {\r
     Image = LOADED_IMAGE_PRIVATE_DATA_FROM_THIS (LoadedImage);\r
   } else {\r
-    DEBUG ((EFI_D_LOAD, "CoreLoadedImageInfo: Not an ImageHandle %x\n", ImageHandle));\r
+    DEBUG ((DEBUG_LOAD, "CoreLoadedImageInfo: Not an ImageHandle %x\n", ImageHandle));\r
     Image = NULL;\r
   }\r
 \r
   return Image;\r
 }\r
 \r
+\r
+/**\r
+  Loads an EFI image into memory and returns a handle to the image.\r
+\r
+  @param  BootPolicy              If TRUE, indicates that the request originates \r
+                                  from the boot manager, and that the boot \r
+                                  manager is attempting to load FilePath as a \r
+                                  boot selection. \r
+  @param  ParentImageHandle       The caller's image handle. \r
+  @param  FilePath                The specific file path from which the image is \r
+                                  loaded. \r
+  @param  SourceBuffer            If not NULL, a pointer to the memory location \r
+                                  containing a copy of the image to be loaded. \r
+  @param  SourceSize              The size in bytes of SourceBuffer. \r
+  @param  DstBuffer               The buffer to store the image \r
+  @param  NumberOfPages           If not NULL, it inputs a pointer to the page \r
+                                  number of DstBuffer and outputs a pointer to \r
+                                  the page number of the image. If this number is \r
+                                  not enough,  return EFI_BUFFER_TOO_SMALL and \r
+                                  this parameter contains the required number. \r
+  @param  ImageHandle             Pointer to the returned image handle that is \r
+                                  created when the image is successfully loaded. \r
+  @param  EntryPoint              A pointer to the entry point \r
+  @param  Attribute               The bit mask of attributes to set for the load \r
+                                  PE image \r
+\r
+  @retval EFI_SUCCESS             The image was loaded into memory. \r
+  @retval EFI_NOT_FOUND           The FilePath was not found. \r
+  @retval EFI_INVALID_PARAMETER   One of the parameters has an invalid value. \r
+  @retval EFI_BUFFER_TOO_SMALL    The buffer is too small \r
+  @retval EFI_UNSUPPORTED         The image type is not supported, or the device \r
+                                  path cannot be parsed to locate the proper \r
+                                  protocol for loading the file. \r
+  @retval EFI_OUT_OF_RESOURCES    Image was not loaded due to insufficient \r
+                                  resources.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 CoreLoadImageCommon (\r
@@ -596,40 +617,6 @@ CoreLoadImageCommon (
   OUT EFI_PHYSICAL_ADDRESS             *EntryPoint         OPTIONAL,\r
   IN  UINT32                           Attribute\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads an EFI image into memory and returns a handle to the image.\r
-\r
-Arguments:\r
-\r
-  BootPolicy          - If TRUE, indicates that the request originates from the boot manager,\r
-                        and that the boot manager is attempting to load FilePath as a boot selection.\r
-  ParentImageHandle   - The caller's image handle.\r
-  FilePath            - The specific file path from which the image is loaded.\r
-  SourceBuffer        - If not NULL, a pointer to the memory location containing a copy of\r
-                        the image to be loaded.\r
-  SourceSize          - The size in bytes of SourceBuffer.\r
-  DstBuffer           - The buffer to store the image\r
-  NumberOfPages       - If not NULL, it inputs a pointer to the page number of DstBuffer and outputs\r
-                        a pointer to the page number of the image. If this number is not enough, \r
-                        return EFI_BUFFER_TOO_SMALL and this parameter contains the required number.\r
-  ImageHandle         - Pointer to the returned image handle that is created when the image\r
-                        is successfully loaded.\r
-  EntryPoint          - A pointer to the entry point\r
-  Attribute           - The bit mask of attributes to set for the load PE image\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS            - The image was loaded into memory.\r
-  EFI_NOT_FOUND          - The FilePath was not found.\r
-  EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.\r
-  EFI_BUFFER_TOO_SMALL   - The buffer is too small\r
-  EFI_UNSUPPORTED        - The image type is not supported, or the device path cannot be\r
-                           parsed to locate the proper protocol for loading the file.\r
-  EFI_OUT_OF_RESOURCES   - Image was not loaded due to insufficient resources.\r
---*/\r
 {\r
   LOADED_IMAGE_PRIVATE_DATA  *Image;\r
   LOADED_IMAGE_PRIVATE_DATA  *ParentImage;\r
@@ -656,7 +643,7 @@ Returns:
 \r
   ParentImage = CoreLoadedImageInfo (ParentImageHandle);\r
   if (ParentImage == NULL) {\r
-    DEBUG((EFI_D_LOAD|EFI_D_ERROR, "LoadImageEx: Parent handle not an image handle\n"));\r
+    DEBUG((DEBUG_LOAD|DEBUG_ERROR, "LoadImageEx: Parent handle not an image handle\n"));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -721,7 +708,7 @@ Returns:
   Image->Signature         = LOADED_IMAGE_PRIVATE_DATA_SIGNATURE;\r
   Image->Info.SystemTable  = gDxeCoreST;\r
   Image->Info.DeviceHandle = DeviceHandle;\r
-  Image->Info.Revision     = EFI_LOADED_IMAGE_INFORMATION_REVISION;\r
+  Image->Info.Revision     = EFI_LOADED_IMAGE_PROTOCOL_REVISION;\r
   Image->Info.FilePath     = CoreDuplicateDevicePath (FilePath);\r
   Image->Info.ParentHandle = ParentImageHandle;\r
 \r
@@ -836,6 +823,33 @@ Done:
 \r
 \r
 \r
+\r
+/**\r
+  Loads an EFI image into memory and returns a handle to the image.\r
+\r
+  @param  BootPolicy              If TRUE, indicates that the request originates \r
+                                  from the boot manager, and that the boot \r
+                                  manager is attempting to load FilePath as a \r
+                                  boot selection. \r
+  @param  ParentImageHandle       The caller's image handle. \r
+  @param  FilePath                The specific file path from which the image is \r
+                                  loaded. \r
+  @param  SourceBuffer            If not NULL, a pointer to the memory location \r
+                                  containing a copy of the image to be loaded. \r
+  @param  SourceSize              The size in bytes of SourceBuffer. \r
+  @param  ImageHandle             Pointer to the returned image handle that is \r
+                                  created when the image is successfully loaded. \r
+\r
+  @retval EFI_SUCCESS             The image was loaded into memory. \r
+  @retval EFI_NOT_FOUND           The FilePath was not found. \r
+  @retval EFI_INVALID_PARAMETER   One of the parameters has an invalid value. \r
+  @retval EFI_UNSUPPORTED         The image type is not supported, or the device \r
+                                  path cannot be parsed to locate the proper \r
+                                  protocol for loading the file. \r
+  @retval EFI_OUT_OF_RESOURCES    Image was not loaded due to insufficient \r
+                                  resources.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreLoadImage (\r
@@ -846,33 +860,6 @@ CoreLoadImage (
   IN UINTN                      SourceSize,\r
   OUT EFI_HANDLE                *ImageHandle\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads an EFI image into memory and returns a handle to the image.\r
-\r
-Arguments:\r
-\r
-  BootPolicy          - If TRUE, indicates that the request originates from the boot manager,\r
-                        and that the boot manager is attempting to load FilePath as a boot selection.\r
-  ParentImageHandle   - The caller's image handle.\r
-  FilePath            - The specific file path from which the image is loaded.\r
-  SourceBuffer        - If not NULL, a pointer to the memory location containing a copy of\r
-                        the image to be loaded.\r
-  SourceSize          - The size in bytes of SourceBuffer.\r
-  ImageHandle         - Pointer to the returned image handle that is created when the image\r
-                        is successfully loaded.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS            - The image was loaded into memory.\r
-  EFI_NOT_FOUND          - The FilePath was not found.\r
-  EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.\r
-  EFI_UNSUPPORTED        - The image type is not supported, or the device path cannot be\r
-                           parsed to locate the proper protocol for loading the file.\r
-  EFI_OUT_OF_RESOURCES   - Image was not loaded due to insufficient resources.\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
 \r
@@ -897,6 +884,36 @@ Returns:
 }\r
 \r
 \r
+\r
+/**\r
+  Loads an EFI image into memory and returns a handle to the image with extended parameters.\r
+\r
+  @param  This                    Calling context \r
+  @param  ParentImageHandle       The caller's image handle. \r
+  @param  FilePath                The specific file path from which the image is \r
+                                  loaded. \r
+  @param  SourceBuffer            If not NULL, a pointer to the memory location \r
+                                  containing a copy of the image to be loaded. \r
+  @param  SourceSize              The size in bytes of SourceBuffer. \r
+  @param  DstBuffer               The buffer to store the image. \r
+  @param  NumberOfPages           For input, specifies the space size of the \r
+                                  image by caller if not NULL. For output, \r
+                                  specifies the actual space size needed. \r
+  @param  ImageHandle             Image handle for output. \r
+  @param  EntryPoint              Image entry point for output. \r
+  @param  Attribute               The bit mask of attributes to set for the load \r
+                                  PE image. \r
+\r
+  @retval EFI_SUCCESS             The image was loaded into memory. \r
+  @retval EFI_NOT_FOUND           The FilePath was not found. \r
+  @retval EFI_INVALID_PARAMETER   One of the parameters has an invalid value. \r
+  @retval EFI_UNSUPPORTED         The image type is not supported, or the device \r
+                                  path cannot be parsed to locate the proper \r
+                                  protocol for loading the file. \r
+  @retval EFI_OUT_OF_RESOURCES    Image was not loaded due to insufficient \r
+                                  resources.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreLoadImageEx (\r
@@ -911,36 +928,6 @@ CoreLoadImageEx (
   OUT EFI_PHYSICAL_ADDRESS             *EntryPoint         OPTIONAL,\r
   IN  UINT32                           Attribute\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads an EFI image into memory and returns a handle to the image with extended parameters.\r
-\r
-Arguments:\r
-\r
-  This                - Calling context\r
-  ParentImageHandle   - The caller's image handle.\r
-  FilePath            - The specific file path from which the image is loaded.\r
-  SourceBuffer        - If not NULL, a pointer to the memory location containing a copy of\r
-                        the image to be loaded.\r
-  SourceSize          - The size in bytes of SourceBuffer.\r
-  DstBuffer           - The buffer to store the image.\r
-  NumberOfPages       - For input, specifies the space size of the image by caller if not NULL.\r
-                        For output, specifies the actual space size needed.\r
-  ImageHandle         - Image handle for output.\r
-  EntryPoint          - Image entry point for output.\r
-  Attribute           - The bit mask of attributes to set for the load PE image.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS            - The image was loaded into memory.\r
-  EFI_NOT_FOUND          - The FilePath was not found.\r
-  EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.\r
-  EFI_UNSUPPORTED        - The image type is not supported, or the device path cannot be\r
-                           parsed to locate the proper protocol for loading the file.\r
-  EFI_OUT_OF_RESOURCES   - Image was not loaded due to insufficient resources.\r
---*/\r
 {\r
   return CoreLoadImageCommon (\r
            TRUE,\r
@@ -956,6 +943,25 @@ Returns:
            );\r
 }\r
 \r
+\r
+/**\r
+  Transfer control to a loaded image's entry point.\r
+\r
+  @param  ImageHandle             Handle of image to be started. \r
+  @param  ExitDataSize            Pointer of the size to ExitData \r
+  @param  ExitData                Pointer to a pointer to a data buffer that \r
+                                  includes a Null-terminated Unicode string, \r
+                                  optionally followed by additional binary data. \r
+                                  The string is a description that the caller may \r
+                                  use to further indicate the reason for the \r
+                                  image's exit. \r
+\r
+  @retval EFI_INVALID_PARAMETER   Invalid parameter \r
+  @retval EFI_OUT_OF_RESOURCES    No enough buffer to allocate \r
+  @retval EFI_SUCCESS             Successfully transfer control to the image's \r
+                                  entry point.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreStartImage (\r
@@ -963,32 +969,6 @@ CoreStartImage (
   OUT UINTN      *ExitDataSize,\r
   OUT CHAR16     **ExitData  OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Transfer control to a loaded image's entry point.\r
-\r
-Arguments:\r
-\r
-  ImageHandle     - Handle of image to be started.\r
-\r
-  ExitDataSize    - Pointer of the size to ExitData\r
-\r
-  ExitData        - Pointer to a pointer to a data buffer that includes a Null-terminated\r
-                    Unicode string, optionally followed by additional binary data. The string\r
-                    is a description that the caller may use to further indicate the reason for\r
-                    the image's exit.\r
-\r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER     - Invalid parameter\r
-\r
-  EFI_OUT_OF_RESOURCES       - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS               - Successfully transfer control to the image's entry point.\r
-\r
---*/\r
 {\r
   EFI_STATUS                    Status;\r
   LOADED_IMAGE_PRIVATE_DATA     *Image;\r
@@ -1048,7 +1028,7 @@ Returns:
     //\r
     DEBUG_CODE_BEGIN ();\r
       if (EFI_ERROR (Image->Status)) {\r
-        DEBUG ((EFI_D_ERROR, "Error: Image at %10p start failed: %r\n", Image->Info.ImageBase, Image->Status));\r
+        DEBUG ((DEBUG_ERROR, "Error: Image at %10p start failed: %r\n", Image->Info.ImageBase, Image->Status));\r
       }\r
     DEBUG_CODE_END ();\r
 \r
@@ -1083,15 +1063,15 @@ Returns:
     if (Image->ExitDataSize != 0 || Image->ExitData != NULL) {\r
 \r
       DEBUG (\r
-        (EFI_D_LOAD,\r
+        (DEBUG_LOAD,\r
         "StartImage: ExitDataSize %d, ExitData %x",\r
                             Image->ExitDataSize,\r
         Image->ExitData)\r
         );\r
       if (Image->ExitData != NULL) {\r
-        DEBUG ((EFI_D_LOAD, " (%hs)", Image->ExitData));\r
+        DEBUG ((DEBUG_LOAD, " (%hs)", Image->ExitData));\r
       }\r
-      DEBUG ((EFI_D_LOAD, "\n"));\r
+      DEBUG ((DEBUG_LOAD, "\n"));\r
     }\r
   DEBUG_CODE_END ();\r
 \r
@@ -1130,27 +1110,19 @@ Returns:
 }\r
 \r
 \r
+\r
+/**\r
+  Unloads EFI image from memory.\r
+\r
+  @param  Image                   EFI image \r
+  @param  FreePage                Free allocated pages\r
+\r
+**/\r
 VOID\r
 CoreUnloadAndCloseImage (\r
   IN LOADED_IMAGE_PRIVATE_DATA  *Image,\r
   IN BOOLEAN                    FreePage\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Unloads EFI image from memory.\r
-\r
-Arguments:\r
-\r
-  Image      - EFI image\r
-  FreePage   - Free allocated pages\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
 {\r
   EFI_STATUS                          Status;\r
   UINTN                               HandleCount;\r
@@ -1281,6 +1253,30 @@ Returns:
 \r
 \r
 \r
+\r
+/**\r
+  Terminates the currently loaded EFI image and returns control to boot services.\r
+\r
+  @param  ImageHandle             Handle that identifies the image. This \r
+                                  parameter is passed to the image on entry. \r
+  @param  Status                  The image's exit code. \r
+  @param  ExitDataSize            The size, in bytes, of ExitData. Ignored if \r
+                                  ExitStatus is EFI_SUCCESS. \r
+  @param  ExitData                Pointer to a data buffer that includes a \r
+                                  Null-terminated Unicode string, optionally \r
+                                  followed by additional binary data. The string \r
+                                  is a description that the caller may use to \r
+                                  further indicate the reason for the image's \r
+                                  exit. \r
+\r
+  @retval EFI_INVALID_PARAMETER   Image handle is NULL or it is not current \r
+                                  image. \r
+  @retval EFI_SUCCESS             Successfully terminates the currently loaded \r
+                                  EFI image. \r
+  @retval EFI_ACCESS_DENIED       Should never reach there. \r
+  @retval EFI_OUT_OF_RESOURCES    Could not allocate pool\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreExit (\r
@@ -1289,35 +1285,6 @@ CoreExit (
   IN UINTN       ExitDataSize,\r
   IN CHAR16      *ExitData  OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Terminates the currently loaded EFI image and returns control to boot services.\r
-\r
-Arguments:\r
-\r
-  ImageHandle       - Handle that identifies the image. This parameter is passed to the image\r
-                      on entry.\r
-  Status            - The image's exit code.\r
-  ExitDataSize      - The size, in bytes, of ExitData. Ignored if ExitStatus is\r
-                      EFI_SUCCESS.\r
-  ExitData          - Pointer to a data buffer that includes a Null-terminated Unicode string,\r
-                      optionally followed by additional binary data. The string is a\r
-                      description that the caller may use to further indicate the reason for\r
-                      the image's exit.\r
-\r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER     - Image handle is NULL or it is not current image.\r
-\r
-  EFI_SUCCESS               - Successfully terminates the currently loaded EFI image.\r
-\r
-  EFI_ACCESS_DENIED         - Should never reach there.\r
-\r
-  EFI_OUT_OF_RESOURCES      - Could not allocate pool\r
-\r
---*/\r
 {\r
   LOADED_IMAGE_PRIVATE_DATA  *Image;\r
   EFI_TPL                    OldTpl;\r
@@ -1347,7 +1314,7 @@ Returns:
   // Image has been started, verify this image can exit\r
   //\r
   if (Image != mCurrentImage) {\r
-    DEBUG ((EFI_D_LOAD|EFI_D_ERROR, "Exit: Image is not exitable image\n"));\r
+    DEBUG ((DEBUG_LOAD|DEBUG_ERROR, "Exit: Image is not exitable image\n"));\r
     Status = EFI_INVALID_PARAMETER;\r
     goto Done;\r
   }\r
@@ -1388,28 +1355,24 @@ Done:
 \r
 \r
 \r
-EFI_STATUS\r
-EFIAPI\r
-CoreUnloadImage (\r
-  IN EFI_HANDLE  ImageHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Unloads an image.\r
 \r
-Arguments:\r
-\r
-  ImageHandle           - Handle that identifies the image to be unloaded.\r
+  @param  ImageHandle             Handle that identifies the image to be \r
+                                  unloaded. \r
 \r
-Returns:\r
+  @retval EFI_SUCCESS             The image has been unloaded. \r
+  @retval EFI_UNSUPPORTED         The image has been sarted, and does not support \r
+                                  unload. \r
+  @retval EFI_INVALID_PARAMPETER  ImageHandle is not a valid image handle.\r
 \r
- EFI_SUCCESS            - The image has been unloaded.\r
- EFI_UNSUPPORTED        - The image has been sarted, and does not support unload.\r
- EFI_INVALID_PARAMPETER - ImageHandle is not a valid image handle.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreUnloadImage (\r
+  IN EFI_HANDLE  ImageHandle\r
+  )\r
 {\r
   EFI_STATUS                 Status;\r
   LOADED_IMAGE_PRIVATE_DATA  *Image;\r
@@ -1460,33 +1423,24 @@ Done:
 }\r
 \r
 \r
+\r
+/**\r
+  Unload the specified image.\r
+\r
+  @param  This                    Indicates the calling context. \r
+  @param  ImageHandle             The specified image handle. \r
+\r
+  @retval EFI_INVALID_PARAMETER   Image handle is NULL. \r
+  @retval EFI_UNSUPPORTED         Attempt to unload an unsupported image. \r
+  @retval EFI_SUCCESS             Image successfully unloaded.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreUnloadImageEx (\r
   IN EFI_PE32_IMAGE_PROTOCOL  *This,\r
   IN EFI_HANDLE                         ImageHandle\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Unload the specified image.\r
-\r
-Arguments:\r
-\r
-  This              - Indicates the calling context.\r
-\r
-  ImageHandle       - The specified image handle.\r
-\r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER       - Image handle is NULL.\r
-\r
-  EFI_UNSUPPORTED             - Attempt to unload an unsupported image.\r
-\r
-  EFI_SUCCESS                 - Image successfully unloaded.\r
-\r
---*/\r
 {\r
   return CoreUnloadImage (ImageHandle);\r
 }\r