]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code and comments have been checked with spec.
authorjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 20 Nov 2008 08:55:42 +0000 (08:55 +0000)
committerjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 20 Nov 2008 08:55:42 +0000 (08:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6650 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/UefiLib.h
MdePkg/Library/UefiLib/Console.c
MdePkg/Library/UefiLib/UefiDriverModel.c
MdePkg/Library/UefiLib/UefiLib.c
MdePkg/Library/UefiLib/UefiNotTiano.c
MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
MdePkg/Library/UefiRuntimeLib/RuntimeService.c

index eeffdc052f174d54a4256f74240f32d29b27ea49..84c1375f63e693a7b115e873e1014fee5176f500 100644 (file)
@@ -99,10 +99,15 @@ typedef struct {
 \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
@@ -119,18 +124,28 @@ EfiGetSystemConfigurationTable (
   );\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.\r
+  In addition, every time a protocol of type ProtocolGuid instance is installed or reinstalled,\r
+  the notification function is also executed.  This function returns the notification event\r
+  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
   @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
@@ -144,9 +159,14 @@ EfiCreateProtocolNotifyEvent(
   );\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
@@ -169,8 +189,11 @@ EfiNamedEventListen (
   );\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
+  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 GUID name of the event.\r
 \r
@@ -203,10 +226,14 @@ EfiGetCurrentTpl (
   );\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
@@ -244,7 +271,6 @@ EfiInitializeLock (
   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
-\r
   If Lock is NULL, then ASSERT().\r
 \r
   @param  LockParameter  A pointer to the lock to acquire.\r
@@ -262,9 +288,14 @@ EfiInitializeLock (
 \r
 \r
 /**\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  Lock              A pointer to the lock to acquire.\r
 \r
@@ -276,9 +307,13 @@ EfiAcquireLock (
   );\r
 \r
 /**\r
+  Acquires ownership of a lock.  If the lock is already owned , then an error is returned.\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
+  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
@@ -293,9 +328,14 @@ EfiAcquireLockOrFail (
   );\r
 \r
 /**\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
@@ -365,10 +405,11 @@ EfiTestChildHandle (
   );\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
+  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
                                   Unicode string to look up and return.\r
@@ -412,48 +453,38 @@ LookupUnicodeString (
   @param  Language                A pointer to the ISO 639-2 or\r
                                   RFC 3066 language code for the\r
                                   Unicode string to look up and\r
-                                  return.\r
-  \r
+                                  return.  \r
   @param  SupportedLanguages      A pointer to the set of ISO\r
                                   639-2 or RFC 3066 language\r
                                   codes that the Unicode string\r
                                   table supports. Language must\r
-                                  be a member of this set.\r
-  \r
+                                  be a member of this set.  \r
   @param  UnicodeStringTable      A pointer to the table of\r
-                                  Unicode strings.\r
-  \r
+                                  Unicode strings.  \r
   @param  UnicodeString           A pointer to the Unicode\r
                                   string from UnicodeStringTable\r
                                   that matches the language\r
                                   specified by Language.\r
-\r
   @param  Iso639Language          Specify the language code\r
                                   format supported. If true,\r
                                   then the format follow ISO\r
                                   639-2. If false, then it\r
                                   follows RFC3066.\r
-\r
   @retval  EFI_SUCCESS            The Unicode string that\r
                                   matches the language specified\r
                                   by Language was found in the\r
                                   table of Unicoide strings\r
                                   UnicodeStringTable, and it was\r
-                                  returned in UnicodeString.\r
-  \r
-  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
-  \r
-  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
-  \r
-  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
-  \r
-  @retval  EFI_UNSUPPORTED        UnicodeStringTable is NULL.\r
-  \r
+                                  returned in UnicodeString. \r
+\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\r
                                   Language is not a member\r
-                                  ofSupportedLanguages.\r
-  \r
-  @retval EFI_UNSUPPORTED         The language specified by\r
+                                  ofSupportedLanguages.  \r
+  @retval  EFI_UNSUPPORTED        The language specified by\r
                                   Language is not supported by\r
                                   UnicodeStringTable.\r
 \r
@@ -470,6 +501,7 @@ LookupUnicodeString2 (
 \r
 /**\r
   This function adds a Unicode string 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 \r
   UnicodeString.  The contents of Language and UnicodeString are copied into \r
@@ -510,8 +542,8 @@ AddUnicodeString (
   );\r
 \r
 /**\r
-  \r
   This function adds a Unicode string to UnicodeStringTable.\r
+\r
   If Language is a member of SupportedLanguages then\r
   UnicodeString is added to UnicodeStringTable.  New buffers are\r
   allocated for both Language and UnicodeString.  The contents\r
@@ -521,26 +553,21 @@ AddUnicodeString (
 \r
   @param  Language                A pointer to the ISO 639-2 or\r
                                   RFC 3066 language code for the\r
-                                  Unicode string to add.\r
-  \r
+                                  Unicode string to add.  \r
   @param  SupportedLanguages      A pointer to the set of ISO\r
                                   639-2 or RFC 3066 language\r
                                   codes that the Unicode string\r
                                   table supports. Language must\r
-                                  be a member of this set.\r
-  \r
+                                  be a member of this set.  \r
   @param  UnicodeStringTable      A pointer to the table of\r
-                                  Unicode strings.\r
-  \r
+                                  Unicode strings.  \r
   @param  UnicodeString           A pointer to the Unicode\r
-                                  string to add.\r
-  \r
+                                  string to add.  \r
   @param  Iso639Language          Specify the language code\r
                                   format supported. If true,\r
                                   then the format follow ISO\r
                                   639-2. If false, then it\r
                                   follows RFC3066.\r
-\r
   @retval EFI_SUCCESS             The Unicode string that\r
                                   matches the language specified\r
                                   by Language was found in the\r
@@ -548,22 +575,16 @@ AddUnicodeString (
                                   UnicodeStringTable, and it was\r
                                   returned in UnicodeString.\r
   \r
-  @retval EFI_INVALID_PARAMETER   Language is NULL.\r
-  \r
-  @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
-  \r
-  @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
-  \r
-  @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
-  \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\r
                                   Language is already present in\r
-                                  UnicodeStringTable.\r
-  \r
+                                  UnicodeStringTable.  \r
   @retval EFI_OUT_OF_RESOURCES    There is not enough memory to\r
                                   add another Unicode string to\r
-                                  UnicodeStringTable.\r
-  \r
+                                  UnicodeStringTable.  \r
   @retval EFI_UNSUPPORTED         The language specified by\r
                                   Language is not a member of\r
                                   SupportedLanguages.\r
@@ -581,6 +602,7 @@ AddUnicodeString2 (
 \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
   table are freed, and EFI_SUCCESS is returned.\r
@@ -614,6 +636,8 @@ GetGlyphWidth (
   );\r
 \r
 /**\r
+  Computes the display length of a Null-terminated Unicode String.\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
@@ -635,10 +659,12 @@ UnicodeStringDisplayLength (
 // Functions that abstract early Framework contamination of UEFI.\r
 //\r
 /**\r
-  Signal a Ready to Boot Event.  \r
+  Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().\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
+  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 from\r
+  how this event is created to prevent to code form having to change with the version of\r
+  the specification supported.\r
 \r
 **/\r
 VOID\r
@@ -648,10 +674,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
@@ -766,13 +794,11 @@ EfiCreateEventReadyToBootEx (
   Initialize a Firmware Volume (FV) Media Device Path node.\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
+  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
-  \r
   If FvDevicePathNode is NULL, then ASSERT().\r
   If NameGuid is NULL, then ASSERT().\r
   \r
@@ -792,7 +818,6 @@ EfiInitializeFwVolDevicepathNode (
   \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
@@ -821,12 +846,12 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   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
 \r
   @param Format   Null-terminated Unicode format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by 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
@@ -847,12 +872,12 @@ Print (
   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
 \r
   @param Format   Null-terminated Unicode format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by 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
@@ -873,12 +898,12 @@ ErrorPrint (
   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 Format is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by 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
@@ -899,12 +924,12 @@ AsciiPrint (
   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 Format is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
   @param ...      Variable argument list whose contents are accessed based \r
                   on the format string specified by 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
@@ -1016,7 +1041,9 @@ AsciiPrintXY (
 \r
 /**\r
   Initializes a driver by installing the Driver Binding Protocol onto the driver's\r
-  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but\r
+  DriverBindingHandle.\r
+\r
+  This is typically the same as the driver's ImageHandle, but\r
   it can be different if the driver produces multiple DriverBinding Protocols. \r
   If the Driver Binding Protocol interface is NULL, then ASSERT (). \r
   If the installation fails, then ASSERT ().\r
@@ -1028,6 +1055,7 @@ AsciiPrintXY (
                                       parameter is NULL, then a new handle is created.\r
 \r
   @retval EFI_SUCCESS                 The protocol installation is 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
@@ -1043,8 +1071,9 @@ EfiLibInstallDriverBinding (
 \r
 /**\r
   Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
-  Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle.  This is\r
-  typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
+  Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle.\r
+\r
+  This is  typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
   DriverBinding Protocols. \r
   If the Driver Binding Protocol interface is NULL, then ASSERT (). \r
   If the installation fails, then ASSERT ().\r
@@ -1110,7 +1139,9 @@ EfiLibInstallDriverBindingComponentName2 (
 /**\r
   Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
   Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's\r
-  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but it can be different if\r
+  DriverBindingHandle.\r
+\r
+  This is typically the same as the driver's ImageHandle, but it can be different if\r
   the driver produces multiple DriverBinding Protocols. \r
   If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
   If the installation fails, then ASSERT ().\r
@@ -1152,10 +1183,9 @@ EfiLibInstallAllDriverProtocols2 (
 \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
+  @param  Lang   Pointer of system language. Lang will always be filled with a valid RFC 3066\r
+                 language string. If "PlatformLang" is not set in the system, the default\r
+                 language specifed by PcdUefiVariableDefaultPlatformLang 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
index ef4419bbb7d325b44e2e61aa475e44f6468d761f..110b19029f258cfc8a5e0cc76540c6350af9f630 100644 (file)
@@ -244,6 +244,8 @@ GetGlyphWidth (
 }\r
 \r
 /**\r
+  Computes the display length of a Null-terminated Unicode String.\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
index d1bc7b68b6eca3f33456f90f93cd1556edd634b5..2fe7a107965aba2e08ccfd218ee11f550299a74d 100644 (file)
 #include "UefiLibInternal.h"\r
 \r
 /**\r
-  Intialize a driver by installing the Driver Binding Protocol onto the driver's\r
-  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but\r
+  Initializes a driver by installing the Driver Binding Protocol onto the driver's\r
+  DriverBindingHandle.\r
+\r
+  This is typically the same as the driver's ImageHandle, but\r
   it can be different if the driver produces multiple DriverBinding Protocols. \r
-  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+  If the Driver Binding Protocol interface 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 installe onto.  If this\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 is 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
@@ -67,17 +70,18 @@ EfiLibInstallDriverBinding (
 \r
 \r
 /**\r
-  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
-  Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle.  This is\r
-  typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
+  Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+  Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle.\r
+\r
+  This is  typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
   DriverBinding Protocols. \r
-  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+  If the Driver Binding Protocol interface 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 installe onto.  If this\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
@@ -279,7 +283,9 @@ EfiLibInstallDriverBindingComponentName2 (
 /**\r
   Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
   Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's\r
-  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but it can be different if\r
+  DriverBindingHandle.\r
+\r
+  This is typically the same as the driver's ImageHandle, but it can be different if\r
   the driver produces multiple DriverBinding Protocols. \r
   If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
   If the installation fails, then ASSERT ().\r
index 1e960174abc54c16ca99d081183ade929e72da2c..53a46106e158bd5d6364438e24433b1bfbb78706 100644 (file)
@@ -45,10 +45,13 @@ CompareIso639LanguageCode (
 }\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
@@ -85,16 +88,26 @@ EfiGetSystemConfigurationTable (
 }\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.\r
+  In addition, every time a protocol of type ProtocolGuid instance is installed or reinstalled,\r
+  the notification function is also executed.  This function returns the notification event\r
+  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
   @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
 \r
@@ -112,6 +125,10 @@ EfiCreateProtocolNotifyEvent(
   EFI_STATUS  Status;\r
   EFI_EVENT   Event;\r
 \r
+  ASSERT (ProtocolGuid != NULL);\r
+  ASSERT (NotifyFunction != NULL);\r
+  ASSERT (Registration != NULL);\r
+\r
   //\r
   // Create the event\r
   //\r
@@ -147,9 +164,11 @@ EfiCreateProtocolNotifyEvent(
 }\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
@@ -157,7 +176,7 @@ EfiCreateProtocolNotifyEvent(
   @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
@@ -219,8 +238,11 @@ EfiNamedEventListen (
 }\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
+  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 GUID name of the event.\r
 \r
@@ -237,6 +259,8 @@ EfiNamedEventSignal (
   EFI_STATUS  Status;\r
   EFI_HANDLE  Handle;\r
 \r
+  ASSERT(Name != NULL);\r
+\r
   Handle = NULL;\r
   Status = gBS->InstallProtocolInterface (\r
                   &Handle,\r
@@ -286,8 +310,10 @@ EfiGetCurrentTpl (
 \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
+  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
@@ -316,14 +342,16 @@ EfiInitializeLock (
 }\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  Lock   The task lock with priority level.\r
+  @param  Lock              A pointer to the lock to acquire.\r
 \r
 **/\r
 VOID\r
@@ -340,9 +368,13 @@ 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
+  Acquires ownership of a lock.  If the lock is already owned , then an error is returned.\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
+  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
@@ -375,9 +407,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
@@ -527,50 +564,32 @@ EfiTestChildHandle (
 \r
 /**\r
   This function looks up a Unicode string in UnicodeStringTable.\r
-  If Language is a member of SupportedLanguages and a Unicode\r
-  string is found in UnicodeStringTable that matches the\r
-  language code specified by Language, then it is returned in\r
-  UnicodeString.\r
-\r
-  @param  Language                A pointer to the ISO 639-2\r
-                                  language code for the Unicode\r
-                                  string to look up and return.\r
-  \r
-  @param  SupportedLanguages      A pointer to the set of ISO\r
-                                  639-2language\r
-                                  codes that the Unicode string\r
-                                  table supports. Language must\r
-                                  be a member of this set.\r
-  \r
-  @param  UnicodeStringTable      A pointer to the table of\r
-                                  Unicode strings.\r
-  \r
-  @param  UnicodeString           A pointer to the Unicode\r
-                                  string from UnicodeStringTable\r
-                                  that matches the language\r
-                                  specified by Language.\r
 \r
-  @retval  EFI_SUCCESS            The Unicode string that\r
-                                  matches the language specified\r
-                                  by Language was found in the\r
-                                  table of Unicoide strings\r
-                                  UnicodeStringTable, and it was\r
-                                  returned in UnicodeString.\r
-  \r
-  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
-  \r
-  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
-  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
-  \r
-  @retval  EFI_UNSUPPORTED        UnicodeStringTable is NULL.\r
-  \r
-  @retval  EFI_UNSUPPORTED        The language specified by\r
-                                  Language is not a member\r
-                                  ofSupportedLanguages.\r
-  \r
-  @retval EFI_UNSUPPORTED         The language specified by\r
-                                  Language is not supported by\r
-                                  UnicodeStringTable.\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
+                                  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
+                                  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
+                                  specified by Language was found\r
+                                  in the table of Unicoide 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
+                                  member of SupportedLanguages.\r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not \r
+                                  supported by UnicodeStringTable.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -640,28 +659,23 @@ LookupUnicodeString (
   @param  Language                A pointer to the ISO 639-2 or\r
                                   RFC 3066 language code for the\r
                                   Unicode string to look up and\r
-                                  return.\r
-  \r
+                                  return.  \r
   @param  SupportedLanguages      A pointer to the set of ISO\r
                                   639-2 or RFC 3066 language\r
                                   codes that the Unicode string\r
                                   table supports. Language must\r
-                                  be a member of this set.\r
-  \r
+                                  be a member of this set.  \r
   @param  UnicodeStringTable      A pointer to the table of\r
-                                  Unicode strings.\r
-  \r
+                                  Unicode strings.  \r
   @param  UnicodeString           A pointer to the Unicode\r
                                   string from UnicodeStringTable\r
                                   that matches the language\r
                                   specified by Language.\r
-\r
   @param  Iso639Language          Specify the language code\r
                                   format supported. If true,\r
                                   then the format follow ISO\r
                                   639-2. If false, then it\r
                                   follows RFC3066.\r
-\r
   @retval  EFI_SUCCESS            The Unicode string that\r
                                   matches the language specified\r
                                   by Language was found in the\r
@@ -669,18 +683,13 @@ LookupUnicodeString (
                                   UnicodeStringTable, and it was\r
                                   returned in UnicodeString.\r
   \r
-  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
-  \r
-  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
-  \r
-  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
-  \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
-  \r
   @retval  EFI_UNSUPPORTED        The language specified by\r
                                   Language is not a member\r
-                                  ofSupportedLanguages.\r
-  \r
+                                  ofSupportedLanguages.  \r
   @retval EFI_UNSUPPORTED         The language specified by\r
                                   Language is not supported by\r
                                   UnicodeStringTable.\r
@@ -767,57 +776,36 @@ LookupUnicodeString2 (
 \r
 \r
 /**\r
-  \r
   This function adds a Unicode string to UnicodeStringTable.\r
-  If Language is a member of SupportedLanguages then\r
-  UnicodeString is added to UnicodeStringTable.  New buffers are\r
-  allocated for both Language and UnicodeString.  The contents\r
-  of Language and UnicodeString are copied into these new\r
-  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\r
-                                  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
-  \r
-  @param  SupportedLanguages      A pointer to the set of ISO\r
-                                  639-2 language codes that the\r
-                                  Unicode string table supports.\r
-                                  Language must be a member of\r
-                                  this set.\r
-  \r
-  @param  UnicodeStringTable      A pointer to the table of\r
-                                  Unicode strings.\r
-  \r
-  @param  UnicodeString           A pointer to the Unicode\r
-                                  string to add.\r
-\r
-  @retval EFI_SUCCESS             The Unicode string that\r
-                                  matches the language specified\r
-                                  by Language was found in the\r
-                                  table of Unicode strings\r
-                                  UnicodeStringTable, and it was\r
+  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
+                                  that the Unicode string table supports.\r
+                                  Language 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 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
                                   returned in UnicodeString.\r
-  \r
   @retval EFI_INVALID_PARAMETER   Language is NULL.\r
-  \r
   @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
-  \r
   @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
-  \r
   @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
-  \r
-  @retval EFI_ALREADY_STARTED     A Unicode string with language\r
-                                  Language is already present in\r
-                                  UnicodeStringTable.\r
-  \r
-  @retval EFI_OUT_OF_RESOURCES    There is not enough memory to\r
-                                  add another Unicode string to\r
-                                  UnicodeStringTable.\r
-  \r
-  @retval EFI_UNSUPPORTED         The language specified by\r
-                                  Language is not a member of\r
-                                  SupportedLanguages.\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
+                                  Unicode string to UnicodeStringTable.\r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not a \r
+                                  member of SupportedLanguages.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -956,8 +944,8 @@ AddUnicodeString (
 \r
 \r
 /**\r
-  \r
   This function adds a Unicode string to UnicodeStringTable.\r
+\r
   If Language is a member of SupportedLanguages then\r
   UnicodeString is added to UnicodeStringTable.  New buffers are\r
   allocated for both Language and UnicodeString.  The contents\r
@@ -967,26 +955,21 @@ AddUnicodeString (
 \r
   @param  Language                A pointer to the ISO 639-2 or\r
                                   RFC 3066 language code for the\r
-                                  Unicode string to add.\r
-  \r
+                                  Unicode string to add.  \r
   @param  SupportedLanguages      A pointer to the set of ISO\r
-                                  639-2 or RFC 3.66 language\r
+                                  639-2 or RFC 3066 language\r
                                   codes that the Unicode string\r
                                   table supports. Language must\r
-                                  be a member of this set.\r
-  \r
+                                  be a member of this set.  \r
   @param  UnicodeStringTable      A pointer to the table of\r
-                                  Unicode strings.\r
-  \r
+                                  Unicode strings.  \r
   @param  UnicodeString           A pointer to the Unicode\r
-                                  string to add.\r
-  \r
+                                  string to add.  \r
   @param  Iso639Language          Specify the language code\r
                                   format supported. If true,\r
                                   then the format follow ISO\r
                                   639-2. If false, then it\r
                                   follows RFC3066.\r
-\r
   @retval EFI_SUCCESS             The Unicode string that\r
                                   matches the language specified\r
                                   by Language was found in the\r
@@ -994,22 +977,16 @@ AddUnicodeString (
                                   UnicodeStringTable, and it was\r
                                   returned in UnicodeString.\r
   \r
-  @retval EFI_INVALID_PARAMETER   Language is NULL.\r
-  \r
-  @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
-  \r
-  @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
-  \r
-  @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
-  \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\r
                                   Language is already present in\r
-                                  UnicodeStringTable.\r
-  \r
+                                  UnicodeStringTable.  \r
   @retval EFI_OUT_OF_RESOURCES    There is not enough memory to\r
                                   add another Unicode string to\r
-                                  UnicodeStringTable.\r
-  \r
+                                  UnicodeStringTable.  \r
   @retval EFI_UNSUPPORTED         The language specified by\r
                                   Language is not a member of\r
                                   SupportedLanguages.\r
@@ -1175,6 +1152,7 @@ AddUnicodeString2 (
 \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
   table are freed, and EFI_SUCCESS is returned.\r
@@ -1231,10 +1209,9 @@ FreeUnicodeStringTable (
 \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
+  @param  Lang   Pointer of system language. Lang will always be filled with a valid RFC 3066\r
+                 language string. If "PlatformLang" is not set in the system, the default\r
+                 language specifed by PcdUefiVariableDefaultPlatformLang 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
index b2e01997f8daf52562b007e4de2cad70d6c0c9cb..e40cd0dce4634bc14f5f524d83f54c329ace33f5 100644 (file)
@@ -214,10 +214,12 @@ EfiCreateEventReadyToBootEx (
 \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 from\r
+  how this event is created to prevent to code form having to change with the version of\r
+  the specification supported.\r
 \r
 **/\r
 VOID\r
@@ -237,10 +239,12 @@ EfiSignalEventReadyToBoot (
 }\r
 \r
 /**\r
-  Signal a Legacy Boot Event.\r
+  Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().\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
+  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
@@ -261,17 +265,18 @@ EfiSignalEventLegacyBoot (
 \r
 \r
 /**\r
+  Check to see if the Firmware Volume (FV) Media Device Path is valid \r
+  \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.  \r
-  Otherwise, return NULL.  This device path changed in the DXE CIS version 0.92 \r
-  in a non back ward compatible way to not conflict with the UEFI 2.0 specification.  \r
-  This function abstracts the differences from the caller.\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  FvFileDevicePathNode  Pointer to FV device path to check.\r
+\r
+  @param  FvDevicePathNode  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
@@ -295,17 +300,18 @@ EfiGetNameGuidFromFwVolDevicePathNode (
 \r
 \r
 /**\r
+  Initialize a Firmware Volume (FV) Media Device Path node.\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
+  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  FvFileDevicePathNode  Pointer to a FV device path node to initialize\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
 **/\r
index 818cd66e4a82574fef23274b254bb46f1b7ce18a..3205d57bc0eac286829d92e387d92e6286dbeefe 100644 (file)
@@ -152,9 +152,16 @@ RuntimeDriverLibDeconstruct (
 }\r
 \r
 /**\r
-  Return TRUE if ExitBootServices () has been called.\r
+  This function allows the caller to determine if UEFI ExitBootServices() has been called.\r
+\r
+  This function returns TRUE after all the EVT_SIGNAL_EXIT_BOOT_SERVICES functions have\r
+  executed as a result of the OS calling ExitBootServices().  Prior to this time FALSE\r
+  is returned. This function is used by runtime code to decide it is legal to access\r
+  services that go away after ExitBootServices().\r
+\r
+  @retval  TRUE  The system has finished executing the EVT_SIGNAL_EXIT_BOOT_SERVICES event.\r
+  @retval  FALSE The system has not finished executing the EVT_SIGNAL_EXIT_BOOT_SERVICES event.\r
 \r
-  @retval TRUE If ExitBootServices () has been called\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
@@ -166,9 +173,16 @@ EfiAtRuntime (
 }\r
 \r
 /**\r
-  Return TRUE if SetVirtualAddressMap () has been called.\r
+  This function allows the caller to determine if UEFI SetVirtualAddressMap() has been called. \r
+\r
+  This function returns TRUE after all the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE functions have\r
+  executed as a result of the OS calling SetVirtualAddressMap(). Prior to this time FALSE\r
+  is returned. This function is used by runtime code to decide it is legal to access services\r
+  that go away after SetVirtualAddressMap().\r
+\r
+  @retval  TRUE  The system has finished executing the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
+  @retval  FALSE The system has not finished executing the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
 \r
-  @retval TRUE  If SetVirtualAddressMap () has been called\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
index f4076513f494fd44ab6377780c1ce05af997e36d..0ffbe102e5af0ef3de573eb3a163cb7edf323990 100644 (file)
   Resets the entire platform.\r
 \r
   @param  ResetType   The type of reset to perform.\r
-  @param  ResetStatus The status code for reset.\r
-  @param  DataSize    The size in bytes of reset data.\r
-  @param  ResetData   Pointer to data buffer that includes\r
-                      Null-Terminated Unicode string.\r
+  @param  ResetStatus The status code for the reset. If the system reset is part of a\r
+                      normal operation, the status code would be EFI_SUCCESS. If the system\r
+                      reset is due to some type of failure the most appropriate EFI Status\r
+                      code would be used.\r
+  @param  DataSizeThe size, in bytes, of ResetData.\r
+  @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r
+                      the data buffer starts with a Null-terminated Unicode string, optionally\r
+                      followed by additional binary data. The string is a description that the\r
+                      caller may use to further indicate the reason for the system reset. ResetData\r
+                      is only valid if ResetStatus is something other then EFI_SUCCESS. This\r
+                      pointer must be a physical address. For a ResetType of EfiRestUpdate the\r
+                      data buffer also starts with a Null-terminated string that is followed by\r
+                      a physical VOID * to an EFI_CAPSULE_HEADER.\r
 \r
 **/\r
 VOID\r
@@ -44,15 +53,24 @@ EfiResetSystem (
 \r
 \r
 /**\r
-  Return current time and date information, and time-keeping\r
-  capabilities of hardware platform.\r
+  This service is a wrapper for the UEFI Runtime Service GetTime().\r
+\r
+  The GetTime() function returns a time that was valid sometime during the call to the function.\r
+  While the returned EFI_TIME structure contains TimeZone and Daylight savings time information,\r
+  the actual clock does not maintain these values. The current time zone and daylight saving time\r
+  information returned by GetTime() are the values that were last set via SetTime().\r
+  The GetTime() function should take approximately the same amount of time to read the time each\r
+  time it is called. All reported device capabilities are to be rounded up.\r
+  During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize\r
+  access to the device before calling GetTime().\r
 \r
   @param  Time         A pointer to storage to receive a snapshot of the current time.\r
   @param  Capabilities An optional pointer to a buffer to receive the real time clock device's\r
                        capabilities.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS            The operation completed successfully.\r
+  @retval  EFI_INVALID_PARAMETER  Time is NULL.\r
+  @retval  EFI_DEVICE_ERROR       The time could not be retrieved due to a hardware error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -67,12 +85,25 @@ EfiGetTime (
 \r
 \r
 /**\r
-  Set current time and date information.\r
-\r
-  @param  Time         A pointer to cache of time setting.\r
-\r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  This service is a wrapper for the UEFI Runtime Service SetTime().\r
+\r
+  The SetTime() function sets the real time clock device to the supplied time, and records the\r
+  current time zone and daylight savings time information. The SetTime() function is not allowed\r
+  to loop based on the current time. For example, if the device does not support a hardware reset\r
+  for the sub-resolution time, the code is not to implement the feature by waiting for the time to\r
+  wrap.\r
+  During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize\r
+  access to the device before calling SetTime().\r
+\r
+  @param  Time  A pointer to the current time. Type EFI_TIME is defined in the GetTime()\r
+                function description. Full error checking is performed on the different\r
+                fields of the EFI_TIME structure (refer to the EFI_TIME definition in the\r
+                GetTime() function description for full details), and EFI_INVALID_PARAMETER\r
+                is returned if any field is out of range.\r
+\r
+  @retval  EFI_SUCCESS            The operation completed successfully.\r
+  @retval  EFI_INVALID_PARAMETER  A time field is out of range.\r
+  @retval  EFI_DEVICE_ERROR       The time could not be set due to a hardware error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -86,14 +117,24 @@ EfiSetTime (
 \r
 \r
 /**\r
-  Return current wakeup alarm clock setting.\r
+  Returns the current wakeup alarm clock setting.\r
 \r
-  @param  Enabled Indicate if the alarm clock is enabled or disabled.\r
-  @param  Pending Indicate if the alarm signal is pending and requires acknowledgement.\r
-  @param  Time    Current alarm clock setting.\r
+  The alarm clock time may be rounded from the set alarm clock time to be within the resolution\r
+  of the alarm clock device. The resolution of the alarm clock device is defined to be one second.\r
+  During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize\r
+  access to the device before calling GetWakeupTime().\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @param  Enabled  Indicates if the alarm is currently enabled or disabled.\r
+  @param  Pending  Indicates if the alarm signal is pending and requires acknowledgement.\r
+  @param  Time     The current alarm setting. Type EFI_TIME is defined in the GetTime()\r
+                   function description.\r
+\r
+  @retval  EFI_SUCCESS           The alarm settings were returned.\r
+  @retval  EFI_INVALID_PARAMETER  Enabled is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  Pending is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  Time is NULL.\r
+  @retval  EFI_DEVICE_ERROR       The wakeup time could not be retrieved due to a hardware error.\r
+  @retval  EFI_UNSUPPORTED        A wakeup timer is not supported on this platform.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -110,13 +151,18 @@ EfiGetWakeupTime (
 \r
 \r
 /**\r
-  Set current wakeup alarm clock.\r
+  Sets the system wakeup alarm clock time.\r
 \r
-  @param  Enable Enable or disable current alarm clock..\r
-  @param  Time   Point to alarm clock setting.\r
+  @param  Enable  Enable or disable the wakeup alarm.\r
+  @param  Time    If Enable is TRUE, the time to set the wakeup alarm for. Type EFI_TIME\r
+                  is defined in the GetTime() function description. If Enable is FALSE,\r
+                  then this parameter is optional, and may be NULL.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS            If Enable is TRUE, then the wakeup alarm was enabled.\r
+                                  If Enable is FALSE, then the wakeup alarm was disabled.\r
+  @retval  EFI_INVALID_PARAMETER  A time field is out of range.\r
+  @retval  EFI_DEVICE_ERROR       The wakeup time could not be set due to a hardware error.\r
+  @retval  EFI_UNSUPPORTED        A wakeup timer is not supported on this platform.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -142,9 +188,16 @@ EfiSetWakeupTime (
                        As output, point to the actual size of the returned Data-Buffer.\r
   @param  Data         Point to return Data-Buffer.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
-\r
+  @retval  EFI_SUCCESS            The function completed successfully.\r
+  @retval  EFI_NOT_FOUND          The variable was not found.\r
+  @retval  EFI_BUFFER_TOO_SMALL   The DataSize is too small for the result. DataSize has\r
+                                  been updated with the size needed to complete the request.\r
+  @retval  EFI_INVALID_PARAMETER  VariableName is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  VendorGuid is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  DataSize is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  The DataSize is not too small and Data is NULL.\r
+  @retval  EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.\r
+  @retval  EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -173,8 +226,15 @@ EfiGetVariable (
                            GetNextVriableName().\r
                            As output, returns the VendorGuid of the current variable.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS           The function completed successfully.\r
+  @retval  EFI_NOT_FOUND         The next variable was not found.\r
+  @retval  EFI_BUFFER_TOO_SMALL  The VariableNameSize is too small for the result.\r
+                                 VariableNameSize has been updated with the size needed\r
+                                 to complete the request.\r
+  @retval  EFI_INVALID_PARAMETER VariableNameSize is NULL.\r
+  @retval  EFI_INVALID_PARAMETER VariableName is NULL.\r
+  @retval  EFI_INVALID_PARAMETER VendorGuid is NULL.\r
+  @retval  EFI_DEVICE_ERROR      The variable name could not be retrieved due to a hardware error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -200,8 +260,19 @@ EfiGetNextVariableName (
   @param  DataSize     The size in bytes of Data-Buffer.\r
   @param  Data         Point to the content of the variable.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS            The firmware has successfully stored the variable and its data as\r
+                                  defined by the Attributes.\r
+  @retval  EFI_INVALID_PARAMETER  An invalid combination of attribute bits was supplied, or the\r
+                                  DataSize exceeds the maximum allowed.\r
+  @retval  EFI_INVALID_PARAMETER  VariableName is an empty Unicode string.\r
+  @retval  EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.\r
+  @retval  EFI_DEVICE_ERROR       The variable could not be saved due to a hardware failure.\r
+  @retval  EFI_WRITE_PROTECTED    The variable in question is read-only.\r
+  @retval  EFI_WRITE_PROTECTED    The variable in question cannot be deleted.\r
+  @retval  EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\r
+                                  set but the AuthInfo does NOT pass the validation check carried\r
+                                  out by the firmware.\r
+  @retval  EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -223,8 +294,9 @@ EfiSetVariable (
 \r
   @param  HighCount Pointer to returned value.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS           The next high monotonic count was returned.\r
+  @retval  EFI_DEVICE_ERROR      The device is not functioning properly.\r
+  @retval  EFI_INVALID_PARAMETER HighCount is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -238,15 +310,18 @@ EfiGetNextHighMonotonicCount (
 \r
 \r
 /**\r
-  Determines the new virtual address that is to be used on subsequent memory accesses.\r
+  This service converts a function pointer from physical to virtual addressing. \r
 \r
   @param  DebugDisposition   Supplies type information for the pointer being converted.\r
   @param  Address            The pointer to a pointer that is to be fixed to be the\r
                              value needed for the new virtual address mapping being\r
                              applied.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS            The pointer pointed to by Address was modified.\r
+  @retval  EFI_NOT_FOUND          The pointer pointed to by Address was not found to be part of\r
+                                  the current memory map. This is normally fatal.\r
+  @retval  EFI_INVALID_PARAMETER  Address is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  *Address is NULL and DebugDispositio\r
 \r
 **/\r
 EFI_STATUS\r
@@ -279,8 +354,7 @@ EfiConvertPointer (
                              value needed for the new virtual address mapping being\r
                              applied.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @return  EFI_STATUS value from EfiConvertPointer().\r
 \r
 **/\r
 EFI_STATUS\r
@@ -295,13 +369,17 @@ EfiConvertFunctionPointer (
 \r
 \r
 /**\r
-  Conver the standard Lib double linked list to a virtual mapping.\r
+  Convert the standard Lib double linked list to a virtual mapping.\r
+\r
+  This service uses EfiConvertPointer() to walk a double linked list and convert all the link\r
+  pointers to their virtual mappings. This function is only guaranteed to work during the\r
+  EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event and calling it at other times has undefined results.\r
 \r
   @param  DebugDisposition   Supplies type information for the pointer being converted.\r
   @param  ListHead           Head of linked list to convert.\r
 \r
   @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -408,11 +486,13 @@ EfiSetVirtualAddressMap (
                                 CapsuleHeaderArray. This parameter is only referenced if\r
                                 the capsules are defined to persist across system reset.\r
 \r
-  @retval EFI_SUCCESS           Valid capsule was passed. I Valid capsule was passed. If\r
-                                CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
-                                capsule has been successfully processed by the firmware.\r
-  @retval EFI_INVALID_PARAMETER CapsuleSize is NULL or ResetTye is NULL.\r
+  @retval EFI_SUCCESS           Valid capsule was passed. If CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set,\r
+                                the capsule has been successfully processed by the firmware.\r
+  @retval EFI_INVALID_PARAMETER CapsuleSize or HeaderSize is NULL.\r
+  @retval EFI_INVALID_PARAMETER CapsuleCount is 0\r
   @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.\r
+  @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform.\r
+  @retval EFI_OUT_OF_RESOURCES  There were insufficient resources to process the capsule.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -481,6 +561,8 @@ EfiQueryCapsuleCapabilities (
 \r
 \r
 /**\r
+  Returns information about the EFI variables.\r
+\r
   The QueryVariableInfo() function allows a caller to obtain the information about the\r
   maximum size of the storage space available for the EFI variables, the remaining size of the storage\r
   space available for the EFI variables and the maximum size of each individual EFI variable,\r