]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
Add doxygen style comments for functions in DxeMain.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 0f785ddbe0d94db1f0da179c6a61ca75c806aec6..b0a5c60f285ed98b9a72918b7ae9763c6ccbb0b5 100644 (file)
@@ -1,7 +1,7 @@
-/**@file\r
+/** @file\r
 \r
   DXE Core Main Entry Point\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2008, 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
@@ -228,26 +228,21 @@ EFI_DECOMPRESS_PROTOCOL  gEfiDecompress = {
 //\r
 // Main entry point to the DXE Core\r
 //\r
-VOID\r
-EFIAPI\r
-DxeMain (\r
-  IN  VOID *HobStart\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Main entry point to DXE Core.\r
 \r
-Arguments:\r
-\r
-  HobStart - Pointer to the beginning of the HOB List from PEI\r
-\r
-Returns:\r
+  @param  HobStart               Pointer to the beginning of the HOB List from \r
+                                 PEI \r
 \r
-  This function should never return\r
+  @return This function should never return\r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+DxeMain (\r
+  IN  VOID *HobStart\r
+  )\r
 {\r
   EFI_STATUS                         Status;\r
   EFI_PHYSICAL_ADDRESS               MemoryBaseAddress;\r
@@ -335,7 +330,7 @@ Returns:
     gDxeCoreImageHandle\r
     );\r
 \r
-  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "HOBLIST address in DXE = 0x%016lx\n", (UINT64) (UINTN) HobStart));\r
+  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "HOBLIST address in DXE = 0x%016lx\n", (UINT64) (UINTN) HobStart));\r
 \r
   //\r
   // Initialize the Event Services\r
@@ -438,26 +433,19 @@ Returns:
 }\r
 \r
 \r
+\r
+/**\r
+  Place holder function until all the Boot Services and Runtime Services are\r
+  available.\r
+\r
+  @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreEfiNotAvailableYetArg0 (\r
   VOID\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
 {\r
   //\r
   // This function should never be executed.  If it does, then the architectural protocols\r
@@ -468,26 +456,21 @@ Returns:
   return EFI_NOT_AVAILABLE_YET;\r
 }\r
 \r
+\r
+/**\r
+  Place holder function until all the Boot Services and Runtime Services are\r
+  available.\r
+\r
+  @param  Arg1                   Undefined \r
+\r
+  @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreEfiNotAvailableYetArg1 (\r
   UINTN Arg1\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
 {\r
   //\r
   // This function should never be executed.  If it does, then the architectural protocols\r
@@ -498,29 +481,22 @@ Returns:
   return EFI_NOT_AVAILABLE_YET;\r
 }\r
 \r
+\r
+/**\r
+  Place holder function until all the Boot Services and Runtime Services are available.\r
+\r
+  @param  Arg1                   Undefined \r
+  @param  Arg2                   Undefined \r
+\r
+  @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreEfiNotAvailableYetArg2 (\r
   UINTN Arg1,\r
   UINTN Arg2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-\r
-  Arg2        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
 {\r
   //\r
   // This function should never be executed.  If it does, then the architectural protocols\r
@@ -531,6 +507,17 @@ Returns:
   return EFI_NOT_AVAILABLE_YET;\r
 }\r
 \r
+\r
+/**\r
+  Place holder function until all the Boot Services and Runtime Services are available.\r
+\r
+  @param  Arg1                   Undefined \r
+  @param  Arg2                   Undefined \r
+  @param  Arg3                   Undefined \r
+\r
+  @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreEfiNotAvailableYetArg3 (\r
@@ -538,25 +525,6 @@ CoreEfiNotAvailableYetArg3 (
   UINTN Arg2,\r
   UINTN Arg3\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-\r
-  Arg2        - Undefined\r
-\r
-  Arg3        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
 {\r
   //\r
   // This function should never be executed.  If it does, then the architectural protocols\r
@@ -567,6 +535,18 @@ Returns:
   return EFI_NOT_AVAILABLE_YET;\r
 }\r
 \r
+\r
+/**\r
+  Place holder function until all the Boot Services and Runtime Services are available.\r
+\r
+  @param  Arg1                   Undefined \r
+  @param  Arg2                   Undefined \r
+  @param  Arg3                   Undefined \r
+  @param  Arg4                   Undefined \r
+\r
+  @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreEfiNotAvailableYetArg4 (\r
@@ -575,27 +555,6 @@ CoreEfiNotAvailableYetArg4 (
   UINTN Arg3,\r
   UINTN Arg4\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-\r
-  Arg2        - Undefined\r
-\r
-  Arg3        - Undefined\r
-\r
-  Arg4        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
 {\r
   //\r
   // This function should never be executed.  If it does, then the architectural protocols\r
@@ -606,6 +565,19 @@ Returns:
   return EFI_NOT_AVAILABLE_YET;\r
 }\r
 \r
+\r
+/**\r
+  Place holder function until all the Boot Services and Runtime Services are available.\r
+\r
+  @param  Arg1                   Undefined \r
+  @param  Arg2                   Undefined \r
+  @param  Arg3                   Undefined \r
+  @param  Arg4                   Undefined \r
+  @param  Arg5                   Undefined \r
+\r
+  @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreEfiNotAvailableYetArg5 (\r
@@ -615,29 +587,6 @@ CoreEfiNotAvailableYetArg5 (
   UINTN Arg4,\r
   UINTN Arg5\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-\r
-  Arg2        - Undefined\r
-\r
-  Arg3        - Undefined\r
-\r
-  Arg4        - Undefined\r
-\r
-  Arg5        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
 {\r
   //\r
   // This function should never be executed.  If it does, then the architectural protocols\r
@@ -649,30 +598,23 @@ Returns:
 }\r
 \r
 \r
+\r
+/**\r
+  Searches for a Protocol Interface passed from PEI through a HOB.\r
+\r
+  @param  ProtocolGuid           The Protocol GUID to search for in the HOB List \r
+  @param  Interface              A pointer to the interface for the Protocol GUID \r
+\r
+  @retval EFI_SUCCESS            The Protocol GUID was found and its interface is \r
+                                 returned in Interface \r
+  @retval EFI_NOT_FOUND          The Protocol GUID was not found in the HOB List\r
+\r
+**/\r
 EFI_STATUS\r
 CoreGetPeiProtocol (\r
   IN EFI_GUID  *ProtocolGuid,\r
   IN VOID      **Interface\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Searches for a Protocol Interface passed from PEI through a HOB\r
-\r
-Arguments:\r
-\r
-  ProtocolGuid - The Protocol GUID to search for in the HOB List\r
-\r
-  Interface    - A pointer to the interface for the Protocol GUID\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - The Protocol GUID was found and its interface is returned in Interface\r
-\r
-  EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List\r
-\r
---*/\r
 {\r
   EFI_HOB_GUID_TYPE   *GuidHob;\r
   VOID                *Buffer;\r
@@ -691,26 +633,18 @@ Returns:
 }\r
 \r
 \r
-VOID\r
-CalculateEfiHdrCrc (\r
-  IN  OUT EFI_TABLE_HEADER    *Hdr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Calcualte the 32-bit CRC in a EFI table using the service provided by the\r
   gRuntime service.\r
 \r
-Arguments:\r
+  @param  Hdr                    Pointer to an EFI standard header\r
 \r
-  Hdr  - Pointer to an EFI standard header\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
+**/\r
+VOID\r
+CalculateEfiHdrCrc (\r
+  IN  OUT EFI_TABLE_HEADER    *Hdr\r
+  )\r
 {\r
   UINT32 Crc;\r
 \r
@@ -727,30 +661,23 @@ Returns:
 \r
 \r
 \r
+\r
+/**\r
+  Terminates all boot services.\r
+\r
+  @param  ImageHandle            Handle that identifies the exiting image. \r
+  @param  MapKey                 Key to the latest memory map.\r
+\r
+  @retval EFI_SUCCESS            Boot Services terminated \r
+  @retval EFI_INVALID_PARAMETER  MapKey is incorrect.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CoreExitBootServices (\r
   IN EFI_HANDLE   ImageHandle,\r
   IN UINTN        MapKey\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Terminates all boot services.\r
-\r
-Arguments:\r
-\r
-  ImageHandle   - Handle that identifies the exiting image.\r
-\r
-  MapKey -Key to the latest memory map.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - Boot Services terminated\r
-  EFI_INVALID_PARAMETER - MapKey is incorrect.\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   EFI_STATUS    StatusTemp;\r
@@ -847,7 +774,48 @@ Returns:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Given a compressed source buffer, this function retrieves the size of the\r
+  uncompressed buffer and the size of the scratch buffer required to decompress\r
+  the compressed source buffer.\r
+\r
+  The GetInfo() function retrieves the size of the uncompressed buffer and the\r
+  temporary scratch buffer required to decompress the buffer specified by Source\r
+  and SourceSize. If the size of the uncompressed buffer or the size of the\r
+  scratch buffer cannot be determined from the compressed data specified by\r
+  Source and SourceData, then EFI_INVALID_PARAMETER is returned. Otherwise, the\r
+  size of the uncompressed buffer is returned in DestinationSize, the size of\r
+  the scratch buffer is returned in ScratchSize, and EFI_SUCCESS is returned.\r
+  The GetInfo() function does not have scratch buffer available to perform a\r
+  thorough checking of the validity of the source data. It just retrieves the\r
+  "Original Size" field from the beginning bytes of the source data and output\r
+  it as DestinationSize. And ScratchSize is specific to the decompression\r
+  implementation.\r
+\r
+  @param  This               A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
+  @param  Source             The source buffer containing the compressed data.\r
+  @param  SourceSize         The size, in bytes, of the source buffer.\r
+  @param  DestinationSize    A pointer to the size, in bytes, of the\r
+                             uncompressed buffer that will be generated when the\r
+                             compressed buffer specified by Source and\r
+                             SourceSize is decompressed.\r
+  @param  ScratchSize        A pointer to the size, in bytes, of the scratch\r
+                             buffer that is required to decompress the\r
+                             compressed buffer specified by Source and\r
+                             SourceSize.\r
+   \r
+  @retval EFI_SUCCESS        The size of the uncompressed data was returned in\r
+                             DestinationSize and the size of the scratch buffer\r
+                             was returned in ScratchSize.\r
+  @retval EFI_INVALID_PARAMETER The size of the uncompressed data or the size of\r
+                                the scratch buffer cannot be determined from the\r
+                                compressed data specified by Source and\r
+                                SourceSize.\r
+\r
+**/\r
 EFI_STATUS\r
+EFIAPI\r
 DxeMainUefiDecompressGetInfo (\r
   IN EFI_DECOMPRESS_PROTOCOL            *This,\r
   IN   VOID                             *Source,\r
@@ -864,6 +832,41 @@ DxeMainUefiDecompressGetInfo (
   return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);\r
 }\r
 \r
+\r
+/**\r
+  Decompresses a compressed source buffer.\r
+\r
+  The Decompress() function extracts decompressed data to its original form.\r
+  This protocol is designed so that the decompression algorithm can be\r
+  implemented without using any memory services. As a result, the Decompress()\r
+  Function is not allowed to call AllocatePool() or AllocatePages() in its\r
+  implementation. It is the caller¡¯s responsibility to allocate and free the\r
+  Destination and Scratch buffers.\r
+  If the compressed source data specified by Source and SourceSize is\r
+  sucessfully decompressed into Destination, then EFI_SUCCESS is returned. If\r
+  the compressed source data specified by Source and SourceSize is not in a\r
+  valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  @param  This                A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
+  @param  Source              The source buffer containing the compressed data.\r
+  @param  SourceSize          SourceSizeThe size of source data.\r
+  @param  Destination         On output, the destination buffer that contains\r
+                              the uncompressed data.\r
+  @param  DestinationSize     The size of the destination buffer.  The size of\r
+                              the destination buffer needed is obtained from\r
+                              EFI_DECOMPRESS_PROTOCOL.GetInfo().\r
+  @param  Scratch             A temporary scratch buffer that is used to perform\r
+                              the decompression.\r
+  @param  ScratchSize         The size of scratch buffer. The size of the\r
+                              scratch buffer needed is obtained from GetInfo().\r
+  \r
+  @retval EFI_SUCCESS         Decompression completed successfully, and the\r
+                              uncompressed buffer is returned in Destination.\r
+  @retval EFI_INVALID_PARAMETER  The source buffer specified by Source and\r
+                                 SourceSize is corrupted (not in a valid\r
+                                 compressed format).\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DxeMainUefiDecompress (\r