]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiDriverEntryPoint.h
MdePkg/ProcessorBind: add defines for page allocation granularity
[mirror_edk2.git] / MdePkg / Include / Library / UefiDriverEntryPoint.h
index a6c4a74e961d67733b0a680c435d10c6cad551b9..f9d9befb9c126cca777f484837e5ab8153623c4c 100644 (file)
@@ -1,8 +1,9 @@
 /** @file\r
-  Entry point to a DXE Boot Services Driver\r
+  Module entry point library for UEFI drivers, DXE Drivers, DXE Runtime Drivers,\r
+  and DXE SMM Drivers.\r
 \r
-Copyright (c) 2006, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -16,38 +17,42 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define __MODULE_ENTRY_POINT_H__\r
 \r
 ///\r
-/// Declare the EFI/UEFI Specification Revision to which this driver is implemented \r
+///Declare the PI Specification Revision that this driver requires to execute correctly.\r
 ///\r
-extern const UINT32                   _gUefiDriverRevision;\r
+extern CONST UINT32                   _gDxeRevision;\r
 \r
 ///\r
-/// Declare the number of entry points in the image. \r
+/// Declare the EFI/UEFI Specification Revision to which this driver is implemented \r
 ///\r
-extern const UINT8                    _gDriverEntryPointCount;\r
+extern CONST UINT32                   _gUefiDriverRevision;\r
 \r
 ///\r
 /// Declare the number of unload handler in the image. \r
 ///\r
-extern const UINT8                    _gDriverUnloadImageCount;\r
-\r
-///\r
-/// Declare the arrary of Boot Sevice Exit Event callbacks . \r
-///\r
-extern const EFI_EVENT_NOTIFY         _gDriverExitBootServicesEvent[];\r
+extern CONST UINT8                    _gDriverUnloadImageCount;\r
 \r
-///\r
-/// Declare the arrary of Virtual Address Change Event callbacks . \r
-///\r
-extern const EFI_EVENT_NOTIFY         _gDriverSetVirtualAddressMapEvent[];\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
@@ -59,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
@@ -77,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
@@ -91,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
@@ -106,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
@@ -119,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
+  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
-  @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
-  @return Status returned by entry points of drivers.  \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
@@ -147,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 unload handlers executed normally.\r
+  @retval  !EFI_SUCCESS The unload handlers failed to execute normally.\r
 \r
 **/\r
 EFI_STATUS\r