]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiLib/UefiLib.c
remove unnecessary comments introduced by tools from MdePkg. The regular express...
[mirror_edk2.git] / MdePkg / Library / UefiLib / UefiLib.c
index 28f5c7d883b8e7ade3637efe325ffbf5d26bb3e5..a58878e5d348c0c83233f5ebdcd9bf3f6fb6967f 100644 (file)
@@ -12,9 +12,7 @@
 \r
 **/\r
 \r
-//\r
-// Include common header file for this module.\r
-//\r
+\r
 #include "UefiLibInternal.h"\r
 \r
 /**\r
@@ -27,7 +25,6 @@
   @retval FALSE     Language 1 and language 2 are not the same.\r
 \r
 **/\r
-STATIC\r
 BOOLEAN\r
 CompareIso639LanguageCode (\r
   IN CONST CHAR8  *Language1,\r
@@ -48,6 +45,8 @@ CompareIso639LanguageCode (
   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
+  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
@@ -147,6 +146,9 @@ EfiCreateProtocolNotifyEvent(
   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
+  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
@@ -172,6 +174,10 @@ EfiNamedEventListen (
   EFI_EVENT   Event;\r
   VOID        *RegistrationLocal;\r
 \r
+  ASSERT (Name != NULL);\r
+  ASSERT (NotifyFunction != NULL);\r
+  ASSERT (NotifyTpl <= TPL_HIGH_LEVEL);\r
+  \r
   //\r
   // Create event\r
   //\r
@@ -205,7 +211,7 @@ EfiNamedEventListen (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -243,7 +249,7 @@ EfiNamedEventSignal (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -257,7 +263,7 @@ EfiNamedEventSignal (
 \r
   @param  VOID\r
 \r
-  @retvale EFI_TPL              The current TPL.\r
+  @retval EFI_TPL              The current TPL.\r
 \r
 **/\r
 EFI_TPL\r
@@ -280,6 +286,8 @@ EfiGetCurrentTpl (
   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
@@ -307,8 +315,11 @@ EfiInitializeLock (
   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   The task lock with priority level.\r
 \r
 **/\r
 VOID\r
@@ -457,7 +468,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
@@ -672,6 +683,7 @@ LookupUnicodeString (
 \r
 **/\r
 EFI_STATUS\r
+\r
 EFIAPI\r
 LookupUnicodeString2 (\r
   IN CONST CHAR8                     *Language,\r
@@ -713,7 +725,7 @@ LookupUnicodeString2 (
       SupportedLanguages += 3;\r
     } else {\r
       for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);\r
-      if (AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) {\r
+      if ((AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) && (Language[Index] == 0)) {\r
         Found = TRUE;\r
         break;\r
       }\r
@@ -1076,7 +1088,7 @@ AddUnicodeString2 (
     while (OldUnicodeStringTable->Language != NULL) {\r
       LanguageString = OldUnicodeStringTable->Language;\r
 \r
-      while (*LanguageString) {\r
+      while (*LanguageString != 0) {\r
         for (Index = 0; LanguageString[Index] != 0 && LanguageString[Index] != ';'; Index++);\r
 \r
         if (AsciiStrnCmp (Language, LanguageString, Index) == 0) { \r
@@ -1209,3 +1221,4 @@ FreeUnicodeStringTable (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r