]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
Cleanup "Tiano" word.
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index bbc4acab3395034d621024c16a1ed5cd0ba745f5..f84829d84b1d5e5aa870e7ef2c96f8bf2649f54e 100644 (file)
 #include <Protocol/DriverDiagnostics.h>\r
 #include <Protocol/DriverDiagnostics2.h>\r
 \r
-//\r
-// Unicode String Table\r
-//\r
+///\r
+/// Limited buffer size recommended by RFC3066\r
+/// (42 characters plus a NULL terminator)\r
+///\r
+#define RFC_3066_ENTRY_SIZE             (42 + 1)\r
+\r
+///\r
+/// Unicode String Table\r
+///\r
 typedef struct {\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
@@ -144,9 +150,7 @@ EfiNamedEventSignal (
   can then immediately be restored back to the current TPL level with a call \r
   to RestoreTPL().\r
 \r
-  @param  VOID\r
-\r
-  @retvale EFI_TPL              The current TPL.\r
+  @return The current TPL.\r
 \r
 **/\r
 EFI_TPL\r
@@ -180,7 +184,6 @@ EfiInitializeLock (
   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
@@ -220,7 +223,7 @@ EfiInitializeLock (
   priority level of the mutual exclusion lock.  Then, it places the lock in the \r
   acquired state.\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
@@ -302,7 +305,7 @@ EfiTestManagedDevice (
 \r
   @param  ControllerHandle     A handle for a (parent) controller to test. \r
   @param  ChildHandle          A child handle to test.\r
-  @param  ConsumsedGuid        Supplies the protocol that the child controller\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
@@ -420,8 +423,7 @@ LookupUnicodeString2 (
   IN CONST EFI_UNICODE_STRING_TABLE  *UnicodeStringTable,\r
   OUT CHAR16                         **UnicodeString,\r
   IN BOOLEAN                         Iso639Language\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   This function adds a Unicode string to UnicodeStringTable.\r
@@ -532,8 +534,7 @@ AddUnicodeString2 (
   IN EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
   IN CONST CHAR16              *UnicodeString,\r
   IN BOOLEAN                   Iso639Language\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   This function frees the table of Unicode strings in UnicodeStringTable.\r
@@ -617,14 +618,15 @@ EfiSignalEventLegacyBoot (
   );\r
 \r
 /**\r
-  Create a Legacy Boot Event.  \r
+  Creates an EFI event in the Legacy Boot Event Group.  Prior to UEFI 2.0 this \r
+  was done via a non blessed UEFI extensions and this library abstracts the \r
+  implementation mechanism of this event from the caller.\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
+  This function abstracts the creation of the Legacy 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 to code form having to \r
+  change with the version of the specification supported.\r
+  If LegacyBootEvent is NULL, then ASSERT().\r
 \r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
 \r
@@ -667,16 +669,17 @@ EfiCreateEventLegacyBootEx (
   );\r
 \r
 /**\r
-  Create a Read to Boot Event.  \r
+  Create an EFI event in the Ready To Boot Event Group.  Prior to UEFI 2.0 this \r
+  was done via a non-standard UEFI extension, and this library abstracts the \r
+  implementation mechanism of this event from the caller. \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
+  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
@@ -701,7 +704,7 @@ 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
@@ -719,13 +722,17 @@ EfiCreateEventReadyToBootEx (
 /**\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
+  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
+  \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
+  \r
+  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  NameGuid          FV file name to use in FvDevicePathNode\r
 \r
@@ -740,14 +747,15 @@ EfiInitializeFwVolDevicepathNode (
 /**\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
+  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
+  \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
+  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
 \r
@@ -775,6 +783,8 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   @param ...      VARARG list consumed to process Format.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  \r
+  @return Number of Unicode characters printed to ConOut.\r
 \r
 **/\r
 UINTN\r
@@ -798,6 +808,8 @@ Print (
   @param ...      VARARG list consumed to process Format.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  \r
+  @return Number of Unicode characters printed to StdErr.\r
 \r
 **/\r
 UINTN\r
@@ -821,6 +833,8 @@ ErrorPrint (
   @param ...      VARARG list consumed to process Format.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  \r
+  @return Number of ASCII characters printed to ConOut.\r
 \r
 **/\r
 UINTN\r
@@ -844,6 +858,8 @@ AsciiPrint (
   @param ...      VARARG list consumed to process Format.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+  \r
+  @return Number of ASCII characters printed to ConErr.\r
 \r
 **/\r
 UINTN\r
@@ -983,4 +999,26 @@ EfiLibInstallAllDriverProtocols2 (
   IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2   OPTIONAL\r
   );\r
 \r
+/**\r
+  Determine what is the current language setting. The space reserved for Lang\r
+  must be at least RFC_3066_ENTRY_SIZE bytes;\r
+\r
+  If Lang is NULL, then ASSERT.\r
+\r
+  @param  Lang                   Pointer of system language. Lang will always be filled with \r
+                                         a valid RFC 3066 language string. If "PlatformLang" is not\r
+                                         set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang\r
+                                         is returned.\r
+\r
+  @return  EFI_SUCCESS     If the EFI Variable with "PlatformLang" is set and return in Lang.\r
+  @return  EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetCurrentLanguage (\r
+  OUT     CHAR8               *Lang\r
+  );\r
+\r
+\r
 #endif\r