]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
MdePkg/BaseLib: add PatchInstructionX86()
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index 1853f810a243ee4484689b8c11130999b03430d4..54bc2cc5a334d3d3b097e27312dfb3c44d3e2280 100644 (file)
@@ -8,11 +8,15 @@
   EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, \r
   and print messages on the console output and standard error devices.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation<BR>\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
-http://opensource.org/licenses/bsd-license.php\r
+  Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention\r
+  of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is\r
+  defined, then debug and assert related macros wrapped by it are the NULL implementations.\r
+\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.\r
 \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
@@ -60,9 +64,9 @@ typedef struct {
 \r
 /**\r
   Macro that returns the number of 100 ns units for a specified number of microseconds.\r
-  Useful for managing EFI timer events.\r
+  This is useful for managing EFI timer events.\r
 \r
-  @param  Microseconds           Number of microseconds.\r
+  @param  Microseconds           The number of microseconds.\r
 \r
   @return The number of 100 ns units equivalent to the number of microseconds specified\r
           by Microseconds.\r
@@ -72,9 +76,9 @@ typedef struct {
 \r
 /**\r
   Macro that returns the number of 100 ns units for a specified number of milliseconds.\r
-  Useful for managing EFI timer events.\r
+  This is useful for managing EFI timer events.\r
 \r
-  @param  Milliseconds           Number of milliseconds.\r
+  @param  Milliseconds           The number of milliseconds.\r
 \r
   @return The number of 100 ns units equivalent to the number of milliseconds specified\r
           by Milliseconds.\r
@@ -84,9 +88,9 @@ typedef struct {
 \r
 /**\r
   Macro that returns the number of 100 ns units for a specified number of seconds.\r
-  Useful for managing EFI timer events.\r
+  This is useful for managing EFI timer events.\r
 \r
-  @param  Seconds                Number of seconds.\r
+  @param  Seconds                The number of seconds.\r
 \r
   @return The number of 100 ns units equivalent to the number of seconds specified\r
           by Seconds.\r
@@ -113,14 +117,14 @@ typedef struct {
   based on a specified GUID.\r
   \r
   This function searches the list of configuration tables stored in the EFI System Table\r
-  for a table with a GUID that matches TableGuid.  If a match is found, then a pointer to\r
-  the configuration table is returned in Table., and EFI_SUCCESS is returned. If a matching GUID\r
+  for a table with a GUID that matches TableGuid. If a match is found, then a pointer to\r
+  the configuration table is returned in Table, and EFI_SUCCESS is returned. If a matching GUID\r
   is not found, then EFI_NOT_FOUND is returned.\r
   If TableGuid is NULL, then ASSERT().\r
   If Table is NULL, then ASSERT().\r
 \r
-  @param  TableGuid       Pointer to table's GUID type..\r
-  @param  Table           Pointer to the table associated with TableGuid in the EFI System Table.\r
+  @param  TableGuid       The pointer to table's GUID type..\r
+  @param  Table           The pointer to the table associated with TableGuid in the EFI System Table.\r
 \r
   @retval EFI_SUCCESS     A configuration table matching TableGuid was found.\r
   @retval EFI_NOT_FOUND   A configuration table matching TableGuid could not be found.\r
@@ -187,7 +191,7 @@ EfiCreateProtocolNotifyEvent(
   @param  Registration          A pointer to a memory location to receive the registration value.\r
 \r
   @retval EFI_SUCCESS           A named event was created.\r
-  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to create the named event.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to create the named event.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -207,10 +211,10 @@ EfiNamedEventListen (
   created with EfiNamedEventListen().\r
   If Name is NULL, then ASSERT().\r
 \r
-  @param  Name                  Supplies GUID name of the event.\r
+  @param  Name                  Supplies the GUID name of the event.\r
 \r
   @retval EFI_SUCCESS           A named event was signaled.\r
-  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to signal the named event.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to signal the named event.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -219,6 +223,40 @@ EfiNamedEventSignal (
   IN CONST EFI_GUID  *Name\r
   );\r
 \r
+/**\r
+  Signals an event group by placing a new event in the group temporarily and\r
+  signaling it.\r
+\r
+  @param[in] EventGroup          Supplies the unique identifier of the event\r
+                                 group to signal.\r
+\r
+  @retval EFI_SUCCESS            The event group was signaled successfully.\r
+  @retval EFI_INVALID_PARAMETER  EventGroup is NULL.\r
+  @return                        Error codes that report problems about event\r
+                                 creation or signaling.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiEventGroupSignal (\r
+  IN CONST EFI_GUID *EventGroup\r
+  );\r
+\r
+/**\r
+  An empty function that can be used as NotifyFunction parameter of\r
+  CreateEvent() or CreateEventEx().\r
+\r
+  @param Event              Event whose notification function is being invoked.\r
+  @param Context            The pointer to the notification function's context,\r
+                            which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiEventEmptyFunction (\r
+  IN EFI_EVENT              Event,\r
+  IN VOID                   *Context\r
+  );\r
+\r
 /** \r
   Returns the current TPL.\r
 \r
@@ -248,7 +286,7 @@ EfiGetCurrentTpl (
   If Priority is not a valid TPL value, then ASSERT().\r
 \r
   @param  Lock       A pointer to the lock data structure to initialize.\r
-  @param  Priority   EFI TPL associated with the lock.\r
+  @param  Priority   The EFI TPL associated with the lock.\r
 \r
   @return The lock.\r
 \r
@@ -280,24 +318,30 @@ EfiInitializeLock (
 /**\r
   Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.\r
 \r
-  If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, \r
-  then this macro evaluates the EFI_LOCK structure specified by Lock.  If Lock \r
-  is not in the locked state, then DebugAssert() is called passing in the source \r
-  filename, source line number, and Lock.\r
+  If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED \r
+  bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_LOCK \r
+  structure specified by Lock.  If Lock is not in the locked state, then\r
+  DebugAssert() is called passing in the source filename, source line number, \r
+  and Lock.\r
+\r
   If Lock is NULL, then ASSERT().\r
 \r
   @param  LockParameter  A pointer to the lock to acquire.\r
 \r
 **/\r
-#define ASSERT_LOCKED(LockParameter)                  \\r
-  do {                                                \\r
-    if (DebugAssertEnabled ()) {                      \\r
-      ASSERT (LockParameter != NULL);                 \\r
-      if ((LockParameter)->Lock != EfiLockAcquired) { \\r
-        _ASSERT (LockParameter not locked);           \\r
-      }                                               \\r
-    }                                                 \\r
-  } while (FALSE)\r
+#if !defined(MDEPKG_NDEBUG)       \r
+  #define ASSERT_LOCKED(LockParameter)                  \\r
+    do {                                                \\r
+      if (DebugAssertEnabled ()) {                      \\r
+        ASSERT (LockParameter != NULL);                 \\r
+        if ((LockParameter)->Lock != EfiLockAcquired) { \\r
+          _ASSERT (LockParameter not locked);           \\r
+        }                                               \\r
+      }                                                 \\r
+    } while (FALSE)\r
+#else\r
+  #define ASSERT_LOCKED(LockParameter)\r
+#endif\r
 \r
 \r
 /**\r
@@ -483,7 +527,7 @@ LookupUnicodeString (
                                that matches the language specified by Language.\r
   @param  Iso639Language       Specifies the supported language code format. If it is TRUE, then\r
                                Language and SupportedLanguages follow ISO 639-2 language code format.\r
-                               Otherwise, they follow RFC 4646 language code format.\r
+                               Otherwise, they follow the RFC 4646 language code format.\r
 \r
 \r
   @retval  EFI_SUCCESS            The Unicode string that matches the language specified by Language\r
@@ -619,8 +663,11 @@ FreeUnicodeStringTable (
   IN EFI_UNICODE_STRING_TABLE  *UnicodeStringTable\r
   );\r
 \r
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
 \r
 /**\r
+  [ATTENTION] This function will be deprecated for security reason.\r
+\r
   Returns a pointer to an allocated buffer that contains the contents of a \r
   variable retrieved through the UEFI Runtime Service GetVariable().  The \r
   returned buffer is allocated using AllocatePool().  The caller is responsible\r
@@ -629,8 +676,8 @@ FreeUnicodeStringTable (
   If Name is NULL, then ASSERT().\r
   If Guid is NULL, then ASSERT().\r
 \r
-  @param[in]  Name  Pointer to a Null-terminated Unicode string.\r
-  @param[in]  Guid  Pointer to an EFI_GUID structure\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[in]  Guid  The pointer to an EFI_GUID structure.\r
 \r
   @retval NULL   The variable could not be retrieved.\r
   @retval NULL   There are not enough resources available for the variable contents.\r
@@ -645,6 +692,8 @@ GetVariable (
   );\r
 \r
 /**\r
+  [ATTENTION] This function will be deprecated for security reason.\r
+\r
   Returns a pointer to an allocated buffer that contains the contents of a \r
   variable retrieved through the UEFI Runtime Service GetVariable().  This \r
   function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.\r
@@ -653,7 +702,7 @@ GetVariable (
 \r
   If Name is NULL, then ASSERT().\r
 \r
-  @param[in]  Name  Pointer to a Null-terminated Unicode string.\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
 \r
   @retval NULL   The variable could not be retrieved.\r
   @retval NULL   There are not enough resources available for the variable contents.\r
@@ -665,7 +714,64 @@ EFIAPI
 GetEfiGlobalVariable (\r
   IN CONST CHAR16  *Name\r
   );\r
+#endif\r
+\r
+\r
+/**\r
+  Returns the status whether get the variable success. The function retrieves \r
+  variable  through the UEFI Runtime Service GetVariable().  The \r
+  returned buffer is allocated using AllocatePool().  The caller is responsible\r
+  for freeing this buffer with FreePool().\r
+\r
+  If Name  is NULL, then ASSERT().\r
+  If Guid  is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[in]  Guid  The pointer to an EFI_GUID structure\r
+  @param[out] Value The buffer point saved the variable info.\r
+  @param[out] Size  The buffer size of the variable.\r
 \r
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @return EFI_SUCCESS               Find the specified variable.\r
+  @return Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetVariable2 (\r
+  IN CONST CHAR16    *Name,\r
+  IN CONST EFI_GUID  *Guid,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL\r
+  );\r
+\r
+/**\r
+  Returns a pointer to an allocated buffer that contains the contents of a \r
+  variable retrieved through the UEFI Runtime Service GetVariable().  This \r
+  function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.\r
+  The returned buffer is allocated using AllocatePool().  The caller is \r
+  responsible for freeing this buffer with FreePool().\r
+\r
+  If Name  is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[out] Value The buffer point saved the variable info.\r
+  @param[out] Size  The buffer size of the variable.\r
+\r
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @return EFI_SUCCESS               Find the specified variable.\r
+  @return Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetEfiGlobalVariable2 (\r
+  IN CONST CHAR16    *Name,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL\r
+  );\r
 \r
 /**\r
   Returns a pointer to an allocated buffer that contains the best matching language \r
@@ -716,6 +822,31 @@ GetBestLanguage (
   ...\r
   );\r
 \r
+/**\r
+  Draws a dialog box to the console output device specified by \r
+  ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke\r
+  from the console input device specified by ConIn defined in the \r
+  EFI_SYSTEM_TABLE.\r
+\r
+  If there are no strings in the variable argument list, then ASSERT().\r
+  If all the strings in the variable argument list are empty, then ASSERT().\r
+\r
+  @param[in]   Attribute  Specifies the foreground and background color of the popup.\r
+  @param[out]  Key        A pointer to the EFI_KEY value of the key that was \r
+                          pressed.  This is an optional parameter that may be NULL.\r
+                          If it is NULL then no wait for a keypress will be performed.\r
+  @param[in]  ...         The variable argument list that contains pointers to Null-\r
+                          terminated Unicode strings to display in the dialog box.  \r
+                          The variable argument list is terminated by a NULL.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CreatePopUp (\r
+  IN  UINTN          Attribute,                \r
+  OUT EFI_INPUT_KEY  *Key,      OPTIONAL\r
+  ...\r
+  );\r
 \r
 /**\r
   Retrieves the width of a Unicode character.\r
@@ -804,8 +935,8 @@ EfiSignalEventLegacyBoot (
 \r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
 \r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
+  @retval EFI_SUCCESS       The event was created.\r
+  @retval Other             The event was not created.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -829,8 +960,8 @@ EfiCreateEventLegacyBoot (
   @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
 \r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
+  @retval EFI_SUCCESS       The event was created.\r
+  @retval Other             The event was not created.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -855,8 +986,8 @@ EfiCreateEventLegacyBootEx (
 \r
   @param  ReadyToBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
 \r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
+  @retval EFI_SUCCESS       The event was created.\r
+  @retval Other             The event was not created.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -880,8 +1011,8 @@ EfiCreateEventReadyToBoot (
   @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
   @param  ReadyToBootEvent  Returns the EFI event returned from gBS->CreateEvent(Ex).\r
 \r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
+  @retval EFI_SUCCESS       The event was created.\r
+  @retval Other             The event was not created.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -905,7 +1036,7 @@ EfiCreateEventReadyToBootEx (
   If FvDevicePathNode is NULL, then ASSERT().\r
   If NameGuid is NULL, then ASSERT().\r
   \r
-  @param  FvDevicePathNode  Pointer to a FV device path node to initialize\r
+  @param  FvDevicePathNode  The pointer to a FV device path node to initialize\r
   @param  NameGuid          FV file name to use in FvDevicePathNode\r
 \r
 **/\r
@@ -923,12 +1054,12 @@ EfiInitializeFwVolDevicepathNode (
   This library function abstracts validating a device path node.\r
   Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.  \r
   If it is valid, then return the GUID file name from the device path node.  Otherwise, \r
-  return NULL.  This device path changed in the DXE CIS version 0.92 in a non back ward \r
+  return NULL.  This device path changed in the DXE CIS version 0.92 in a non backward \r
   compatible way to not conflict with the UEFI 2.0 specification.  This function abstracts \r
   the differences from the caller.\r
   If FvDevicePathNode is NULL, then ASSERT().\r
 \r
-  @param  FvDevicePathNode  Pointer to FV device path to check.\r
+  @param  FvDevicePathNode  The pointer to FV device path to check.\r
 \r
   @retval NULL              FvDevicePathNode is not valid.\r
   @retval Other             FvDevicePathNode is valid and pointer to NameGuid was returned.\r
@@ -951,9 +1082,10 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->ConOut is NULL, then ASSERT().\r
 \r
-  @param Format   Null-terminated Unicode format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param Format   A null-terminated Unicode format string.\r
+  @param ...      The variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
   @return Number of Unicode characters printed to ConOut.\r
@@ -977,9 +1109,10 @@ Print (
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->StdErr is NULL, then ASSERT().\r
 \r
-  @param Format   Null-terminated Unicode format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param Format   A null-terminated Unicode format string.\r
+  @param ...      The variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
   @return Number of Unicode characters printed to StdErr.\r
@@ -1002,9 +1135,10 @@ ErrorPrint (
   string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
+  If gST->ConOut is NULL, then ASSERT().\r
 \r
-  @param Format   Null-terminated ASCII format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param Format   A null-terminated ASCII format string.\r
+  @param ...      The variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
   @return Number of ASCII characters printed to ConOut.\r
@@ -1027,9 +1161,10 @@ AsciiPrint (
   string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
+  If gST->StdErr is NULL, then ASSERT().\r
 \r
-  @param Format   Null-terminated ASCII format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param Format   A null-terminated ASCII format string.\r
+  @param ...      The variable argument list whose contents are accessed based \r
                   on the format string specified by Format.\r
   \r
   @return Number of ASCII characters printed to ConErr.\r
@@ -1042,14 +1177,16 @@ AsciiErrorPrint (
   ...\r
   );\r
 \r
+\r
 /**\r
   Prints a formatted Unicode string to a graphics console device specified by \r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
   This function prints a formatted Unicode string to the graphics console device \r
   specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
-  Unicode characters printed.  If the length of the formatted Unicode string is\r
-  greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  Unicode characters displayed, not including partial characters that may be clipped \r
+  by the right edge of the display.  If the length of the formatted Unicode string is\r
+  greater than PcdUefiLibMaxPrintBufferSize, then at most the first \r
   PcdUefiLibMaxPrintBufferSize characters are printed.  The EFI_HII_FONT_PROTOCOL\r
   is used to convert the string to a bitmap using the glyphs registered with the \r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
@@ -1061,9 +1198,10 @@ AsciiErrorPrint (
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->ConsoleOutputHandle is NULL, then ASSERT().\r
 \r
-  @param  X            X coordinate to print the string.\r
-  @param  Y            Y coordinate to print the string.\r
+  @param  PointX       X coordinate to print the string.\r
+  @param  PointY       Y coordinate to print the string.\r
   @param  ForeGround   The foreground color of the string being printed.  This is\r
                        an optional parameter that may be NULL.  If it is NULL,\r
                        then the foreground color of the current ConOut device\r
@@ -1072,7 +1210,7 @@ AsciiErrorPrint (
                        an optional parameter that may be NULL.  If it is NULL, \r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
-  @param  Format       Null-terminated Unicode format string.  See Print Library \r
+  @param  Format       A null-terminated Unicode format string.  See Print Library \r
                        for the supported format string syntax.\r
   @param  ...          Variable argument list whose contents are accessed based on \r
                        the format string specified by Format.         \r
@@ -1083,8 +1221,8 @@ AsciiErrorPrint (
 UINTN\r
 EFIAPI\r
 PrintXY (\r
-  IN UINTN                            X,\r
-  IN UINTN                            Y,\r
+  IN UINTN                            PointX,\r
+  IN UINTN                            PointY,\r
   IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *ForeGround, OPTIONAL\r
   IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *BackGround, OPTIONAL\r
   IN CONST CHAR16                     *Format,\r
@@ -1097,8 +1235,9 @@ PrintXY (
 \r
   This function prints a formatted ASCII string to the graphics console device \r
   specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
-  ASCII characters printed.  If the length of the formatted ASCII string is\r
-  greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  ASCII characters displayed, not including partial characters that may be clipped \r
+  by the right edge of the display.  If the length of the formatted ASCII string is\r
+  greater than PcdUefiLibMaxPrintBufferSize, then at most the first \r
   PcdUefiLibMaxPrintBufferSize characters are printed.  The EFI_HII_FONT_PROTOCOL\r
   is used to convert the string to a bitmap using the glyphs registered with the \r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
@@ -1109,9 +1248,10 @@ PrintXY (
   If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
+  If gST->ConsoleOutputHandle is NULL, then ASSERT().\r
 \r
-  @param  X            X coordinate to print the string.\r
-  @param  Y            Y coordinate to print the string.\r
+  @param  PointX       X coordinate to print the string.\r
+  @param  PointY       Y coordinate to print the string.\r
   @param  ForeGround   The foreground color of the string being printed.  This is\r
                        an optional parameter that may be NULL.  If it is NULL,\r
                        then the foreground color of the current ConOut device\r
@@ -1120,9 +1260,9 @@ PrintXY (
                        an optional parameter that may be NULL.  If it is NULL, \r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
-  @param  Format       Null-terminated ASCII format string.  See Print Library \r
+  @param  Format       A null-terminated ASCII format string.  See Print Library \r
                        for the supported format string syntax.\r
-  @param  ...          Variable argument list whose contents are accessed based on \r
+  @param  ...          The variable argument list whose contents are accessed based on \r
                        the format string specified by Format.         \r
 \r
   @return  The number of ASCII characters printed.\r
@@ -1131,8 +1271,8 @@ PrintXY (
 UINTN\r
 EFIAPI\r
 AsciiPrintXY (\r
-  IN UINTN                            X,\r
-  IN UINTN                            Y,\r
+  IN UINTN                            PointX,\r
+  IN UINTN                            PointY,\r
   IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *ForeGround, OPTIONAL\r
   IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *BackGround, OPTIONAL\r
   IN CONST CHAR8                      *Format,\r
@@ -1156,7 +1296,7 @@ AsciiPrintXY (
   @param  DriverBindingHandle  The handle that DriverBinding is to be installed onto.  If this\r
                                parameter is NULL, then a new handle is created.\r
 \r
-  @retval EFI_SUCCESS           The protocol installation is completed successfully.\r
+  @retval EFI_SUCCESS           The protocol installation completed successfully.\r
   @retval EFI_OUT_OF_RESOURCES  There was not enough system resources to install the protocol.\r
   @retval Others                Status from gBS->InstallMultipleProtocolInterfaces().\r
 \r
@@ -1178,7 +1318,7 @@ EfiLibInstallDriverBinding (
   Initializes a driver by installing the Driver Binding Protocol together with the\r
   optional Component Name, optional Driver Configure and optional Driver Diagnostic\r
   Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,\r
-  then the protocols are  installed onto a newly created handle. DriverBindingHandle\r
+  then the protocols are installed onto a newly created handle. DriverBindingHandle\r
   is typically the same as the driver's ImageHandle, but it can be different if the\r
   driver produces multiple Driver Binding Protocols. \r
   If DriverBinding is NULL, then ASSERT(). \r
@@ -1193,8 +1333,8 @@ EfiLibInstallDriverBinding (
   @param  DriverConfiguration  A Driver Configuration Protocol instance that this driver is producing.\r
   @param  DriverDiagnostics    A Driver Diagnostics Protocol instance that this driver is producing.\r
 \r
-  @retval EFI_SUCCESS           The protocol installation is completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\r
+  @retval EFI_SUCCESS           The protocol installation completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  There was not enough memory in the pool to install all the protocols.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1230,7 +1370,7 @@ EfiLibInstallAllDriverProtocols (
   @param  ComponentName        A Component Name Protocol instance that this driver is producing.\r
   @param  ComponentName2       A Component Name 2 Protocol instance that this driver is producing.\r
 \r
-  @retval EFI_SUCCESS           The protocol installation is completed successfully.\r
+  @retval EFI_SUCCESS           The protocol installation completed successfully.\r
   @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\r
 \r
 **/\r
@@ -1271,7 +1411,7 @@ EfiLibInstallDriverBindingComponentName2 (
   @param  DriverDiagnostics     A Driver Diagnostics Protocol instance that this driver is producing.\r
   @param  DriverDiagnostics2    A Driver Diagnostics Protocol 2 instance that this driver is producing.\r
 \r
-  @retval EFI_SUCCESS           The protocol installation is completed successfully.\r
+  @retval EFI_SUCCESS           The protocol installation completed successfully.\r
   @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\r
 \r
 **/\r
@@ -1290,4 +1430,94 @@ EfiLibInstallAllDriverProtocols2 (
   IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2    OPTIONAL\r
   );\r
 \r
+/** \r
+  Appends a formatted Unicode string to a Null-terminated Unicode string\r
\r
+  This function appends a formatted Unicode string to the Null-terminated \r
+  Unicode string specified by String.   String is optional and may be NULL.\r
+  Storage for the formatted Unicode string returned is allocated using \r
+  AllocatePool().  The pointer to the appended string is returned.  The caller\r
+  is responsible for freeing the returned string.\r
\r
+  If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().\r
+  If FormatString is NULL, then ASSERT().\r
+  If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
\r
+  @param[in] String         A Null-terminated Unicode string.\r
+  @param[in] FormatString   A Null-terminated Unicode format string.\r
+  @param[in]  Marker        VA_LIST marker for the variable argument list.\r
+\r
+  @retval NULL    There was not enough available memory.\r
+  @return         Null-terminated Unicode string is that is the formatted \r
+                  string appended to String.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+CatVSPrint (\r
+  IN  CHAR16  *String, OPTIONAL\r
+  IN  CONST CHAR16  *FormatString,\r
+  IN  VA_LIST       Marker\r
+  );\r
+\r
+/** \r
+  Appends a formatted Unicode string to a Null-terminated Unicode string\r
\r
+  This function appends a formatted Unicode string to the Null-terminated \r
+  Unicode string specified by String.   String is optional and may be NULL.\r
+  Storage for the formatted Unicode string returned is allocated using \r
+  AllocatePool().  The pointer to the appended string is returned.  The caller\r
+  is responsible for freeing the returned string.\r
\r
+  If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().\r
+  If FormatString is NULL, then ASSERT().\r
+  If FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
\r
+  @param[in] String         A Null-terminated Unicode string.\r
+  @param[in] FormatString   A Null-terminated Unicode format string.\r
+  @param[in] ...            The variable argument list whose contents are \r
+                            accessed based on the format string specified by \r
+                            FormatString.\r
+\r
+  @retval NULL    There was not enough available memory.\r
+  @return         Null-terminated Unicode string is that is the formatted \r
+                  string appended to String.\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+CatSPrint (\r
+  IN  CHAR16  *String, OPTIONAL\r
+  IN  CONST CHAR16  *FormatString,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Returns an array of protocol instance that matches the given protocol.\r
+\r
+  @param[in]  Protocol      Provides the protocol to search for.\r
+  @param[out] NoProtocols   The number of protocols returned in Buffer.\r
+  @param[out] Buffer        A pointer to the buffer to return the requested\r
+                            array of protocol instances that match Protocol.\r
+                            The returned buffer is allocated using\r
+                            EFI_BOOT_SERVICES.AllocatePool().  The caller is\r
+                            responsible for freeing this buffer with\r
+                            EFI_BOOT_SERVICES.FreePool().\r
+\r
+  @retval EFI_SUCCESS            The array of protocols was returned in Buffer,\r
+                                 and the number of protocols in Buffer was\r
+                                 returned in NoProtocols.\r
+  @retval EFI_NOT_FOUND          No protocols found.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough pool memory to store the\r
+                                 matching results.\r
+  @retval EFI_INVALID_PARAMETER  Protocol is NULL.\r
+  @retval EFI_INVALID_PARAMETER  NoProtocols is NULL.\r
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLocateProtocolBuffer (\r
+  IN  EFI_GUID  *Protocol,\r
+  OUT UINTN     *NoProtocols,\r
+  OUT VOID      ***Buffer\r
+  );\r
 #endif\r