]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index 18be1b6347d217c0f6126083154ee628fd58a037..be7da7fdf7dac177fad096b01ac13de07b5ac1ed 100644 (file)
 /** @file\r
-  MDE UEFI library functions and macros\r
+  Provides library functions for common UEFI operations. Only available to DXE\r
+  and UEFI module types.\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \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
+  The UEFI Library provides functions and macros that simplify the development of\r
+  UEFI Drivers and UEFI Applications.  These functions and macros help manage EFI\r
+  events, build simple locks utilizing EFI Task Priority Levels (TPLs), install\r
+  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
-  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
+  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) 2019, NVIDIA Corporation. All rights reserved.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #ifndef __UEFI_LIB_H__\r
 #define __UEFI_LIB_H__\r
 \r
-//\r
-// Unicode String Table\r
-//\r
+#include <IndustryStandard/Acpi.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
+#include <Protocol/GraphicsOutput.h>\r
+#include <Protocol/DevicePath.h>\r
+#include <Protocol/SimpleFileSystem.h>\r
+\r
+#include <Library/BaseLib.h>\r
+\r
+///\r
+/// Unicode String Table\r
+///\r
 typedef struct {\r
-  CHAR8   *Language;\r
-  CHAR16  *UnicodeString;\r
+  CHAR8     *Language;\r
+  CHAR16    *UnicodeString;\r
 } EFI_UNICODE_STRING_TABLE;\r
 \r
-//\r
-// EFI Lock Status\r
-//\r
+///\r
+/// EFI Lock Status\r
+///\r
 typedef enum {\r
   EfiLockUninitialized = 0,\r
   EfiLockReleased      = 1,\r
   EfiLockAcquired      = 2\r
 } EFI_LOCK_STATE;\r
 \r
-//\r
-// EFI Lock \r
-//\r
+///\r
+/// EFI Lock\r
+///\r
 typedef struct {\r
-  EFI_TPL         Tpl;\r
-  EFI_TPL         OwnerTpl;\r
-  EFI_LOCK_STATE  Lock;\r
+  EFI_TPL           Tpl;\r
+  EFI_TPL           OwnerTpl;\r
+  EFI_LOCK_STATE    Lock;\r
 } EFI_LOCK;\r
 \r
+/**\r
+  Macro that returns the number of 100 ns units for a specified number of microseconds.\r
+  This is useful for managing EFI timer events.\r
+\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
+\r
+**/\r
+#define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds)  MultU64x32((UINT64)(Microseconds), 10)\r
+\r
+/**\r
+  Macro that returns the number of 100 ns units for a specified number of milliseconds.\r
+  This is useful for managing EFI timer events.\r
+\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
+\r
+**/\r
+#define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds)  MultU64x32((UINT64)(Milliseconds), 10000)\r
+\r
+/**\r
+  Macro that returns the number of 100 ns units for a specified number of seconds.\r
+  This is useful for managing EFI timer events.\r
+\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
+\r
+**/\r
+#define EFI_TIMER_PERIOD_SECONDS(Seconds)  MultU64x32((UINT64)(Seconds), 10000000)\r
+\r
+/**\r
+  Macro that returns the a pointer to the next EFI_MEMORY_DESCRIPTOR in an array\r
+  returned from GetMemoryMap().\r
+\r
+  @param  MemoryDescriptor  A pointer to an EFI_MEMORY_DESCRIPTOR.\r
+\r
+  @param  Size              The size, in bytes, of the current EFI_MEMORY_DESCRIPTOR.\r
+\r
+  @return A pointer to the next EFI_MEMORY_DESCRIPTOR.\r
+\r
+**/\r
+#define NEXT_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) \\r
+  ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))\r
 \r
 /**\r
-  This function searches the list of configuration tables stored in the EFI System \r
-  Table for a table with a GUID that matches TableGuid.  If a match is found, \r
-  then a pointer to the configuration table is returned in Table, and EFI_SUCCESS \r
-  is returned.  If a matching GUID is not found, then EFI_NOT_FOUND is returned.\r
+  Retrieves a pointer to the system configuration table from the EFI System Table\r
+  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
+  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
@@ -57,49 +131,66 @@ typedef struct {
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-EfiGetSystemConfigurationTable (  \r
+EfiGetSystemConfigurationTable (\r
   IN  EFI_GUID  *TableGuid,\r
   OUT VOID      **Table\r
   );\r
 \r
 /**\r
-  This function causes the notification function to be executed for every protocol \r
-  of type ProtocolGuid instance that exists in the system when this function is \r
-  invoked.  In addition, every time a protocol of type ProtocolGuid instance is \r
-  installed or reinstalled, the notification function is also executed.\r
+  Creates and returns a notification event and registers that event with all the protocol\r
+  instances specified by ProtocolGuid.\r
+\r
+  This function causes the notification function to be executed for every protocol of type\r
+  ProtocolGuid instance that exists in the system when this function is invoked. If there are\r
+  no instances of ProtocolGuid in the handle database at the time this function is invoked,\r
+  then the notification function is still executed one time. In addition, every time a protocol\r
+  of type ProtocolGuid instance is installed or reinstalled, the notification function is also\r
+  executed. This function returns the notification event that was created.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
+  If NotifyTpl is not a legal TPL value, then ASSERT().\r
+  If NotifyFunction is NULL, then ASSERT().\r
+  If Registration is NULL, then ASSERT().\r
+\r
 \r
   @param  ProtocolGuid    Supplies GUID of the protocol upon whose installation the event is fired.\r
   @param  NotifyTpl       Supplies the task priority level of the event notifications.\r
   @param  NotifyFunction  Supplies the function to notify when the event is signaled.\r
   @param  NotifyContext   The context parameter to pass to NotifyFunction.\r
   @param  Registration    A pointer to a memory location to receive the registration value.\r
+                          This value is passed to LocateHandle() to obtain new handles that\r
+                          have been added that support the ProtocolGuid-specified protocol.\r
 \r
-  @return The notification event that was created. \r
+  @return The notification event that was created.\r
 \r
 **/\r
 EFI_EVENT\r
 EFIAPI\r
