Code clean up.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5890 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2008-09-16 02:12:35 +00:00
parent 33629bba69
commit 9edc73ada4
4 changed files with 30 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/** @file /** @file
Mde UEFI library functions. This module provide help function for displaying unicode string.
Copyright (c) 2006, Intel Corporation<BR> Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials

View File

@ -47,6 +47,8 @@ CompareIso639LanguageCode (
Table for a table with a GUID that matches TableGuid. If a match is found, Table for a table with a GUID that matches TableGuid. If a match is found,
then a pointer to the configuration table is returned in Table, and EFI_SUCCESS then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned. is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
If TableGuid is NULL, then ASSERT().
If Table is NULL, then ASSERT().
@param TableGuid Pointer to table's GUID type.. @param TableGuid Pointer to table's GUID type..
@param Table Pointer to the table associated with TableGuid in the EFI System Table. @param Table Pointer to the table associated with TableGuid in the EFI System Table.
@ -146,6 +148,9 @@ EfiCreateProtocolNotifyEvent(
This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext. This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
This event is signaled with EfiNamedEventSignal(). This provide the ability for This event is signaled with EfiNamedEventSignal(). This provide the ability for
one or more listeners on the same event named by the GUID specified by Name. one or more listeners on the same event named by the GUID specified by Name.
If Name is NULL, then ASSERT().
If NotifyTpl is not a legal TPL value, then ASSERT().
If NotifyFunction is NULL, then ASSERT().
@param Name Supplies GUID name of the event. @param Name Supplies GUID name of the event.
@param NotifyTpl Supplies the task priority level of the event notifications. @param NotifyTpl Supplies the task priority level of the event notifications.
@ -171,6 +176,10 @@ EfiNamedEventListen (
EFI_EVENT Event; EFI_EVENT Event;
VOID *RegistrationLocal; VOID *RegistrationLocal;
ASSERT (Name != NULL);
ASSERT (NotifyFunction != NULL);
ASSERT (NotifyTpl <= TPL_HIGH_LEVEL);
// //
// Create event // Create event
// //
@ -204,7 +213,7 @@ EfiNamedEventListen (
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return EFI_SUCCESS; return Status;
} }
/** /**
@ -242,7 +251,7 @@ EfiNamedEventSignal (
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return EFI_SUCCESS; return Status;
} }
/** /**
@ -279,6 +288,8 @@ EfiGetCurrentTpl (
and returns the lock. Each lock provides mutual exclusion access at its task and returns the lock. Each lock provides mutual exclusion access at its task
priority level. Since there is no preemption or multiprocessor support in EFI, priority level. Since there is no preemption or multiprocessor support in EFI,
acquiring the lock only consists of raising to the locks TPL. acquiring the lock only consists of raising to the locks TPL.
If Lock is NULL, then ASSERT().
If Priority is not a valid TPL value, then ASSERT().
@param Lock A pointer to the lock data structure to initialize. @param Lock A pointer to the lock data structure to initialize.
@param Priority EFI TPL associated with the lock. @param Priority EFI TPL associated with the lock.
@ -306,6 +317,9 @@ EfiInitializeLock (
This function raises the system's current task priority level to the task This function raises the system's current task priority level to the task
priority level of the mutual exclusion lock. Then, it places the lock in the priority level of the mutual exclusion lock. Then, it places the lock in the
acquired state. acquired state.
If Lock is NULL, then ASSERT().
If Lock is not initialized, then ASSERT().
If Lock is already in the acquired state, then ASSERT().
@param Lock The task lock with priority level. @param Lock The task lock with priority level.
@ -671,6 +685,7 @@ LookupUnicodeString (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
LookupUnicodeString2 ( LookupUnicodeString2 (
IN CONST CHAR8 *Language, IN CONST CHAR8 *Language,

View File

@ -212,7 +212,6 @@ AsciiInternalPrint (
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
If Format is NULL, then ASSERT(). If Format is NULL, then ASSERT().
If Format is not aligned on a 16-bit boundary, then ASSERT().
@param Format Null-terminated ASCII format string. @param Format Null-terminated ASCII format string.
@param ... VARARG list consumed to process Format. @param ... VARARG list consumed to process Format.
@ -230,7 +229,8 @@ AsciiPrint (
{ {
VA_LIST Marker; VA_LIST Marker;
UINTN Return; UINTN Return;
ASSERT (Format != NULL);
VA_START (Marker, Format); VA_START (Marker, Format);
Return = AsciiInternalPrint( Format, gST->ConOut, Marker); Return = AsciiInternalPrint( Format, gST->ConOut, Marker);
@ -250,7 +250,6 @@ AsciiPrint (
string is greater than PcdUefiLibMaxPrintBufferSize, then only the first string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
If Format is NULL, then ASSERT(). If Format is NULL, then ASSERT().
If Format is not aligned on a 16-bit boundary, then ASSERT().
@param Format Null-terminated ASCII format string. @param Format Null-terminated ASCII format string.
@param ... VARARG list consumed to process Format. @param ... VARARG list consumed to process Format.
@ -269,6 +268,8 @@ AsciiErrorPrint (
VA_LIST Marker; VA_LIST Marker;
UINTN Return; UINTN Return;
ASSERT (Format != NULL);
VA_START (Marker, Format); VA_START (Marker, Format);
Return = AsciiInternalPrint( Format, gST->StdErr, Marker); Return = AsciiInternalPrint( Format, gST->StdErr, Marker);

View File

@ -1,8 +1,8 @@
/** @file /** @file
Library functions that abstract areas of conflict between Tiano an UEFI 2.0. Library functions that abstract areas of conflict between framework and UEFI 2.0.
Help Port Framework/Tiano code that has conflicts with UEFI 2.0 by hiding the Help Port Framework code that has conflicts with UEFI 2.0 by hiding the
oldconflicts with library functions and supporting implementations of the old old conflicts with library functions and supporting implementations of the old
(EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as
it contains DXE enum extensions for EFI event services. it contains DXE enum extensions for EFI event services.
@ -129,7 +129,7 @@ EfiCreateEventLegacyBootEx (
} }
/** /**
Create a Read to Boot Event. Create a "Ready to Boot" Event.
Tiano extended the CreateEvent Type enum to add a ready to boot event type. Tiano extended the CreateEvent Type enum to add a ready to boot event type.
This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
@ -271,7 +271,8 @@ EfiSignalEventLegacyBoot (
else use the old form for backwards compatability. The return value to this else use the old form for backwards compatability. The return value to this
function points to a location in FvDevicePathNode and it does not allocate function points to a location in FvDevicePathNode and it does not allocate
new memory for the GUID pointer that is returned. new memory for the GUID pointer that is returned.
If FvDevicePathNode is NULL, then ASSERT().
@param FvFileDevicePathNode Pointer to FV device path to check. @param FvFileDevicePathNode Pointer to FV device path to check.
@retval NULL FvDevicePathNode is not valid. @retval NULL FvDevicePathNode is not valid.
@ -304,6 +305,8 @@ EfiGetNameGuidFromFwVolDevicePathNode (
device path is defined for Tiano extensions of device path. If the code device path is defined for Tiano extensions of device path. If the code
is compiled to conform with the UEFI 2.0 specification use the new device path is compiled to conform with the UEFI 2.0 specification use the new device path
else use the old form for backwards compatability. else use the old form for backwards compatability.
If FvDevicePathNode is NULL, then ASSERT().
If NameGuid is NULL, then ASSERT().
@param FvFileDevicePathNode Pointer to a FV device path node to initialize @param FvFileDevicePathNode Pointer to a FV device path node to initialize
@param NameGuid FV file name to use in FvDevicePathNode @param NameGuid FV file name to use in FvDevicePathNode