]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
Remove prefix EFI_ from some TPL macros reference in some comments
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index 9eaf48cace7ed9403aeeefacea43c7e4dca9b4b1..7b247e063cd9c865d02e5fe68820cad3bb7bba5f 100644 (file)
 #ifndef __UEFI_LIB_H__\r
 #define __UEFI_LIB_H__\r
 \r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/DriverConfiguration.h>\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/ComponentName2.h>\r
+#include <Protocol/DriverDiagnostics.h>\r
+#include <Protocol/DriverDiagnostics2.h>\r
+\r
 //\r
 // Unicode String Table\r
 //\r
@@ -180,7 +187,7 @@ EfiInitializeLock (
 \r
 **/\r
 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \\r
-  {Priority, EFI_TPL_APPLICATION, EfiLockReleased }\r
+  {Priority, TPL_APPLICATION, EfiLockReleased }\r
 \r
 \r
 /**\r
@@ -708,4 +715,125 @@ AsciiErrorPrint (
   ...\r
   );\r
 \r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol onto the\r
+  driver's DriverBindingHandle.  This is typically the same as the driver's\r
+  ImageHandle, but it can be different if the driver produces multiple\r
+  DriverBinding Protocols.  This function also initializes the EFI Driver\r
+  Library that initializes the global variables gST, gBS, gRT.\r
+\r
+  @param  ImageHandle          The image handle of the driver\r
+  @param  SystemTable          The EFI System Table that was passed to the driver's entry point\r
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver is producing\r
+  @param  DriverBindingHandle  The handle that DriverBinding is to be installe onto.  If this\r
+                               parameter is NULL, then a new handle is created.\r
+\r
+  @retval EFI_SUCCESS          DriverBinding is installed onto DriverBindingHandle\r
+  @retval Other                Status from gBS->InstallProtocolInterface()\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallDriverBinding (\r
+  IN CONST EFI_HANDLE             ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE       *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding,\r
+  IN EFI_HANDLE                   DriverBindingHandle\r
+  );\r
+\r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol onto the\r
+  driver's DriverBindingHandle.  This is typically the same as the driver's\r
+  ImageHandle, but it can be different if the driver produces multiple\r
+  DriverBinding Protocols.  This function also initializes the EFI Driver\r
+  Library that initializes the global variables gST, gBS, gRT.\r
+\r
+  @ImageHandle                 The image handle of the driver\r
+  @SystemTable                 The EFI System Table that was passed to the driver's entry point\r
+  @DriverBinding               A Driver Binding Protocol instance that this driver is producing\r
+  @DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
+                               parameter is NULL, then a new handle is created.\r
+  @ComponentName               A Component Name Protocol instance that this driver is producing\r
+  @DriverConfiguration         A Driver Configuration Protocol instance that this driver is producing\r
+  @DriverDiagnostics           A Driver Diagnostics Protocol instance that this driver is producing\r
+\r
+  @retval EFI_SUCCESS          DriverBinding is installed onto DriverBindingHandle\r
+  @retval Other                Status from gBS->InstallProtocolInterface()\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallAllDriverProtocols (\r
+  IN CONST EFI_HANDLE                         ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
+  IN EFI_HANDLE                               DriverBindingHandle,\r
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics    OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol\r
+  onto the driver's DriverBindingHandle.  This is typically the\r
+  same as the driver's ImageHandle, but it can be different if\r
+  the driver produces multiple DriverBinding Protocols.  This\r
+  function also initializes the EFI Driver Library that\r
+  initializes the global variables gST, gBS, gRT.\r
+\r
+  @ImageHandle                  The image handle of the driver\r
+  \r
+  @SystemTable                  The EFI System Table that was\r
+                                passed to the driver's entry\r
+                                point\r
+  \r
+  @DriverBinding                A Driver Binding Protocol\r
+                                instance that this driver is\r
+                                producing\r
+  \r
+  @DriverBindingHandle          The handle that DriverBinding is\r
+                                to be installe onto.  If this\r
+                                parameter is NULL, then a new\r
+                                handle is created.\r
+  \r
+  @ComponentName                A Component Name Protocol\r
+                                instance that this driver is\r
+                                producing\r
+  \r
+  @ComponentName2               A Component Name 2 Protocol\r
+                                instance that this driver is\r
+                                producing\r
+  \r
+  @DriverConfiguration          A Driver Configuration Protocol\r
+                                instance that this driver is\r
+                                producing\r
+  \r
+  @DriverDiagnostics            A Driver Diagnostics Protocol\r
+                                instance that this driver is\r
+                                producing\r
+  \r
+  @DriverDiagnostics2           A Driver Diagnostics 2 Protocol\r
+                                instance that this driver is\r
+                                producing\r
+\r
+  @retval EFI_SUCCESS          DriverBinding is installed onto DriverBindingHandle\r
+  @retval Other                Status from gBS->InstallProtocolInterface()\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallAllDriverProtocols2 (\r
+  IN CONST EFI_HANDLE                         ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
+  IN EFI_HANDLE                               DriverBindingHandle,\r
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2,      OPTIONAL\r
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics,   OPTIONAL\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2   OPTIONAL\r
+  );\r
+\r
+\r
 #endif\r