-EfiCreateProtocolNotifyEvent(\r
+EfiCreateProtocolNotifyEvent (\r
   IN  EFI_GUID          *ProtocolGuid,\r
   IN  EFI_TPL           NotifyTpl,\r
   IN  EFI_EVENT_NOTIFY  NotifyFunction,\r
-  IN  VOID              *NotifyContext,  OPTIONAL\r
-  OUT VOID              *Registration\r
+  IN  VOID              *NotifyContext   OPTIONAL,\r
+  OUT VOID              **Registration\r
   );\r
 \r
 /**\r
+  Creates a named event that can be signaled with EfiNamedEventSignal().\r
+\r
   This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.\r
-  This event is signaled with EfiNamedEventSignal().  This provide the ability for \r
-  one or more listeners on the same event named by the GUID specified by Name.\r
+  This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more\r
+  listeners on the same event named by the GUID specified by Name.\r
+  If Name is NULL, then ASSERT().\r
+  If NotifyTpl is not a legal TPL value, then ASSERT().\r
+  If NotifyFunction is NULL, then ASSERT().\r
 \r
   @param  Name                  Supplies GUID name of the event.\r
   @param  NotifyTpl             Supplies the task priority level of the event notifications.\r
   @param  NotifyFunction        Supplies the function to notify when the event is signaled.\r
-  @param  NotifyContext         The context parameter to pass to NotifyFunction. \r
+  @param  NotifyContext         The context parameter to pass to NotifyFunction.\r
   @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
@@ -108,18 +199,21 @@ EfiNamedEventListen (
   IN CONST EFI_GUID    *Name,\r
   IN EFI_TPL           NotifyTpl,\r
   IN EFI_EVENT_NOTIFY  NotifyFunction,\r
-  IN CONST VOID        *NotifyContext,  OPTIONAL\r
-  OUT VOID             *Registration    OPTIONAL\r
+  IN CONST VOID        *NotifyContext   OPTIONAL,\r
+  OUT VOID             *Registration OPTIONAL\r
   );\r
 \r
 /**\r
-  This function signals the named event specified by Name.  The named event must \r
-  have been created with EfiNamedEventListen().\r
+  Signals a named event created with EfiNamedEventListen().\r
 \r
-  @param  Name                  Supplies GUID name of the event.\r
+  This function signals the named event specified by Name. The named event must have been\r
+  created with EfiNamedEventListen().\r
+  If Name is NULL, then ASSERT().\r
+\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
@@ -129,13 +223,69 @@ EfiNamedEventSignal (
   );\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
+  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
+  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
+  @return The current TPL.\r
+\r
+**/\r
+EFI_TPL\r
+EFIAPI\r
+EfiGetCurrentTpl (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Initializes a basic mutual exclusion lock.\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
   priority level.  Since there is no preemption or multiprocessor support in EFI,\r
   acquiring the lock only consists of raising to the locks TPL.\r
+  If Lock is NULL, then ASSERT().\r
+  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
@@ -144,56 +294,64 @@ EFI_LOCK *
 EFIAPI\r
 EfiInitializeLock (\r
   IN OUT EFI_LOCK  *Lock,\r
-  IN EFI_TPL        Priority\r
+  IN EFI_TPL       Priority\r
   );\r
 \r
 /**\r
-  This macro initializes the contents of a basic mutual exclusion lock to the \r
-  released state.  Each lock provides mutual exclusion access at its task \r
+  Initializes a basic mutual exclusion lock.\r
+\r
+  This macro initializes the contents of a basic mutual exclusion lock to the\r
+  released state.  Each lock provides mutual exclusion access at its task\r
   priority level.  Since there is no preemption or multiprocessor support in EFI,\r
   acquiring the lock only consists of raising to the locks TPL.\r
 \r
-  @param  Lock      A pointer to the lock data structure to initialize.\r
   @param  Priority  The task priority level of the lock.\r
 \r
   @return The lock.\r
 \r
 **/\r
 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \\r
-  {Priority, EFI_TPL_APPLICATION, EfiLockReleased }\r
-\r
+  {Priority, TPL_APPLICATION, EfiLockReleased }\r
 \r
 /**\r
-  \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
+#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
-\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
-  This function raises the system's current task priority level to the task \r
-  priority level of the mutual exclusion lock.  Then, it places the lock in the \r
+  Acquires ownership of a lock.\r
+\r
+  This function raises the system's current task priority level to the task\r
+  priority level of the mutual exclusion lock.  Then, it places the lock in the\r
   acquired state.\r
+  If Lock is NULL, then ASSERT().\r
+  If Lock is not initialized, then ASSERT().\r
+  If Lock is already in the acquired state, then ASSERT().\r
 \r
-  @param  Priority  The task priority level of the lock.\r
+  @param  Lock              A pointer to the lock to acquire.\r
 \r
 **/\r
 VOID\r
@@ -203,9 +361,14 @@ EfiAcquireLock (
   );\r
 \r
 /**\r
-  This function raises the system's current task priority level to the task \r
-  priority level of the mutual exclusion lock.  Then, it attempts to place the \r
-  lock in the acquired state.\r
+  Acquires ownership of a lock.\r
+\r
+  This function raises the system's current task priority level to the task priority\r
+  level of the mutual exclusion lock.  Then, it attempts to place the lock in the acquired state.\r
+  If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned.\r
+  Otherwise, EFI_SUCCESS is returned.\r
+  If Lock is NULL, then ASSERT().\r
+  If Lock is not initialized, then ASSERT().\r
 \r
   @param  Lock              A pointer to the lock to acquire.\r
 \r
@@ -220,9 +383,14 @@ EfiAcquireLockOrFail (
   );\r
 \r
 /**\r
-  This function transitions a mutual exclusion lock from the acquired state to \r
-  the released state, and restores the system's task priority level to its \r
+  Releases ownership of a lock.\r
+\r
+  This function transitions a mutual exclusion lock from the acquired state to\r
+  the released state, and restores the system's task priority level to its\r
   previous level.\r
+  If Lock is NULL, then ASSERT().\r
+  If Lock is not initialized, then ASSERT().\r
+  If Lock is already in the released state, then ASSERT().\r
 \r
   @param  Lock  A pointer to the lock to release.\r
 \r
@@ -234,31 +402,108 @@ EfiReleaseLock (
   );\r
 \r
 /**\r
-  This function looks up a Unicode string in UnicodeStringTable.  If Language is \r
-  a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable\r
-  that matches the language code specified by Language, then it is returned in \r
-  UnicodeString.\r
+  Tests whether a controller handle is being managed by a specific driver.\r
+\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
+\r
+  @param  ControllerHandle     A handle for a controller to test.\r
+  @param  DriverBindingHandle  Specifies the driver binding handle for the\r
+                               driver.\r
+  @param  ProtocolGuid         Specifies the protocol that the driver specified\r
+                               by DriverBindingHandle opens in its Start()\r
+                               function.\r
+\r
+  @retval EFI_SUCCESS          ControllerHandle is managed by the driver\r
+                               specified by DriverBindingHandle.\r
+  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the driver\r
+                               specified by DriverBindingHandle.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestManagedDevice (\r
+  IN CONST EFI_HANDLE  ControllerHandle,\r
+  IN CONST EFI_HANDLE  DriverBindingHandle,\r
+  IN CONST EFI_GUID    *ProtocolGuid\r
+  );\r
+\r
+/**\r
+  Tests whether a child handle is a child device of the controller.\r
+\r
+  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
+\r
+  @param  ControllerHandle     A handle for a (parent) controller to test.\r
+  @param  ChildHandle          A child handle to test.\r
+  @param  ProtocolGuid         Supplies the protocol that the child controller\r
+                               opens on its parent controller.\r
+\r
+  @retval EFI_SUCCESS          ChildHandle is a child of the ControllerHandle.\r
+  @retval EFI_UNSUPPORTED      ChildHandle is not a child of the\r
+                               ControllerHandle.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestChildHandle (\r
+  IN CONST EFI_HANDLE  ControllerHandle,\r
+  IN CONST EFI_HANDLE  ChildHandle,\r
+  IN CONST EFI_GUID    *ProtocolGuid\r
+  );\r
+\r
+/**\r
+  This function checks the supported languages list for a target language,\r
+  This only supports RFC 4646 Languages.\r
+\r
+  @param  SupportedLanguages  The supported languages\r
+  @param  TargetLanguage      The target language\r
+\r
+  @retval Returns EFI_SUCCESS if the language is supported,\r
+          EFI_UNSUPPORTED otherwise\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IsLanguageSupported (\r
+  IN CONST CHAR8  *SupportedLanguages,\r
+  IN CONST CHAR8  *TargetLanguage\r
+  );\r
+\r
+/**\r
+  This function looks up a Unicode string in UnicodeStringTable.\r
+\r
+  If Language is a member of SupportedLanguages and a Unicode string is found in\r
+  UnicodeStringTable that matches the language code specified by Language, then it\r
+  is returned in UnicodeString.\r
 \r
-  @param  Language                A pointer to the ISO 639-2 language code for the \r
+  @param  Language                A pointer to the ISO 639-2 language code for the\r
                                   Unicode string to look up and return.\r
-  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes \r
-                                  that the Unicode string table supports.  Language \r
+  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
+                                  that the Unicode string table supports.  Language\r
                                   must be a member of this set.\r
   @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
   @param  UnicodeString           A pointer to the Unicode string from UnicodeStringTable\r
                                   that matches the language specified by Language.\r
 \r
-  @retval EFI_SUCCESS             The Unicode string that matches the language \r
+  @retval EFI_SUCCESS             The Unicode string that matches the language\r
                                   specified by Language was found\r
-                                  in the table of Unicoide strings UnicodeStringTable, \r
+                                  in the table of Unicode strings UnicodeStringTable,\r
                                   and it was returned in UnicodeString.\r
   @retval EFI_INVALID_PARAMETER   Language is NULL.\r
   @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
   @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
   @retval EFI_UNSUPPORTED         UnicodeStringTable is NULL.\r
-  @retval EFI_UNSUPPORTED         The language specified by Language is not a \r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not a\r
                                   member of SupportedLanguages.\r
-  @retval EFI_UNSUPPORTED         The language specified by Language is not \r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not\r
                                   supported by UnicodeStringTable.\r
 \r
 **/\r
@@ -271,15 +516,66 @@ LookupUnicodeString (
   OUT CHAR16                         **UnicodeString\r
   );\r
 \r
+/**\r
+  This function looks up a Unicode string in UnicodeStringTable.\r
+\r
+  If Language is a member of SupportedLanguages and a Unicode string is found in\r
+  UnicodeStringTable that matches the language code specified by Language, then\r
+  it is returned in UnicodeString.\r
+\r
+  @param  Language             A pointer to an ASCII string containing the ISO 639-2 or the\r
+                               RFC 4646 language code for the Unicode string to look up and\r
+                               return. If Iso639Language is TRUE, then this ASCII string is\r
+                               not assumed to be Null-terminated, and only the first three\r
+                               characters are used. If Iso639Language is FALSE, then this ASCII\r
+                               string must be Null-terminated.\r
+  @param  SupportedLanguages   A pointer to a Null-terminated ASCII string that contains a\r
+                               set of ISO 639-2 or RFC 4646 language codes that the Unicode\r
+                               string table supports.  Language must be a member of this set.\r
+                               If Iso639Language is TRUE, then this string contains one or more\r
+                               ISO 639-2 language codes with no separator characters. If Iso639Language\r
+                               is FALSE, then is string contains one or more RFC 4646 language\r
+                               codes separated by ';'.\r
+  @param  UnicodeStringTable   A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE\r
+                               is defined in "Related Definitions".\r
+  @param  UnicodeString        A pointer to the Null-terminated Unicode string from UnicodeStringTable\r
+                               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 the RFC 4646 language code format.\r
+\r
+\r
+  @retval  EFI_SUCCESS            The Unicode string that matches the language specified by Language\r
+                                  was found in the table of Unicode strings UnicodeStringTable, and\r
+                                  it was returned in UnicodeString.\r
+  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
+  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
+  @retval  EFI_UNSUPPORTED        UnicodeStringTable is NULL.\r
+  @retval  EFI_UNSUPPORTED        The language specified by Language is not a member of SupportedLanguages.\r
+  @retval  EFI_UNSUPPORTED        The language specified by Language is not supported by UnicodeStringTable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LookupUnicodeString2 (\r
+  IN CONST CHAR8                     *Language,\r
+  IN CONST CHAR8                     *SupportedLanguages,\r
+  IN CONST EFI_UNICODE_STRING_TABLE  *UnicodeStringTable,\r
+  OUT CHAR16                         **UnicodeString,\r
+  IN BOOLEAN                         Iso639Language\r
+  );\r
+\r
 /**\r
   This function adds a Unicode string to UnicodeStringTable.\r
-  If Language is a member of SupportedLanguages then UnicodeString is added to \r
-  UnicodeStringTable.  New buffers are allocated for both Language and \r
-  UnicodeString.  The contents of Language and UnicodeString are copied into \r
-  these new buffers.  These buffers are automatically freed when \r
+\r
+  If Language is a member of SupportedLanguages then UnicodeString is added to\r
+  UnicodeStringTable.  New buffers are allocated for both Language and\r
+  UnicodeString.  The contents of Language and UnicodeString are copied into\r
+  these new buffers.  These buffers are automatically freed when\r
   FreeUnicodeStringTable() is called.\r
 \r
-  @param  Language                A pointer to the ISO 639-2 language code for the Unicode \r
+  @param  Language                A pointer to the ISO 639-2 language code for the Unicode\r
                                   string to add.\r
   @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
                                   that the Unicode string table supports.\r
@@ -287,35 +583,88 @@ LookupUnicodeString (
   @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
   @param  UnicodeString           A pointer to the Unicode string to add.\r
 \r
-  @retval EFI_SUCCESS             The Unicode string that matches the language \r
-                                  specified by Language was found in the table of \r
-                                  Unicode strings UnicodeStringTable, and it was \r
+  @retval EFI_SUCCESS             The Unicode string that matches the language\r
+                                  specified by Language was found in the table of\r
+                                  Unicode strings UnicodeStringTable, and it was\r
                                   returned in UnicodeString.\r
   @retval EFI_INVALID_PARAMETER   Language is NULL.\r
   @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
   @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
   @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
-  @retval EFI_ALREADY_STARTED     A Unicode string with language Language is \r
+  @retval EFI_ALREADY_STARTED     A Unicode string with language Language is\r
                                   already present in UnicodeStringTable.\r
-  @retval EFI_OUT_OF_RESOURCES    There is not enough memory to add another \r
+  @retval EFI_OUT_OF_RESOURCES    There is not enough memory to add another\r
                                   Unicode string to UnicodeStringTable.\r
-  @retval EFI_UNSUPPORTED         The language specified by Language is not a \r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not a\r
                                   member of SupportedLanguages.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 AddUnicodeString (\r
-  IN CONST CHAR8               *Language,\r
-  IN CONST CHAR8               *SupportedLanguages,\r
-  IN EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
-  IN CONST CHAR16              *UnicodeString\r
+  IN     CONST CHAR8               *Language,\r
+  IN     CONST CHAR8               *SupportedLanguages,\r
+  IN OUT EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
+  IN     CONST CHAR16              *UnicodeString\r
+  );\r
+\r
+/**\r
+  This function adds the Null-terminated Unicode string specified by UnicodeString\r
+  to UnicodeStringTable.\r
+\r
+  If Language is a member of SupportedLanguages then UnicodeString is added to\r
+  UnicodeStringTable.  New buffers are allocated for both Language and UnicodeString.\r
+  The contents of Language and UnicodeString are copied into these new buffers.\r
+  These buffers are automatically freed when EfiLibFreeUnicodeStringTable() is called.\r
+\r
+  @param  Language            A pointer to an ASCII string containing the ISO 639-2 or\r
+                              the RFC 4646 language code for the Unicode string to add.\r
+                              If Iso639Language is TRUE, then this ASCII string is not\r
+                              assumed to be Null-terminated, and only the first three\r
+                              chacters are used. If Iso639Language is FALSE, then this\r
+                              ASCII string must be Null-terminated.\r
+  @param  SupportedLanguages  A pointer to a Null-terminated ASCII string that contains\r
+                              a set of ISO 639-2 or RFC 4646 language codes that the Unicode\r
+                              string table supports.  Language must be a member of this set.\r
+                              If Iso639Language is TRUE, then this string contains one or more\r
+                              ISO 639-2 language codes with no separator characters.\r
+                              If Iso639Language is FALSE, then is string contains one or more\r
+                              RFC 4646 language codes separated by ';'.\r
+  @param  UnicodeStringTable  A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE\r
+                              is defined in "Related Definitions".\r
+  @param  UnicodeString       A pointer to the Unicode string to add.\r
+  @param  Iso639Language      Specifies the supported language code format. If it is TRUE,\r
+                              then Language and SupportedLanguages follow ISO 639-2 language code format.\r
+                              Otherwise, they follow RFC 4646 language code format.\r
+\r
+  @retval EFI_SUCCESS            The Unicode string that matches the language specified by\r
+                                 Language was found in the table of Unicode strings UnicodeStringTable,\r
+                                 and it was returned in UnicodeString.\r
+  @retval EFI_INVALID_PARAMETER  Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
+  @retval EFI_INVALID_PARAMETER  UnicodeString is an empty string.\r
+  @retval EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
+  @retval EFI_ALREADY_STARTED    A Unicode string with language Language is already present in\r
+                                 UnicodeStringTable.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough memory to add another Unicode string UnicodeStringTable.\r
+  @retval EFI_UNSUPPORTED        The language specified by Language is not a member of SupportedLanguages.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AddUnicodeString2 (\r
+  IN     CONST CHAR8               *Language,\r
+  IN     CONST CHAR8               *SupportedLanguages,\r
+  IN OUT EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
+  IN     CONST CHAR16              *UnicodeString,\r
+  IN     BOOLEAN                   Iso639Language\r
   );\r
 \r
 /**\r
   This function frees the table of Unicode strings in UnicodeStringTable.\r
+\r
   If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r
-  Otherwise, each language code, and each Unicode string in the Unicode string \r
+  Otherwise, each language code, and each Unicode string in the Unicode string\r
   table are freed, and EFI_SUCCESS is returned.\r
 \r
   @param  UnicodeStringTable  A pointer to the table of Unicode strings.\r
@@ -330,8 +679,174 @@ FreeUnicodeStringTable (
   );\r
 \r
 /**\r
-  This function computes and returns the width of the Unicode character \r
-  specified by UnicodeChar.\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
+  @retval EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @retval EFI_SUCCESS               Find the specified variable.\r
+  @retval 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
+  @retval EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @retval EFI_SUCCESS               Find the specified variable.\r
+  @retval 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
+/** Return the attributes of the variable.\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().  The attributes are returned if\r
+  the caller provides a valid Attribute parameter.\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
+  @param[out] Attr  The pointer to the variable attributes as found in var store\r
+\r
+  @retval EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @retval EFI_SUCCESS               Find the specified variable.\r
+  @retval Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetVariable3 (\r
+  IN CONST CHAR16    *Name,\r
+  IN CONST EFI_GUID  *Guid,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL,\r
+  OUT UINT32         *Attr OPTIONAL\r
+  );\r
+\r
+/**\r
+  Returns a pointer to an allocated buffer that contains the best matching language\r
+  from a set of supported languages.\r
+\r
+  This function supports both ISO 639-2 and RFC 4646 language codes, but language\r
+  code types may not be mixed in a single call to this function.  The language\r
+  code returned is allocated using AllocatePool().  The caller is responsible for\r
+  freeing the allocated buffer using FreePool().  This function supports a variable\r
+  argument list that allows the caller to pass in a prioritized list of language\r
+  codes to test against all the language codes in SupportedLanguages.\r
+\r
+  If SupportedLanguages is NULL, then ASSERT().\r
+\r
+  @param[in]  SupportedLanguages  A pointer to a Null-terminated ASCII string that\r
+                                  contains a set of language codes in the format\r
+                                  specified by Iso639Language.\r
+  @param[in]  Iso639Language      If not zero, then all language codes are assumed to be\r
+                                  in ISO 639-2 format.  If zero, then all language\r
+                                  codes are assumed to be in RFC 4646 language format\r
+  @param[in]  ...                 A variable argument list that contains pointers to\r
+                                  Null-terminated ASCII strings that contain one or more\r
+                                  language codes in the format specified by Iso639Language.\r
+                                  The first language code from each of these language\r
+                                  code lists is used to determine if it is an exact or\r
+                                  close match to any of the language codes in\r
+                                  SupportedLanguages.  Close matches only apply to RFC 4646\r
+                                  language codes, and the matching algorithm from RFC 4647\r
+                                  is used to determine if a close match is present.  If\r
+                                  an exact or close match is found, then the matching\r
+                                  language code from SupportedLanguages is returned.  If\r
+                                  no matches are found, then the next variable argument\r
+                                  parameter is evaluated.  The variable argument list\r
+                                  is terminated by a NULL.\r
+\r
+  @retval NULL   The best matching language could not be found in SupportedLanguages.\r
+  @retval NULL   There are not enough resources available to return the best matching\r
+                 language.\r
+  @retval Other  A pointer to a Null-terminated ASCII string that is the best matching\r
+                 language in SupportedLanguages.\r
+\r
+**/\r
+CHAR8 *\r
+EFIAPI\r
+GetBestLanguage (\r
+  IN CONST CHAR8  *SupportedLanguages,\r
+  IN UINTN        Iso639Language,\r
+  ...\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
+\r
+  This function computes and returns the width of the Unicode character specified\r
+  by UnicodeChar.\r
 \r
   @param  UnicodeChar   A Unicode character.\r
 \r
@@ -347,16 +862,20 @@ GetGlyphWidth (
   );\r
 \r
 /**\r
-  This function computes and returns the display length of\r
-  the Null-terminated Unicode string specified by String.\r
-  If String is NULL, then 0 is returned.\r
-  If any of the widths of the Unicode characters in String\r
-  can not be determined, then 0 is returned.\r
+  Computes the display length of a Null-terminated Unicode String.\r
+\r
+  This function computes and returns the display length of the Null-terminated Unicode\r
+  string specified by String.  If String is NULL then 0 is returned. If any of the widths\r
+  of the Unicode characters in String can not be determined, then 0 is returned. The display\r
+  width of String can be computed by summing the display widths of each Unicode character\r
+  in String.  Unicode characters that are narrow glyphs have a width of 1, and Unicode\r
+  characters that are width glyphs have a width of 2.\r
+  If String is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param  String      A pointer to a Null-terminated Unicode string.\r
 \r
   @return The display length of the Null-terminated Unicode string specified by String.\r
-  \r
+\r
 **/\r
 UINTN\r
 EFIAPI\r
@@ -367,11 +886,14 @@ UnicodeStringDisplayLength (
 //\r
 // Functions that abstract early Framework contamination of UEFI.\r
 //\r
+\r
 /**\r
-  Signal a Ready to Boot Event.  \r
-  \r
-  Create a Ready to Boot Event. Signal it and close it. This causes other \r
-  events of the same event group to be signaled in other modules. \r
+  Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().\r
+\r
+  This function abstracts the signaling of the Ready to Boot Event. The Framework moved\r
+  from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller\r
+  from how this event is created to prevent to code form having to change with the\r
+  version of the specification supported.\r
 \r
 **/\r
 VOID\r
@@ -381,10 +903,12 @@ EfiSignalEventReadyToBoot (
   );\r
 \r
 /**\r
-  Signal a Legacy Boot Event.  \r
-  \r
-  Create a legacy Boot Event. Signal it and close it. This causes other \r
-  events of the same event group to be signaled in other modules. \r
+  Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().\r
+\r
+  This function abstracts the signaling of the Legacy Boot Event. The Framework moved from\r
+  a proprietary to UEFI 2.0 based mechanism.  This library abstracts the caller from how\r
+  this event is created to prevent to code form having to change with the version of the\r
+  specification supported.\r
 \r
 **/\r
 VOID\r
@@ -394,19 +918,20 @@ EfiSignalEventLegacyBoot (
   );\r
 \r
 /**\r
-  Create a Legacy Boot Event.  \r
-  \r
-  Tiano extended the CreateEvent Type enum to add a legacy boot event type. \r
-  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
-  added and now it's possible to not voilate the UEFI specification by \r
-  declaring a GUID for the legacy boot event class. This library supports\r
-  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to \r
-  work both ways.\r
+  Creates an EFI event in the Legacy Boot Event Group.\r
+\r
+  Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library\r
+  abstracts the implementation mechanism of this event from the caller. This function\r
+  abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary\r
+  to UEFI 2.0 based mechanism.  This library abstracts the caller from how this event\r
+  is created to prevent to code form having to change with the version of the\r
+  specification supported.\r
+  If LegacyBootEvent is NULL, then ASSERT().\r
 \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
@@ -417,8 +942,8 @@ EfiCreateEventLegacyBoot (
 \r
 /**\r
   Create an EFI event in the Legacy Boot Event Group and allows\r
-  the caller to specify a notification function.  \r
-  \r
+  the caller to specify a notification function.\r
+\r
   This function abstracts the creation of the Legacy Boot Event.\r
   The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
   This library abstracts the caller from how this event is created to prevent\r
@@ -430,33 +955,34 @@ 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
 EFIAPI\r
 EfiCreateEventLegacyBootEx (\r
   IN  EFI_TPL           NotifyTpl,\r
-  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
-  IN  VOID              *NotifyContext,  OPTIONAL\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction   OPTIONAL,\r
+  IN  VOID              *NotifyContext   OPTIONAL,\r
   OUT EFI_EVENT         *LegacyBootEvent\r
   );\r
 \r
 /**\r
-  Create a Read to Boot Event.  \r
-  \r
-  Tiano extended the CreateEvent Type enum to add a ready to boot event type. \r
-  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
-  added and now it's possible to not voilate the UEFI specification and use \r
-  the ready to boot event class defined in UEFI 2.0. This library supports\r
-  the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to \r
-  work both ways.\r
+  Create an EFI event in the Ready To Boot Event Group.\r
+\r
+  Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library\r
+  abstracts the implementation mechanism of this event from the caller.\r
+  This function abstracts the creation of the Ready to Boot Event.  The Framework\r
+  moved from a proprietary to UEFI 2.0-based mechanism.  This library abstracts\r
+  the caller from how this event is created to prevent the code form having to\r
+  change with the version of the specification supported.\r
+  If ReadyToBootEvent is NULL, then ASSERT().\r
 \r
-  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\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
@@ -467,8 +993,8 @@ EfiCreateEventReadyToBoot (
 \r
 /**\r
   Create an EFI event in the Ready To Boot Event Group and allows\r
-  the caller to specify a notification function.  \r
-  \r
+  the caller to specify a notification function.\r
+\r
   This function abstracts the creation of the Ready to Boot Event.\r
   The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
   This library abstracts the caller from how this event is created to prevent\r
@@ -478,32 +1004,34 @@ EfiCreateEventReadyToBoot (
   @param  NotifyTpl         The task priority level of the event.\r
   @param  NotifyFunction    The notification function to call when the event is signaled.\r
   @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
+  @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
 EFIAPI\r
 EfiCreateEventReadyToBootEx (\r
   IN  EFI_TPL           NotifyTpl,\r
-  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
-  IN  VOID              *NotifyContext,  OPTIONAL\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction   OPTIONAL,\r
+  IN  VOID              *NotifyContext   OPTIONAL,\r
   OUT EFI_EVENT         *ReadyToBootEvent\r
   );\r
 \r
 /**\r
   Initialize a Firmware Volume (FV) Media Device Path node.\r
-  \r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for Tiano extensions of device path. If the code \r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability.\r
-\r
-  @param  FvDevicePathNode  Pointer to a FV device path node to initialize\r
+\r
+  The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.\r
+  This library function abstracts initializing a device path node.\r
+  Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure.  This device\r
+  path changed in the DXE CIS version 0.92 in a non back ward compatible way to\r
+  not conflict with the UEFI 2.0 specification.  This function abstracts the\r
+  differences from the caller.\r
+  If FvDevicePathNode is NULL, then ASSERT().\r
+  If NameGuid is NULL, then ASSERT().\r
+\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
@@ -515,18 +1043,18 @@ EfiInitializeFwVolDevicepathNode (
   );\r
 \r
 /**\r
-  Check to see if the Firmware Volume (FV) Media Device Path is valid \r
-  \r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for Tiano extensions of device path. If the code \r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability. The return value to this\r
-  function points to a location in FvDevicePathNode and it does not allocate\r
-  new memory for the GUID pointer that is returned.\r
+  Check to see if the Firmware Volume (FV) Media Device Path is valid\r
 \r
-  @param  FvDevicePathNode  Pointer to FV device path to check.\r
+  The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.\r
+  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 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  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
@@ -538,5 +1066,684 @@ 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
+  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   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
+\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
+  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   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
+\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
+  If Format is NULL, then ASSERT().\r
+  If gST->ConOut is NULL, then ASSERT().\r
+\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
+\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
+  If Format is NULL, then ASSERT().\r
+  If gST->StdErr is NULL, then ASSERT().\r
+\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
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiErrorPrint (\r
+  IN CONST CHAR8  *Format,\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 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
+  outside the active display region will not be displayed.\r
+\r
+  If a graphics console device is not associated with the ConsoleOutputHandle\r
+  defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
+  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 Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  If gST->ConsoleOutputHandle is NULL, then ASSERT().\r
+\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
+                       in the EFI_SYSTEM_TABLE is used.\r
+  @param  BackGround   The background color of the string being printed.  This is\r
+                       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       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
+\r
+  @return  The number of Unicode characters printed.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+PrintXY (\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
+  ...\r
+  );\r
+\r
+/**\r
+  Prints a formatted ASCII 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 ASCII string to the graphics console device\r
+  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of\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
+  outside the active display region will not be displayed.\r
+\r
+  If a graphics console device is not associated with the ConsoleOutputHandle\r
+  defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
+  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  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
+                       in the EFI_SYSTEM_TABLE is used.\r
+  @param  BackGround   The background color of the string being printed.  This is\r
+                       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       A null-terminated ASCII format string.  See Print Library\r
+                       for the supported format string syntax.\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
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiPrintXY (\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
+  ...\r
+  );\r
+\r
+/**\r
+  Installs and completes the initialization of a Driver Binding Protocol instance.\r
+\r
+  Installs the Driver Binding Protocol specified by DriverBinding onto the handle\r
+  specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding\r
+  is installed onto a newly created handle. DriverBindingHandle is typically the same\r
+  as the driver's ImageHandle, but it can be different if the driver produces multiple\r
+  Driver Binding Protocols.\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If DriverBinding can not be installed onto a handle, then ASSERT().\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 installed onto.  If this\r
+                               parameter is NULL, then a new handle is created.\r
+\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
+**/\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
+  Uninstalls a Driver Binding Protocol instance.\r
+\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If DriverBinding can not be uninstalled, then ASSERT().\r
+\r
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.\r
+\r
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.\r
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibUninstallDriverBinding (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding\r
+  );\r
+\r
+/**\r
+  Installs and completes the initialization of a Driver Binding Protocol instance and\r
+  optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.\r
+\r
+  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
+  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
+  If the installation fails, then ASSERT().\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 installed onto.  If this\r
+                               parameter is NULL, then a new handle is created.\r
+  @param  ComponentName        A Component Name Protocol instance that this driver is producing.\r
+  @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 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
+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
+  Uninstalls a Driver Binding Protocol instance and optionally uninstalls the\r
+  Component Name, Driver Configuration and Driver Diagnostics Protocols.\r
+\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If the uninstallation fails, then ASSERT().\r
+\r
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.\r
+  @param  ComponentName        A Component Name Protocol instance that this driver produced.\r
+  @param  DriverConfiguration  A Driver Configuration Protocol instance that this driver produced.\r
+  @param  DriverDiagnostics    A Driver Diagnostics Protocol instance that this driver produced.\r
+\r
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.\r
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibUninstallAllDriverProtocols (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\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
+  Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.\r
+\r
+  Initializes a driver by installing the Driver Binding Protocol together with the\r
+  optional Component Name and optional Component Name 2 protocols onto the driver's\r
+  DriverBindingHandle.  If DriverBindingHandle is NULL, then the protocols are installed\r
+  onto a newly created handle.  DriverBindingHandle is typically the same as the driver's\r
+  ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols.\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If the installation fails, then ASSERT().\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 installed onto.  If this\r
+                               parameter is NULL, then a new handle is created.\r
+  @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 completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallDriverBindingComponentName2 (\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
+  );\r
+\r
+/**\r
+  Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.\r
+\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If the uninstallation fails, then ASSERT().\r
+\r
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.\r
+  @param  ComponentName        A Component Name Protocol instance that this driver produced.\r
+  @param  ComponentName2       A Component Name 2 Protocol instance that this driver produced.\r
+\r
+  @retval EFI_SUCCESS           The protocol installation successfully completed.\r
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibUninstallDriverBindingComponentName2 (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL         *DriverBinding,\r
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL   *ComponentName        OPTIONAL,\r
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL  *ComponentName2       OPTIONAL\r
+  );\r
+\r
+/**\r
+  Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver\r
+  Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.\r
+\r
+  Initializes a driver by installing the Driver Binding Protocol together with the optional\r
+  Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2,\r
+  optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle.\r
+  DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver\r
+  produces multiple Driver Binding Protocols.\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If the installation fails, then ASSERT().\r
+\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 installed onto.  If this\r
+                                parameter is NULL, then a new handle is created.\r
+  @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
+  @param  DriverConfiguration   A Driver Configuration Protocol instance that this driver is producing.\r
+  @param  DriverConfiguration2  A Driver Configuration Protocol 2 instance that this driver is producing.\r
+  @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 completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\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_CONFIGURATION2_PROTOCOL  *DriverConfiguration2  OPTIONAL,\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL     *DriverDiagnostics     OPTIONAL,\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL    *DriverDiagnostics2    OPTIONAL\r
+  );\r
+\r
+/**\r
+  Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver\r
+  Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.\r
+\r
+  If DriverBinding is NULL, then ASSERT().\r
+  If the installation fails, then ASSERT().\r
+\r
+\r
+  @param  DriverBinding         A Driver Binding Protocol instance that this driver produced.\r
+  @param  ComponentName         A Component Name Protocol instance that this driver produced.\r
+  @param  ComponentName2        A Component Name 2 Protocol instance that this driver produced.\r
+  @param  DriverConfiguration   A Driver Configuration Protocol instance that this driver produced.\r
+  @param  DriverConfiguration2  A Driver Configuration Protocol 2 instance that this driver produced.\r
+  @param  DriverDiagnostics     A Driver Diagnostics Protocol instance that this driver produced.\r
+  @param  DriverDiagnostics2    A Driver Diagnostics Protocol 2 instance that this driver produced.\r
+\r
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.\r
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibUninstallAllDriverProtocols2 (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL               *DriverBinding,\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_CONFIGURATION2_PROTOCOL  *DriverConfiguration2  OPTIONAL,\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL     *DriverDiagnostics     OPTIONAL,\r
+  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
+\r
+/**\r
+  Open or create a file or directory, possibly creating the chain of\r
+  directories leading up to the directory.\r
+\r
+  EfiOpenFileByDevicePath() first locates EFI_SIMPLE_FILE_SYSTEM_PROTOCOL on\r
+  FilePath, and opens the root directory of that filesystem with\r
+  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.OpenVolume().\r
+\r
+  On the remaining device path, the longest initial sequence of\r
+  FILEPATH_DEVICE_PATH nodes is node-wise traversed with\r
+  EFI_FILE_PROTOCOL.Open().\r
+\r
+  (As a consequence, if OpenMode includes EFI_FILE_MODE_CREATE, and Attributes\r
+  includes EFI_FILE_DIRECTORY, and each FILEPATH_DEVICE_PATH specifies a single\r
+  pathname component, then EfiOpenFileByDevicePath() ensures that the specified\r
+  series of subdirectories exist on return.)\r
+\r
+  The EFI_FILE_PROTOCOL identified by the last FILEPATH_DEVICE_PATH node is\r
+  output to the caller; intermediate EFI_FILE_PROTOCOL instances are closed. If\r
+  there are no FILEPATH_DEVICE_PATH nodes past the node that identifies the\r
+  filesystem, then the EFI_FILE_PROTOCOL of the root directory of the\r
+  filesystem is output to the caller. If a device path node that is different\r
+  from FILEPATH_DEVICE_PATH is encountered relative to the filesystem, the\r
+  traversal is stopped with an error, and a NULL EFI_FILE_PROTOCOL is output.\r
+\r
+  @param[in,out] FilePath  On input, the device path to the file or directory\r
+                           to open or create. The caller is responsible for\r
+                           ensuring that the device path pointed-to by FilePath\r
+                           is well-formed. On output, FilePath points one past\r
+                           the last node in the original device path that has\r
+                           been successfully processed. FilePath is set on\r
+                           output even if EfiOpenFileByDevicePath() returns an\r
+                           error.\r
+\r
+  @param[out] File         On error, File is set to NULL. On success, File is\r
+                           set to the EFI_FILE_PROTOCOL of the root directory\r
+                           of the filesystem, if there are no\r
+                           FILEPATH_DEVICE_PATH nodes in FilePath; otherwise,\r
+                           File is set to the EFI_FILE_PROTOCOL identified by\r
+                           the last node in FilePath.\r
+\r
+  @param[in] OpenMode      The OpenMode parameter to pass to\r
+                           EFI_FILE_PROTOCOL.Open().\r
+\r
+  @param[in] Attributes    The Attributes parameter to pass to\r
+                           EFI_FILE_PROTOCOL.Open().\r
+\r
+  @retval EFI_SUCCESS            The file or directory has been opened or\r
+                                 created.\r
+\r
+  @retval EFI_INVALID_PARAMETER  FilePath is NULL; or File is NULL; or FilePath\r
+                                 contains a device path node, past the node\r
+                                 that identifies\r
+                                 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, that is not a\r
+                                 FILEPATH_DEVICE_PATH node.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES   Memory allocation failed.\r
+\r
+  @return                        Error codes propagated from the\r
+                                 LocateDevicePath() and OpenProtocol() boot\r
+                                 services, and from the\r
+                                 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.OpenVolume()\r
+                                 and EFI_FILE_PROTOCOL.Open() member functions.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiOpenFileByDevicePath (\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL  **FilePath,\r
+  OUT    EFI_FILE_PROTOCOL         **File,\r
+  IN     UINT64                    OpenMode,\r
+  IN     UINT64                    Attributes\r
+  );\r
+\r
+/**\r
+  This function locates next ACPI table in XSDT/RSDT based on Signature and\r
+  previous returned Table.\r
+\r
+  If PreviousTable is NULL:\r
+  This function will locate the first ACPI table in XSDT/RSDT based on\r
+  Signature in gEfiAcpi20TableGuid system configuration table first, and then\r
+  gEfiAcpi10TableGuid system configuration table.\r
+  This function will locate in XSDT first, and then RSDT.\r
+  For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in\r
+  FADT.\r
+  For FACS, this function will locate XFirmwareCtrl in FADT first, and then\r
+  FirmwareCtrl in FADT.\r
+\r
+  If PreviousTable is not NULL:\r
+  1. If it could be located in XSDT in gEfiAcpi20TableGuid system configuration\r
+     table, then this function will just locate next table in XSDT in\r
+     gEfiAcpi20TableGuid system configuration table.\r
+  2. If it could be located in RSDT in gEfiAcpi20TableGuid system configuration\r
+     table, then this function will just locate next table in RSDT in\r
+     gEfiAcpi20TableGuid system configuration table.\r
+  3. If it could be located in RSDT in gEfiAcpi10TableGuid system configuration\r
+     table, then this function will just locate next table in RSDT in\r
+     gEfiAcpi10TableGuid system configuration table.\r
+\r
+  It's not supported that PreviousTable is not NULL but PreviousTable->Signature\r
+  is not same with Signature, NULL will be returned.\r
+\r
+  @param Signature          ACPI table signature.\r
+  @param PreviousTable      Pointer to previous returned table to locate next\r
+                            table, or NULL to locate first table.\r
+\r
+  @return Next ACPI table or NULL if not found.\r
+\r
+**/\r
+EFI_ACPI_COMMON_HEADER *\r
+EFIAPI\r
+EfiLocateNextAcpiTable (\r
+  IN UINT32                  Signature,\r
+  IN EFI_ACPI_COMMON_HEADER  *PreviousTable OPTIONAL\r
+  );\r
+\r
+/**\r
+  This function locates first ACPI table in XSDT/RSDT based on Signature.\r
+\r
+  This function will locate the first ACPI table in XSDT/RSDT based on\r
+  Signature in gEfiAcpi20TableGuid system configuration table first, and then\r
+  gEfiAcpi10TableGuid system configuration table.\r
+  This function will locate in XSDT first, and then RSDT.\r
+  For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in\r
+  FADT.\r
+  For FACS, this function will locate XFirmwareCtrl in FADT first, and then\r
+  FirmwareCtrl in FADT.\r
+\r
+  @param Signature          ACPI table signature.\r
+\r
+  @return First ACPI table or NULL if not found.\r
+\r
+**/\r
+EFI_ACPI_COMMON_HEADER *\r
+EFIAPI\r
+EfiLocateFirstAcpiTable (\r
+  IN UINT32  Signature\r
+  );\r
 \r
 #endif\r