]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
Added Print, ErrorPrint, AsciiPrint, AsciiErrorPrint() to the UEFI Library.
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index 1f0b52b06152c15a8eb06514d2a47605e9f6fcac..9eaf48cace7ed9403aeeefacea43c7e4dca9b4b1 100644 (file)
@@ -128,6 +128,26 @@ EfiNamedEventSignal (
   IN CONST EFI_GUID  *Name\r
   );\r
 \r
+/** \r
+  Returns the current TPL.\r
+\r
+  This function returns the current TPL.  There is no EFI service to directly \r
+  retrieve the current TPL. Instead, the RaiseTPL() function is used to raise \r
+  the TPL to TPL_HIGH_LEVEL.  This will return the current TPL.  The TPL level \r
+  can then immediately be restored back to the current TPL level with a call \r
+  to RestoreTPL().\r
+\r
+  @param  VOID\r
+\r
+  @retvale EFI_TPL              The current TPL.\r
+\r
+**/\r
+EFI_TPL\r
+EFIAPI\r
+EfiGetCurrentTpl (\r
+  VOID\r
+  );\r
+\r
 /**\r
   This function initializes a basic mutual exclusion lock to the released state \r
   and returns the lock.  Each lock provides mutual exclusion access at its task \r
@@ -234,24 +254,26 @@ EfiReleaseLock (
   );\r
 \r
 /**
-  Tests whether a controller is managed by a specific driver.
+  Tests whether a controller handle is being managed by a specific driver.
 
-  This function tests whether a specific driver manages ControllerHandle by\r
-  opening on DriverBindingHandle a protocol specified by ProtocolGuid with\r
-  attribute EFI_OPEN_PROTOCOL_BY_DRIVER.  This library function is used to\r
-  implement the Component Name Protocol for EFI Drivers.\r
+  This function tests whether the driver specified by DriverBindingHandle is\r
+  currently managing the controller specified by ControllerHandle.  This test\r
+  is performed by evaluating if the the protocol specified by ProtocolGuid is\r
+  present on ControllerHandle and is was opened by DriverBindingHandle with an\r
+  attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. \r
   If ProtocolGuid is NULL, then ASSERT().\r
 
   @param  ControllerHandle     A handle for a controller to test.
   @param  DriverBindingHandle  Specifies the driver binding handle for the
                                driver.
-  @param  ProtocolGuid         Supplies GUID for the protocol opened by the
-                               driver on the controller. 
+  @param  ProtocolGuid         Specifies the protocol that the driver specified
+                               by DriverBindingHandle opens in its Start()
+                               function.
 
-  @retval EFI_SUCCESS          ControllerHandle is managed by the specific
-                               driver.
-  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the specific
-                               driver.
+  @retval EFI_SUCCESS          ControllerHandle is managed by the driver
+                               specifed by DriverBindingHandle.
+  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the driver
+                               specifed by DriverBindingHandle.
 
 **/\r
 EFI_STATUS\r
@@ -263,19 +285,18 @@ EfiTestManagedDevice (
   );\r
 \r
 /**
-  Tests whether a child handle is a children device of the controller.
+  Tests whether a child handle is a child device of the controller.
 
-  This function tests whether ChildHandle is one of the children of
-  ControllerHandle which are consuming a protocol specified by ProtocolGuid
-  with the attribute bit EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER set.  This
-  library function is used to implement the Component Name Protocol for EFI
-  Drivers.
-  If ProtocolGuid is NULL, then ASSERT().
+  This function tests whether ChildHandle is one of the children of\r
+  ControllerHandle.  This test is performed by checking to see if the protocol\r
+  specified by ProtocolGuid is present on ControllerHandle and opened by\r
+  ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
 
   @param  ControllerHandle     A handle for a (parent) controller to test. 
   @param  ChildHandle          A child handle to test.
-  @param  ConsumsedGuid        Supplies GUID for the protocol consumed by
-                               children from controller. 
+  @param  ConsumsedGuid        Supplies the protocol that the child controller
+                               opens on its parent controller. 
 
   @retval EFI_SUCCESS          ChildHandle is a child of the ControllerHandle.
   @retval EFI_UNSUPPORTED      ChildHandle is not a child of the
@@ -595,5 +616,96 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode\r
   );\r
 \r
+/** \r
+  Prints a formatted Unicode string to the console output device specified by \r
+  ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted Unicode string to the console output device \r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode \r
+  characters that printed to ConOut.  If the length of the formatted Unicode \r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+Print (\r
+  IN CONST CHAR16  *Format,\r
+  ...\r
+  );\r
+\r
+/** \r
+  Prints a formatted Unicode string to the console output device specified by \r
+  StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted Unicode string to the console output device \r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode \r
+  characters that printed to StdErr.  If the length of the formatted Unicode \r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+ErrorPrint (\r
+  IN CONST CHAR16  *Format,\r
+  ...\r
+  );\r
+\r
+/** \r
+  Prints a formatted ASCII string to the console output device specified by \r
+  ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted ASCII string to the console output device \r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII \r
+  characters that printed to ConOut.  If the length of the formatted ASCII \r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiPrint (\r
+  IN CONST CHAR8  *Format,\r
+  ...\r
+  );\r
+\r
+/** \r
+  Prints a formatted ASCII string to the console output device specified by \r
+  StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted ASCII string to the console output device \r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII \r
+  characters that printed to StdErr.  If the length of the formatted ASCII \r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiErrorPrint (\r
+  IN CONST CHAR8  *Format,\r
+  ...\r
+  );\r
 \r
 #endif\r