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
\r
- Module Name: UefiLib.c\r
-\r
**/\r
\r
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
+\r
+#include "UefiLibInternal.h"\r
\r
/**\r
Compare whether two names of languages are identical.\r
@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
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
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
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
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- return EFI_SUCCESS;\r
+ return Status;\r
}\r
\r
/**\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- return EFI_SUCCESS;\r
+ return Status;\r
}\r
\r
/**\r
\r
@param VOID\r
\r
- @retvale EFI_TPL The current TPL.\r
+ @retval EFI_TPL The current TPL.\r
\r
**/\r
EFI_TPL\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
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
\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
\r
**/\r
EFI_STATUS\r
+\r
EFIAPI\r
LookupUnicodeString2 (\r
IN CONST CHAR8 *Language,\r
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
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
return EFI_SUCCESS;\r
}\r
\r
+\r