]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiDriverEntryPoint.h
Update EntryPoint library header
[mirror_edk2.git] / MdePkg / Include / Library / UefiDriverEntryPoint.h
index a7c89514758a3ae99f56dd5b63c57e1bfe1395a6..7946cb13f85f9fb5b473440eeec26c93f081dd76 100644 (file)
@@ -16,6 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __MODULE_ENTRY_POINT_H__\r
 #define __MODULE_ENTRY_POINT_H__\r
 \r
+///\r
+///Declare the PI Specification Revision that this driver requires to execute correctly.\r
+///\r
+extern CONST UINT32                   _gDxeRevision;\r
+\r
 ///\r
 /// Declare the EFI/UEFI Specification Revision to which this driver is implemented \r
 ///\r
@@ -28,13 +33,26 @@ extern CONST UINT8                    _gDriverUnloadImageCount;
 \r
 \r
 /**\r
-  Enrty point to DXE Driver.\r
+  The entry point of PE/COFF Image for a DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver. \r
+\r
+  This function is the entry point for a DXE Driver, DXE Runtime Driver, DXE SMM Driver,\r
+  or UEFI Driver.  This function must call ProcessLibraryConstructorList() and\r
+  ProcessModuleEntryPointList(). If the return status from ProcessModuleEntryPointList()\r
+  is an error status, then ProcessLibraryDestructorList() must be called. The return value\r
+  from ProcessModuleEntryPointList() is returned. If _gDriverUnloadImageCount is greater\r
+  than zero, then an unload handler must be registered for this image and the unload handler\r
+  must invoke ProcessModuleUnloadList().\r
+  If _gUefiDriverRevision is not zero and SystemTable->Hdr.Revision is less than _gUefiDriverRevison,\r
+  then return EFI_INCOMPATIBLE_VERSION.\r
 \r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
-  @param  SystemTable Pointer to the EFI System Table.\r
 \r
-  @retval  EFI_SUCCESS One or more of the drivers returned a success code.\r
-  @retval  !EFI_SUCESS The return status from the last driver entry point in the list.\r
+  @param  ImageHandle  The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
+\r
+  @retval  EFI_SUCCESS               The DXE Driver, DXE Runtime Driver, DXE SMM Driver,\r
+                                     or UEFI Driver exited normally.\r
+  @retval  EFI_INCOMPATIBLE_VERSION  _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.\r
+  @retval  Other                     Return value from ProcessModuleEntryPointList().\r
 \r
 **/\r
 EFI_STATUS\r
