]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code clean up.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Sep 2008 02:12:35 +0000 (02:12 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Sep 2008 02:12:35 +0000 (02:12 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5890 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/UefiLib/Console.c
MdePkg/Library/UefiLib/UefiLib.c
MdePkg/Library/UefiLib/UefiLibPrint.c
MdePkg/Library/UefiLib/UefiNotTiano.c

index 11b4befb940b3a2204d7390c12689e7192d3af6c..737c69b46e6415c971b913ddee3cc5ddaf3828c3 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Mde UEFI library functions.\r
+  This module provide help function for displaying unicode string.\r
 \r
   Copyright (c) 2006, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials                          \r
index 877c320ff77710cbc25f56277cd18bf943fd6137..e3fff09de3953bd60da396a2757f7c6ab5937f48 100644 (file)
@@ -47,6 +47,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
@@ -146,6 +148,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
@@ -171,6 +176,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
@@ -204,7 +213,7 @@ EfiNamedEventListen (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -242,7 +251,7 @@ EfiNamedEventSignal (
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -279,6 +288,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
@@ -306,6 +317,9 @@ 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  Lock   The task lock with priority level.\r
 \r
@@ -671,6 +685,7 @@ LookupUnicodeString (
 \r
 **/\r
 EFI_STATUS\r
+\r
 EFIAPI\r
 LookupUnicodeString2 (\r
   IN CONST CHAR8                     *Language,\r
index c277974ab4fd36bb58e09b6c3bb46db6a55372ef..3787431c6782d34a2287d1112cba4a78de0564ff 100644 (file)
@@ -212,7 +212,6 @@ AsciiInternalPrint (
   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 ...      VARARG list consumed to process Format.\r
@@ -230,7 +229,8 @@ AsciiPrint (
 {\r
   VA_LIST Marker;\r
   UINTN   Return;\r
-\r
+  ASSERT (Format != NULL);\r
+  \r
   VA_START (Marker, Format);\r
 \r
   Return = AsciiInternalPrint( Format, gST->ConOut, Marker);\r
@@ -250,7 +250,6 @@ AsciiPrint (
   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 ...      VARARG list consumed to process Format.\r
@@ -269,6 +268,8 @@ AsciiErrorPrint (
   VA_LIST Marker;\r
   UINTN   Return;\r
 \r
+  ASSERT (Format != NULL);\r
+  \r
   VA_START (Marker, Format);\r
 \r
   Return = AsciiInternalPrint( Format, gST->StdErr, Marker);\r
index 0121481a606349af976e4138832c3070b3aba5cb..4587b136adf382e742bbb940329476d46ffafbbb 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-  Library functions that abstract areas of conflict between Tiano an UEFI 2.0.\r
+  Library functions that abstract areas of conflict between framework and UEFI 2.0.\r
 \r
-  Help Port Framework/Tiano code that has conflicts with UEFI 2.0 by hiding the\r
-  oldconflicts with library functions and supporting implementations of the old\r
+  Help Port Framework code that has conflicts with UEFI 2.0 by hiding the\r
+  old conflicts with library functions and supporting implementations of the old\r
   (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as\r
   it contains DXE enum extensions for EFI event services.\r
 \r
@@ -129,7 +129,7 @@ EfiCreateEventLegacyBootEx (
 }\r
 \r
 /**\r
-  Create a Read to Boot Event.\r
+  Create a "Ready to Boot" Event.\r
 \r
   Tiano extended the CreateEvent Type enum to add a ready to boot event type.\r
   This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
@@ -271,7 +271,8 @@ EfiSignalEventLegacyBoot (
   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
-\r
+  If FvDevicePathNode is NULL, then ASSERT().\r
+  \r
   @param  FvFileDevicePathNode  Pointer to FV device path to check.\r
 \r
   @retval NULL              FvDevicePathNode is not valid.\r
@@ -304,6 +305,8 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   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
+  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
   @param  NameGuid          FV file name to use in FvDevicePathNode\r