@@ -46,14 +64,17 @@ _ModuleEntryPoint (
 \r
 \r
 /**\r
-  Enrty point wrapper of DXE Driver.\r
+  Required by the EBC compiler and identical in functionality to _ModuleEntryPoint(). \r
 \r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
-  @param  SystemTable Pointer to the EFI System Table.\r
+  This function is required to call _ModuleEntryPoint() passing in ImageHandle, and SystemTable.\r
 \r
-  @retval  EFI_SUCCESS One or more of the drivers returned a success code.\r
-  @retval  !EFI_SUCESS The return status from the last driver entry point in the list.\r
+  @param  ImageHandle  The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
 \r
+  @retval  EFI_SUCCESS               The DXE Driver, DXE Runtime Driver, DXE SMM Driver,\r
+                                     or UEFI Driver exited normally.\r
+  @retval  EFI_INCOMPATIBLE_VERSION  _gUefiDriverRevision is greater than SystemTable->Hdr.Revision.\r
+  @retval  Other                     Return value from ProcessModuleEntryPointList().\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -64,8 +85,11 @@ EfiMain (
 \r
 \r
 /**\r
-  Computes the cummulative return status for the driver entry point and perform\r
-  a long jump back into DriverEntryPoint().\r
+  Invokes the library destructors for all dependent libraries and terminates the\r
+  DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver. \r
+\r
+  This function calls ProcessLibraryDestructorList() and the EFI Boot Service Exit()\r
+  with a status specified by Status.\r
 \r
   @param  Status Status returned by the driver that is exiting.\r
 \r
@@ -78,10 +102,20 @@ ExitDriver (
 \r
 \r
 /**\r
-  Call constructs for all libraries. Automatics Generated by tool.\r
+  Autogenerated function that calls the library constructors for all of the module's\r
+  dependent libraries.\r
 \r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
-  @param  SystemTable Pointer to the EFI System Table.\r
+  This function must be called by _ModuleEntryPoint().\r
+  This function calls the set of library constructors for the set of library instances\r
+  that a module depends on.  This includes library instances that a module depends on\r
+  directly and library instances that a module depends on indirectly through other libraries.  \r
+  This function is autogenerated by build tools and those build tools are responsible\r
+  for collecting the set of library instances, determine which ones have constructors,\r
+  and calling the library constructors in the proper order based upon each of the library\r
+  instances own dependencies.\r
+\r
+  @param  ImageHandle  The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
 \r
 **/\r
 VOID\r
@@ -93,10 +127,19 @@ ProcessLibraryConstructorList (
 \r
 \r
 /**\r
-  Call destructors for all libraries. Automatics Generated by tool.\r
+  Autogenerated function that calls the library descructors for all of the module's\r
+  dependent libraries.\r
+\r
+  This function may be called by _ModuleEntryPoint() or ExitDriver().\r
+  This function calls the set of library destructors for the set of library instances\r
+  that a module depends on. This includes library instances that a module depends on\r
+  directly and library instances that a module depends on indirectly through other libraries.  \r
+  This function is autogenerated by build tools and those build tools are responsible for\r
+  collecting the set of library instances, determine which ones have destructors, and calling\r
+  the library destructors in the proper order based upon each of the library instances own dependencies.\r
 \r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
-  @param  SystemTable Pointer to the EFI System Table.\r
+  @param  ImageHandle  The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
 \r
 **/\r
 VOID\r
@@ -106,24 +149,20 @@ ProcessLibraryDestructorList (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   );\r
 \r
-/**\r
-  Call the list of driver entry points. Automatics Generated by tool.\r
-\r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
-  @param  SystemTable Pointer to the EFI System Table.\r
-\r
-  @return Status returned by entry points of drivers.  \r
\r
-**/\r
 \r
 /**\r
-  Call the list of driver entry points. Automatics Generated by tool.\r
+  Autogenerated function that calls a set of module entry points.\r
 \r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
-  @param  SystemTable Pointer to the EFI System Table.\r
+  This function must be called by _ModuleEntryPoint().\r
+  This function calls the set of module entry points.  \r
+  This function is autogenerated by build tools and those build tools are responsible\r
+  for collecting the module entry points and calling them in a specified order.\r
 \r
-  @return Status returned by entry points of drivers.  \r
\r
+  @param  ImageHandle  The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
+\r
+  @retval  EFI_SUCCESS   The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver executed normally.\r
+  @retval  !EFI_SUCCESS  The DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver failed to execute normally.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -134,11 +173,17 @@ ProcessModuleEntryPointList (
 \r
 \r
 /**\r
-  Call the unload handlers for all the modules. Automatics Generated by tool.\r
+  Autogenerated function that calls a set of module unload handlers.\r
+\r
+  This function must be called from the unload handler registered by _ModuleEntryPoint().\r
+  This function calls the set of module unload handlers.  \r
+  This function is autogenerated by build tools and those build tools are responsible\r
+  for collecting the module unload handlers and calling them in a specified order.\r
+\r
+  @param  ImageHandle  The image handle of the DXE Driver, DXE Runtime Driver, DXE SMM Driver, or UEFI Driver.\r
 \r
-  @param  ImageHandle ImageHandle of the loaded driver.\r
\r
-  @return Status returned by unload handlers of drivers.\r
+  @retval  EFI_SUCCESS  The unoad handlers executed normally.\r
+  @retval  !EFI_SUCCESS The unload handlers failed to execute normally.\r
 \r
 **/\r
 EFI_STATUS\r