DebugLib:

Fix a bug in PeiDxeDebugLibReportStatusCode: it should use gReportStatusCodeDebugType so that report status code infrastructure can correctly extract debug info.
	Fix functional and coding style issues in the three instances in EdkModulePkg, namely: EdkDxeDebugLibReportStatusCode, EdkUefiDebugLibStderr, EdkUefiDebugLibConout.
	DevicePathLib:
	Sync with MWG 0.57 and add new interface of CreateDevicePathNode(). All the function headers have been updated.
	PeiServicesLib:
	Adjust coding style and fix a minor comment error.
	PciLib:
	Adjust assert() condition to sync with MWG 0.57
	BaseMemoryLib:
	Adjust assert() for ScanMemXX (), ScanGuid()
	Rename UefiMemoryLib to DxeMemoryLib
	PrintLib:
	Change the return value of all print services to exclude the NULL-terminator.
	Misc:
	Slightly adjust the coding style in hob.c in PeiCore module.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@757 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2006-07-05 04:17:04 +00:00
parent c16ade35ca
commit add13dc217
167 changed files with 3291 additions and 1412 deletions

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDebugLibStdErr</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -61,7 +61,7 @@ Returns:
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
*HobList = PrivateData->HobList.Raw;
*HobList = PrivateData->HobList.Raw;
return EFI_SUCCESS;
@ -111,7 +111,7 @@ Returns:
HandOffHob = *Hob;
Length = (UINT16)((Length + 0x7) & (~0x7));
Length = (UINT16)((Length + 0x7) & (~0x7));
FreeMemory = HandOffHob->EfiFreeMemoryTop -
HandOffHob->EfiFreeMemoryBottom;
@ -121,9 +121,9 @@ Returns:
}
*Hob = (VOID*) (UINTN) HandOffHob->EfiEndOfHobList;
((EFI_HOB_GENERIC_HEADER*) *Hob)->HobType = Type;
((EFI_HOB_GENERIC_HEADER*) *Hob)->HobType = Type;
((EFI_HOB_GENERIC_HEADER*) *Hob)->HobLength = Length;
((EFI_HOB_GENERIC_HEADER*) *Hob)->Reserved = 0;
((EFI_HOB_GENERIC_HEADER*) *Hob)->Reserved = 0;
HobEnd = (EFI_HOB_GENERIC_HEADER*) ((UINTN) *Hob + Length);
HandOffHob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;
@ -164,13 +164,13 @@ Returns:
--*/
{
EFI_HOB_HANDOFF_INFO_TABLE *Hob;
EFI_HOB_GENERIC_HEADER *HobEnd;
EFI_HOB_GENERIC_HEADER *HobEnd;
Hob = (VOID *)(UINTN)MemoryBegin;
Hob = (VOID *)(UINTN)MemoryBegin;
HobEnd = (EFI_HOB_GENERIC_HEADER*) (Hob+1);
Hob->Header.HobType = EFI_HOB_TYPE_HANDOFF;
Hob->Header.HobLength = sizeof(EFI_HOB_HANDOFF_INFO_TABLE);
Hob->Header.Reserved = 0;
Hob->Header.HobType = EFI_HOB_TYPE_HANDOFF;
Hob->Header.HobLength = sizeof(EFI_HOB_HANDOFF_INFO_TABLE);
Hob->Header.Reserved = 0;
HobEnd->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST;
HobEnd->HobLength = sizeof(EFI_HOB_GENERIC_HEADER);

View File

@ -1,108 +1,183 @@
/*++
/** @file
EFI Debug Library that installs Debug Level Protocol.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Module Name:
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
DebugLib.c
**/
Abstract:
STATIC BOOLEAN mDebugLevelInstalled = FALSE;
STATIC EFI_DEBUG_LEVEL_PROTOCOL mDebugLevel = { 0 };
EFI Debug Library
/**
Installs Debug Level Protocol.
The constructor function installs Debug Level Protocol on the ImageHandle.
It will ASSERT() if the installation fails and will always return EFI_SUCCESS.
--*/
static BOOLEAN mDebugLevelInstalled = FALSE;
static EFI_DEBUG_LEVEL_PROTOCOL mDebugLevel = { 0 };
@param ImageHandle The firmware allocated handle for the EFI image.
@param SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
DebugLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Arguments:
Returns:
--*/
{
EFI_STATUS Status;
EFI_STATUS Status;
//
// Initialize Debug Level Protocol
// Initialize Debug Level Protocol.
//
mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);
//
// Install Debug Level Protocol
// Install Debug Level Protocol.
//
Status = gBS->InstallMultipleProtocolInterfaces (
&ImageHandle,
&gEfiDebugLevelProtocolGuid, &mDebugLevel,
&gEfiDebugLevelProtocolGuid,
&mDebugLevel,
NULL
);
ASSERT_EFI_ERROR (Status);
//
// Set flag to show that the Debug Level Protocol has been installed
// Set flag to show that the Debug Level Protocol has been installed.
//
mDebugLevelInstalled = TRUE;
return EFI_SUCCESS;
return Status;
}
/**
Prints a debug message to the debug output device if the specified error level is enabled.
If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
the message specified by Format and the associated variable argument list to
the debug output device.
If Format is NULL, then ASSERT().
@param ErrorLevel The error level of the debug message.
@param Format Format string for the debug message to print.
**/
VOID
EFIAPI
DebugPrint (
IN UINTN ErrorLevel,
IN CONST CHAR8 *Format,
...
)
{
UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];
EFI_DEBUG_INFO *DebugInfo;
UINTN TotalSize;
UINTN Index;
VA_LIST Marker;
UINT64 *ArgumentPointer;
//
// If Format is NULL, then ASSERT().
//
ASSERT (Format != NULL);
//
// Check driver Debug Level value and global debug level
//
if (mDebugLevelInstalled) {
if ((ErrorLevel & mDebugLevel.DebugLevel) == 0) {
return;
}
} else {
if ((ErrorLevel & PcdGet32(PcdDebugPrintErrorLevel)) == 0) {
return;
}
}
TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrLen (Format) + 1;
if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
return;
}
//
// Then EFI_DEBUG_INFO
//
DebugInfo = (EFI_DEBUG_INFO *)Buffer;
DebugInfo->ErrorLevel = (UINT32)ErrorLevel;
//
// 256 byte mini Var Arg stack. That is followed by the format string.
//
VA_START (Marker, Format);
for (Index = 0, ArgumentPointer = (UINT64 *)(DebugInfo + 1); Index < 12; Index++, ArgumentPointer++) {
*ArgumentPointer = VA_ARG (Marker, UINT64);
}
VA_END (Marker);
AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);
REPORT_STATUS_CODE_EX (
EFI_DEBUG_CODE,
(EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),
0,
NULL,
&gEfiStatusCodeDataTypeDebugGuid,
DebugInfo,
TotalSize
);
}
/**
Prints an assert message containing a filename, line number, and description.
This may be followed by a breakpoint or a dead loop.
Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
CpuDeadLoop() is called. If neither of these bits are set, then this function
returns immediately after the message is printed to the debug output device.
DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
processing another DebugAssert(), then DebugAssert() must return immediately.
If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
@param FileName Pointer to the name of the source file that generated the assert condition.
@param LineNumber The line number in the source file that generated the assert condition
@param Description Pointer to the description of the assert condition.
**/
VOID
EFIAPI
DebugAssert (
IN CHAR8 *FileName,
IN UINTN LineNumber,
IN CHAR8 *Description
IN CONST CHAR8 *FileName,
IN UINTN LineNumber,
IN CONST CHAR8 *Description
)
/*++
Routine Description:
Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT
information. If Error Logging hub is not loaded CpuBreakpoint ().
We use UINT64 buffers due to IPF alignment concerns.
Arguments:
FileName - File name of failing routine.
LineNumber - Line number of failing ASSERT().
Description - Descritption, usally the assertion,
Returns:
None
--*/
{
UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];
EFI_DEBUG_ASSERT_DATA *AssertData;
UINTN TotalSize;
CHAR8 *Temp;
if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) == 0) {
return;
}
//
// Make sure it will all fit in the passed in buffer
// Make sure it will all fit in the passed in buffer.
//
TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + AsciiStrLen (FileName) + 1 + AsciiStrLen (Description) + 1;
if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {
@ -118,9 +193,9 @@ Returns:
Temp = AsciiStrCpy ((CHAR8 *)(AssertData + 1), FileName);
//
// Copy Ascii Description
// Copy Ascii Description.
//
AsciiStrCpy (Temp + AsciiStrLen(FileName) + 1, Description);
AsciiStrCpy (Temp + AsciiStrLen (FileName) + 1, Description);
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
(EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),
@ -131,124 +206,18 @@ Returns:
}
//
// Put break point in module that contained the error.
// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
//
CpuBreakpoint ();
if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
CpuBreakpoint ();
} else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
CpuDeadLoop ();
}
}
VOID
DebugVPrint (
IN UINTN ErrorLevel,
IN CHAR8 *Format,
IN VA_LIST Marker
)
/*++
Routine Description:
Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
information. If Error Logging hub is not loaded do nothing.
We use UINT64 buffers due to IPF alignment concerns.
Arguments:
ErrorLevel - If error level is set do the debug print.
Format - String to use for the print, followed by Print arguments.
Marker - VarArgs
Returns:
None
--*/
{
UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];
EFI_DEBUG_INFO *DebugInfo;
UINTN TotalSize;
UINTN Index;
UINT64 *ArgumentPointer;
//
// Check driver Debug Level value and global debug level
//
if (mDebugLevelInstalled) {
if ((ErrorLevel & mDebugLevel.DebugLevel) == 0) {
return;
}
} else {
if ((ErrorLevel & PcdGet32(PcdDebugPrintErrorLevel)) == 0) {
return;
}
}
TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64 *) + AsciiStrLen (Format) + 1;
if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
return;
}
//
// Then EFI_DEBUG_INFO
//
DebugInfo = (EFI_DEBUG_INFO *)Buffer;
DebugInfo->ErrorLevel = (UINT32)ErrorLevel;
//
// 256 byte mini Var Arg stack. That is followed by the format string.
//
for (Index = 0, ArgumentPointer = (UINT64 *)(DebugInfo + 1); Index < 12; Index++, ArgumentPointer++) {
*ArgumentPointer = VA_ARG (Marker, UINT64);
}
AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);
//
//
//
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
EFI_DEBUG_CODE,
(EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),
DebugInfo,
TotalSize
);
}
VOID
EFIAPI
DebugPrint (
IN UINTN ErrorLevel,
IN CHAR8 *Format,
...
)
/*++
Routine Description:
Wrapper for DebugVPrint ()
Arguments:
ErrorLevel - If error level is set do the debug print.
Format - String to use for the print, followed by Print arguments.
... - Print arguments.
Returns:
None
--*/
{
VA_LIST Marker;
VA_START (Marker, Format);
DebugVPrint (ErrorLevel, Format, Marker);
VA_END (Marker);
}
/**
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
This function fills Length bytes of Buffer with the value specified by
@ -258,8 +227,8 @@ Returns:
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@return Buffer
@ -271,11 +240,29 @@ DebugClearMemory (
IN UINTN Length
)
{
// SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
SetMem (Buffer, Length, 0xAF);
return Buffer;
//
// If Buffer is NULL, then ASSERT().
//
ASSERT (Buffer != NULL);
//
// SetMem() checks for the the ASSERT() condition on Length and returns Buffer
//
return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
}
/**
Returns TRUE if ASSERT() macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugAssertEnabled (
@ -285,6 +272,18 @@ DebugAssertEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugPrintEnabled (
@ -294,6 +293,18 @@ DebugPrintEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG_CODE()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugCodeEnabled (
@ -303,6 +314,18 @@ DebugCodeEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugClearMemoryEnabled (
@ -311,4 +334,3 @@ DebugClearMemoryEnabled (
{
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
}

View File

@ -49,10 +49,15 @@
<Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>
</PackageDependencies>
<Protocols>
<Protocol Usage="ALWAYS_CONSUMED">
<Protocol Usage="ALWAYS_PRODUCED">
<ProtocolCName>DebugLevel</ProtocolCName>
</Protocol>
</Protocols>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
<GuidCName>StatusCodeDataTypeDebug</GuidCName>
</GuidCNames>
</Guids>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00090000</Specification>
@ -66,6 +71,11 @@
<TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText/>
</PcdEntry>
<PcdEntry PcdItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugClearMemoryValue</C_Name>
<TokenSpaceGuidCName>FIX_ME_PcdDebugClearMemoryValue</TokenSpaceGuidCName>
<HelpText/>
</PcdEntry>
<PcdEntry PcdItemType="PATCHABLE_IN_MODULE">
<C_Name>PcdDebugPrintErrorLevel</C_Name>
<TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>

View File

@ -1,105 +1,99 @@
/*++
/** @file
UEFI Debug Library that uses PrintLib to send messages to CONOUT.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Module Name:
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
DebugLib.c
**/
Abstract:
//
// Define the maximum debug and assert message length that this library supports.
//
#define MAX_DEBUG_MESSAGE_LENGTH 0x100
UEFI Debug Library that uses PrintLib to send messages to CONOUT
STATIC BOOLEAN mDebugLevelInstalled = FALSE;
STATIC EFI_DEBUG_LEVEL_PROTOCOL mDebugLevel = { 0 };
--*/
/**
Installs Debug Level Protocol.
The constructor function installs Debug Level Protocol on the ImageHandle.
It will ASSERT() if the installation fails and will always return EFI_SUCCESS.
static BOOLEAN mDebugLevelInstalled = FALSE;
static EFI_DEBUG_LEVEL_PROTOCOL mDebugLevel = { 0 };
@param ImageHandle The firmware allocated handle for the EFI image.
@param SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
DebugLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Arguments:
Returns:
--*/
{
EFI_STATUS Status;
EFI_STATUS Status;
//
// Initialize Debug Level Protocol
// Initialize Debug Level Protocol.
//
mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);
//
// Install Debug Level Protocol
// Install Debug Level Protocol.
//
Status = gBS->InstallMultipleProtocolInterfaces (
&ImageHandle,
&gEfiDebugLevelProtocolGuid, &mDebugLevel,
&gEfiDebugLevelProtocolGuid,
&mDebugLevel,
NULL
);
ASSERT_EFI_ERROR (Status);
//
// Set flag to show that the Debug Level Protocol has been installed
// Set flag to show that the Debug Level Protocol has been installed.
//
mDebugLevelInstalled = TRUE;
return EFI_SUCCESS;
return Status;
}
/**
Prints a debug message to the debug output device if the specified error level is enabled.
If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
the message specified by Format and the associated variable argument list to
the debug output device.
If Format is NULL, then ASSERT().
@param ErrorLevel The error level of the debug message.
@param Format Format string for the debug message to print.
**/
VOID
EFIAPI
DebugPrint (
IN UINTN ErrorLevel,
IN CHAR8 *Format,
IN UINTN ErrorLevel,
IN CONST CHAR8 *Format,
...
)
/*++
Routine Description:
Wrapper for DebugVPrint ()
Arguments:
ErrorLevel - If error level is set do the debug print.
Format - String to use for the print, followed by Print arguments.
... - Print arguments.
Returns:
None
--*/
{
CHAR16 Buffer[0x100];
CHAR16 UnicodeBuffer[0x100];
UINT32 Index;
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
VA_LIST Marker;
//
// Check to see if CONOUT is avilable
// If Format is NULL, then ASSERT().
//
if (gST->ConOut == NULL) {
return;
}
ASSERT (Format != NULL);
//
// Check driver Debug Level value and global debug level
@ -114,83 +108,80 @@ Returns:
}
}
//
// BUGBUG: Need print that take CHAR8 Format and returns CHAR16 Buffer
//
for (Index = 0; Format[Index] != 0; Index++) {
UnicodeBuffer[Index] = Format[Index];
}
UnicodeBuffer[Index] = Format[Index];
//
// Convert the DEBUG() message to a Unicode String
//
VA_START (Marker, Format);
UnicodeVSPrint (Buffer, sizeof (Buffer), UnicodeBuffer, Marker);
UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);
VA_END (Marker);
//
// Send the print string to the Standard Error device
// Send the print string to the Console Output device if CONOUT is available.
//
gST->ConOut->OutputString (gST->ConOut, Buffer);
if (gST->ConOut != NULL) {
gST->ConOut->OutputString (gST->ConOut, Buffer);
}
}
/**
Prints an assert message containing a filename, line number, and description.
This may be followed by a breakpoint or a dead loop.
Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
CpuDeadLoop() is called. If neither of these bits are set, then this function
returns immediately after the message is printed to the debug output device.
DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
processing another DebugAssert(), then DebugAssert() must return immediately.
If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
@param FileName Pointer to the name of the source file that generated the assert condition.
@param LineNumber The line number in the source file that generated the assert condition
@param Description Pointer to the description of the assert condition.
**/
VOID
EFIAPI
DebugAssert (
IN CHAR8 *FileName,
IN UINTN LineNumber,
IN CHAR8 *Description
IN CONST CHAR8 *FileName,
IN UINTN LineNumber,
IN CONST CHAR8 *Description
)
/*++
Routine Description:
Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT
information. If Error Logging hub is not loaded CpuBreakpoint ().
We use UINT64 buffers due to IPF alignment concerns.
Arguments:
FileName - File name of failing routine.
LineNumber - Line number of failing ASSERT().
Description - Descritption, usally the assertion,
Returns:
None
--*/
{
CHAR16 Buffer[0x100];
//
// Check to see if CONOUT is avilable
//
if (gST->ConOut == NULL) {
return;
}
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
//
// Generate the ASSERT() message in Unicode format
//
UnicodeSPrint (Buffer, sizeof (Buffer), (CHAR16 *)L"ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
//
// Send the print string to the Standard Error device
// Send the print string to the Console Output device if CONOUT is available.
//
gST->ConOut->OutputString (gST->ConOut, Buffer);
if (gST->ConOut != NULL) {
gST->ConOut->OutputString (gST->ConOut, Buffer);
}
//
// Put break point in module that contained the error.
// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
//
CpuBreakpoint ();
if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
CpuBreakpoint ();
} else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
CpuDeadLoop ();
}
}
/**
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
This function fills Length bytes of Buffer with the value specified by
@ -200,8 +191,8 @@ Returns:
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@return Buffer
@ -213,11 +204,29 @@ DebugClearMemory (
IN UINTN Length
)
{
// SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
SetMem (Buffer, Length, 0xAF);
return Buffer;
//
// If Buffer is NULL, then ASSERT().
//
ASSERT (Buffer != NULL);
//
// SetMem() checks for the the ASSERT() condition on Length and returns Buffer
//
return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
}
/**
Returns TRUE if ASSERT() macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugAssertEnabled (
@ -227,6 +236,18 @@ DebugAssertEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugPrintEnabled (
@ -236,6 +257,18 @@ DebugPrintEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG_CODE()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugCodeEnabled (
@ -245,6 +278,18 @@ DebugCodeEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugClearMemoryEnabled (

View File

@ -53,6 +53,11 @@
<ProtocolCName>DebugLevel</ProtocolCName>
</Protocol>
</Protocols>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
<GuidCName>StatusCodeDataTypeDebug</GuidCName>
</GuidCNames>
</Guids>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00090000</Specification>
@ -66,6 +71,11 @@
<TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText/>
</PcdEntry>
<PcdEntry PcdItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugClearMemoryValue</C_Name>
<TokenSpaceGuidCName>FIX_ME_PcdDebugClearMemoryValue</TokenSpaceGuidCName>
<HelpText/>
</PcdEntry>
<PcdEntry PcdItemType="PATCHABLE_IN_MODULE">
<C_Name>PcdDebugPrintErrorLevel</C_Name>
<TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>

View File

@ -1,105 +1,99 @@
/*++
/** @file
UEFI Debug Library that uses PrintLib to send messages to STDERR.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Module Name:
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
DebugLib.c
**/
Abstract:
//
// Define the maximum debug and assert message length that this library supports.
//
#define MAX_DEBUG_MESSAGE_LENGTH 0x100
UEFI Debug Library that uses PrintLib to send messages to STDERR
STATIC BOOLEAN mDebugLevelInstalled = FALSE;
STATIC EFI_DEBUG_LEVEL_PROTOCOL mDebugLevel = { 0 };
--*/
/**
Installs Debug Level Protocol.
The constructor function installs Debug Level Protocol on the ImageHandle.
It will ASSERT() if the installation fails and will always return EFI_SUCCESS.
static BOOLEAN mDebugLevelInstalled = FALSE;
static EFI_DEBUG_LEVEL_PROTOCOL mDebugLevel = { 0 };
@param ImageHandle The firmware allocated handle for the EFI image.
@param SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
DebugLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
/*++
Routine Description:
Arguments:
Returns:
--*/
{
EFI_STATUS Status;
EFI_STATUS Status;
//
// Initialize Debug Level Protocol
// Initialize Debug Level Protocol.
//
mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);
//
// Install Debug Level Protocol
// Install Debug Level Protocol.
//
Status = gBS->InstallMultipleProtocolInterfaces (
&ImageHandle,
&gEfiDebugLevelProtocolGuid, &mDebugLevel,
&gEfiDebugLevelProtocolGuid,
&mDebugLevel,
NULL
);
ASSERT_EFI_ERROR (Status);
//
// Set flag to show that the Debug Level Protocol has been installed
// Set flag to show that the Debug Level Protocol has been installed.
//
mDebugLevelInstalled = TRUE;
return EFI_SUCCESS;
return Status;
}
/**
Prints a debug message to the debug output device if the specified error level is enabled.
If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
the message specified by Format and the associated variable argument list to
the debug output device.
If Format is NULL, then ASSERT().
@param ErrorLevel The error level of the debug message.
@param Format Format string for the debug message to print.
**/
VOID
EFIAPI
DebugPrint (
IN UINTN ErrorLevel,
IN CHAR8 *Format,
IN UINTN ErrorLevel,
IN CONST CHAR8 *Format,
...
)
/*++
Routine Description:
Wrapper for DebugVPrint ()
Arguments:
ErrorLevel - If error level is set do the debug print.
Format - String to use for the print, followed by Print arguments.
... - Print arguments.
Returns:
None
--*/
{
CHAR16 Buffer[0x100];
CHAR16 UnicodeBuffer[0x100];
UINT32 Index;
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
VA_LIST Marker;
//
// Check to see if STDERR is avilable
// If Format is NULL, then ASSERT().
//
if (gST->StdErr == NULL) {
return;
}
ASSERT (Format != NULL);
//
// Check driver Debug Level value and global debug level
@ -114,83 +108,80 @@ Returns:
}
}
//
// BUGBUG: Need print that take CHAR8 Format and returns CHAR16 Buffer
//
for (Index = 0; Format[Index] != 0; Index++) {
UnicodeBuffer[Index] = Format[Index];
}
UnicodeBuffer[Index] = Format[Index];
//
// Convert the DEBUG() message to a Unicode String
//
VA_START (Marker, Format);
UnicodeVSPrint (Buffer, sizeof (Buffer), UnicodeBuffer, Marker);
UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);
VA_END (Marker);
//
// Send the print string to the Standard Error device
// Send the print string to the Standard Error device if STDERR is available.
//
gST->StdErr->OutputString (gST->StdErr, Buffer);
if (gST->StdErr != NULL) {
gST->StdErr->OutputString (gST->StdErr, Buffer);
}
}
/**
Prints an assert message containing a filename, line number, and description.
This may be followed by a breakpoint or a dead loop.
Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
CpuDeadLoop() is called. If neither of these bits are set, then this function
returns immediately after the message is printed to the debug output device.
DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
processing another DebugAssert(), then DebugAssert() must return immediately.
If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
@param FileName Pointer to the name of the source file that generated the assert condition.
@param LineNumber The line number in the source file that generated the assert condition
@param Description Pointer to the description of the assert condition.
**/
VOID
EFIAPI
DebugAssert (
IN CHAR8 *FileName,
IN UINTN LineNumber,
IN CHAR8 *Description
IN CONST CHAR8 *FileName,
IN UINTN LineNumber,
IN CONST CHAR8 *Description
)
/*++
Routine Description:
Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT
information. If Error Logging hub is not loaded CpuBreakpoint ().
We use UINT64 buffers due to IPF alignment concerns.
Arguments:
FileName - File name of failing routine.
LineNumber - Line number of failing ASSERT().
Description - Descritption, usally the assertion,
Returns:
None
--*/
{
CHAR16 Buffer[0x100];
//
// Check to see if STDERR is avilable
//
if (gST->StdErr == NULL) {
return;
}
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
//
// Generate the ASSERT() message in Unicode format
//
UnicodeSPrint (Buffer, sizeof (Buffer), (CHAR16 *)L"ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
//
// Send the print string to the Standard Error device
// Send the print string to the Standard Error device if STDERR is available.
//
gST->StdErr->OutputString (gST->StdErr, Buffer);
if (gST->StdErr != NULL) {
gST->StdErr->OutputString (gST->StdErr, Buffer);
}
//
// Put break point in module that contained the error.
// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
//
CpuBreakpoint ();
if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
CpuBreakpoint ();
} else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
CpuDeadLoop ();
}
}
/**
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
This function fills Length bytes of Buffer with the value specified by
@ -200,8 +191,8 @@ Returns:
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@return Buffer
@ -213,11 +204,29 @@ DebugClearMemory (
IN UINTN Length
)
{
// SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
SetMem (Buffer, Length, 0xAF);
return Buffer;
//
// If Buffer is NULL, then ASSERT().
//
ASSERT (Buffer != NULL);
//
// SetMem() checks for the the ASSERT() condition on Length and returns Buffer
//
return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
}
/**
Returns TRUE if ASSERT() macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugAssertEnabled (
@ -227,6 +236,18 @@ DebugAssertEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugPrintEnabled (
@ -236,6 +257,18 @@ DebugPrintEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG_CODE()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugCodeEnabled (
@ -245,6 +278,18 @@ DebugCodeEnabled (
return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
}
/**
Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugClearMemoryEnabled (

View File

@ -19,7 +19,7 @@
<ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkUefiDebugLibStdErr</OutputFileBasename>
<OutputFileBasename>EdkUefiDebugLibConOut</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED">
@ -53,6 +53,11 @@
<ProtocolCName>DebugLevel</ProtocolCName>
</Protocol>
</Protocols>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
<GuidCName>StatusCodeDataTypeDebug</GuidCName>
</GuidCNames>
</Guids>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00090000</Specification>
@ -66,6 +71,11 @@
<TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText/>
</PcdEntry>
<PcdEntry PcdItemType="FIXED_AT_BUILD">
<C_Name>PcdDebugClearMemoryValue</C_Name>
<TokenSpaceGuidCName>FIX_ME_PcdDebugClearMemoryValue</TokenSpaceGuidCName>
<HelpText/>
</PcdEntry>
<PcdEntry PcdItemType="PATCHABLE_IN_MODULE">
<C_Name>PcdDebugPrintErrorLevel</C_Name>
<TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>HiiLib</Library>
<Library>UefiDriverModelLib</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>DxeHobLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeServicesTableLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</MbdHeader>
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>DxeHobLib</Library>
<Library>UefiLib</Library>
<Library>HiiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>BaseLib</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>BasePrintLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeMemoryAllocationLib</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Libraries>
<Library>UefiBootServicesTableLib</Library>
<Library>UefiRuntimeServicesTableLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>

View File

@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>HiiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiRuntimeServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeServicesTableLib</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>
<Library>UefiDebugLibStdErr</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>
<Library>UefiDebugLibStdErr</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>
<Library>UefiDebugLibStdErr</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>
<Library>UefiDebugLibStdErr</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>
<Library>UefiDebugLibStdErr</Library>

View File

@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>UefiBootServicesTableLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>UefiDriverModelLib</Library>
<Library>DxeReportStatusCodeLib</Library>

View File

@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>DxeHobLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>DxeWinNtLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>DxeHobLib</Library>
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -34,7 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>HiiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>DxeWinNtLib</Library>

View File

@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>BaseLib</Library>
<Library>UefiLib</Library>
<Library>HiiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<Library>BaseLib</Library>
<Library>DxeHobLib</Library>
<Library>UefiLib</Library>
<Library>UefiMemoryLib</Library>
<Library>DxeMemoryLib</Library>
<Library>UefiDriverEntryPoint</Library>
<Library>DxeReportStatusCodeLib</Library>
<Library>PeiDxeDebugLibReportStatusCode</Library>

View File

@ -6315,6 +6315,7 @@
<Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Instance ModuleGuid="b57a1df6-ffdb-4247-a3df-3a562176751a" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Instance ModuleGuid="19cbbb97-ff61-45ff-8c3f-dfa66dd118c8" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
</Libraries>
<PcdBuildDefinition>
<PcdData ItemType="FIXED_AT_BUILD">

View File

@ -48,7 +48,7 @@ CopyMem (
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Memory to set.
@param Length Number of bytes to set
@param Length Number of bytes to set.
@param Value Value of the set operation.
@return Buffer.
@ -175,7 +175,6 @@ ZeroMem (
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
@param DestinationBuffer Pointer to the destination buffer to compare.
@param SourceBuffer Pointer to the source buffer to compare.
@param Length Number of bytes to compare.
@ -229,6 +228,7 @@ ScanMem8 (
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -256,6 +256,7 @@ ScanMem16 (
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -283,6 +284,7 @@ ScanMem32 (
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Length is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -353,7 +355,8 @@ CompareGuid (
GUID in the target buffer is returned. If no match is found, then NULL is returned.
If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 128-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.

View File

@ -18,11 +18,12 @@
#define __DEVICE_PATH_LIB_H__
/**
This function returns the size, in bytes,
of the device path data structure specified by DevicePath.
If DevicePath is NULL, then 0 is returned.
Returns the size of a device path in bytes.
@param DevicePath A pointer to a device path data structure.
This function returns the size, in bytes, of the device path data structure specified by
DevicePath including the end of device path node. If DevicePath is NULL, then 0 is returned.
@param DevicePath A pointer to a device path data structure.
@return The size of a device path in bytes.
@ -31,166 +32,220 @@ UINTN
EFIAPI
GetDevicePathSize (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
);
/**
This function allocates space for a new copy of the device path
specified by DevicePath.
Creates a new device path by appending a second device path to a first device path.
@param DevicePath A pointer to a device path data structure.
This function allocates space for a new copy of the device path specified by DevicePath. If
DevicePath is NULL, then NULL is returned. If the memory is successfully allocated, then the
contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer
is returned. Otherwise, NULL is returned.
@param DevicePath A pointer to a device path data structure.
@return The duplicated device path.
@return A pointer to the duplicated device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
DuplicateDevicePath (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
);
/**
This function appends the device path SecondDevicePath
to every device path instance in FirstDevicePath.
Creates a new device path by appending a second device path to a first device path.
@param FirstDevicePath A pointer to a device path data structure.
@param SecondDevicePath A pointer to a device path data structure.
This function creates a new device path by appending a copy of SecondDevicePath to a copy of
FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from
SecondDevicePath is retained. The newly created device path is returned.
If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.
If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.
If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned.
If there is not enough memory for the newly allocated buffer, then NULL is returned.
The memory for the new device path is allocated from EFI boot services memory. It is the
responsibility of the caller to free the memory allocated.
@return
A pointer to the new device path is returned.
NULL is returned if space for the new device path could not be allocated from pool.
It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath
if they are no longer needed.
@param FirstDevicePath A pointer to a device path data structure.
@param SecondDevicePath A pointer to a device path data structure.
@return A pointer to the new device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePath (
IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
)
;
IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath, OPTIONAL
IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL
);
/**
This function appends the device path node SecondDevicePath
to every device path instance in FirstDevicePath.
Creates a new path by appending the device node to the device path.
@param DevicePath A pointer to a device path data structure.
@param DevicePathNode A pointer to a single device path node.
This function creates a new device path by appending a copy of the device node specified by
DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.
The end-of-device-path device node is moved after the end of the appended device node.
If DevicePath is NULL, then NULL is returned.
If DevicePathNode is NULL, then NULL is returned.
If there is not enough memory to allocate space for the new device path, then NULL is returned.
The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
free the memory allocated.
@param DevicePath A pointer to a device path data structure.
@param DevicePathNode A pointer to a single device path node.
@return A pointer to the new device path.
If there is not enough temporary pool memory available to complete this function,
then NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePathNode (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode
)
;
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL
);
/**
This function appends the device path instance Instance to the device path Source.
If Source is NULL, then a new device path with one instance is created.
Creates a new device path by appending the specified device path instance to the specified device
path.
This function creates a new device path by appending a copy of the device path instance specified
by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.
The end-of-device-path device node is moved after the end of the appended device path instance
and a new end-of-device-path-instance node is inserted between.
If DevicePath is NULL, then a copy if DevicePathInstance is returned.
If DevicePathInstance is NULL, then NULL is returned.
If there is not enough memory to allocate space for the new device path, then NULL is returned.
The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
free the memory allocated.
@param DevicePath A pointer to a device path data structure.
@param DevicePathInstance A pointer to a device path instance.
@param Source A pointer to a device path data structure.
@param Instance A pointer to a device path instance.
@return
A pointer to the new device path.
If there is not enough temporary pool memory available to complete this function,
then NULL is returned.
@return A pointer to the new device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePathInstance (
IN CONST EFI_DEVICE_PATH_PROTOCOL *Source,
IN CONST EFI_DEVICE_PATH_PROTOCOL *Instance
)
;
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL
);
/**
Function retrieves the next device path instance from a device path data structure.
Creates a copy of the current device path instance and returns a pointer to the next device path
instance.
@param DevicePath A pointer to a device path data structure.
@param Size A pointer to the size of a device path instance in bytes.
This function creates a copy of the current device path instance. It also updates DevicePath to
point to the next device path instance in the device path (or NULL if no more) and updates Size
to hold the size of the device path instance copy.
If DevicePath is NULL, then NULL is returned.
If there is not enough memory to allocate space for the new device path, then NULL is returned.
The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
free the memory allocated.
If Size is NULL, then ASSERT().
@param DevicePath On input, this holds the pointer to the current device path
instance. On output, this holds the pointer to the next device
path instance or NULL if there are no more device path
instances in the device path pointer to a device path data
structure.
@param Size On output, this holds the size of the device path instance, in
bytes or zero, if DevicePath is NULL.
@return
This function returns a pointer to the current device path instance.
In addition, it returns the size in bytes of the current device path instance in Size,
and a pointer to the next device path instance in DevicePath.
If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
@return A pointer to the current device path instance.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
GetNextDevicePathInstance (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
OUT UINTN *Size
)
;
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
OUT UINTN *Size
);
/**
Return TRUE is this is a multi instance device path.
Creates a copy of the current device path instance and returns a pointer to the next device path
instance.
@param DevicePath A pointer to a device path data structure.
This function creates a new device node in a newly allocated buffer of size NodeLength and
initializes the device path node header with NodeType and NodeSubType. The new device path node
is returned.
If NodeLength is smaller than a device path header, then NULL is returned.
If there is not enough memory to allocate space for the new device path, then NULL is returned.
The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
free the memory allocated.
@retval TRUE If DevicePath is multi-instance.
@retval FALSE If DevicePath is not multi-instance or DevicePath is NULL.
@param NodeType The device node type for the new device node.
@param NodeSubType The device node sub-type for the new device node.
@param NodeLength The length of the new device node.
@return The new device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
CreateDeviceNode (
IN UINT8 NodeType,
IN UINT8 NodeSubType,
IN UINT16 NodeLength
);
/**
Determines if a device path is single or multi-instance.
This function returns TRUE if the device path specified by DevicePath is multi-instance.
Otherwise, FALSE is returned. If DevicePath is NULL, then FALSE is returned.
@param DevicePath A pointer to a device path data structure.
@retval TRUE DevicePath is multi-instance.
@retval FALSE DevicePath is not multi-instance or DevicePath is NULL.
**/
BOOLEAN
EFIAPI
IsDevicePathMultiInstance (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
);
/**
This function retrieves the device path protocol from a handle.
Retrieves the device path protocol from a handle.
@param Handle The handle from which to retrieve the device path protocol.
This function returns the device path protocol from the handle specified by Handle. If Handle is
NULL or Handle does not contain a device path protocol, then NULL is returned.
@param Handle The handle from which to retrieve the device path protocol.
@return
This function returns the device path protocol from the handle specified by Handle.
If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.
@return The device path protocol from the handle specified by Handle.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
DevicePathFromHandle (
IN EFI_HANDLE Handle
)
;
IN EFI_HANDLE Handle
);
/**
This function allocates a device path for a file and appends it to an existing device path.
Allocates a device path for a file and appends it to an existing device path.
@param Device A pointer to a device handle. This parameter is optional and may be NULL.
@param FileName A pointer to a Null-terminated Unicode string.
If Device is a valid device handle that contains a device path protocol, then a device path for
the file specified by FileName is allocated and appended to the device path associated with the
handle Device. The allocated device path is returned. If Device is NULL or Device is a handle
that does not support the device path protocol, then a device path containing a single device
path node for the file specified by FileName is allocated and returned.
If FileName is NULL, then ASSERT().
@return
If Device is a valid device handle that contains a device path protocol,
then a device path for the file specified by FileName is allocated
and appended to the device path associated with the handle Device. The allocated device path is returned.
If Device is NULL or Device is a handle that does not support the device path protocol,
then a device path containing a single device path node for the file specified by FileName
is allocated and returned.
@param Device A pointer to a device handle. This parameter is optional and
may be NULL.
@param FileName A pointer to a Null-terminated Unicode string.
@return The allocated device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
FileDevicePath (
IN EFI_HANDLE Device, OPTIONAL
IN CONST CHAR16 *FileName
)
;
IN EFI_HANDLE Device, OPTIONAL
IN CONST CHAR16 *FileName
);
#endif

View File

@ -996,8 +996,7 @@ PciCf8BitFieldAndThenOr32 (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If the register specified by StartAddress >= 0x100, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.
@ -1030,8 +1029,7 @@ PciCf8ReadBuffer (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If the register specified by StartAddress >= 0x100, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.

View File

@ -965,8 +965,7 @@ PciExpressBitFieldAndThenOr32 (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.
@ -998,8 +997,7 @@ PciExpressReadBuffer (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.

View File

@ -960,8 +960,7 @@ PciBitFieldAndThenOr32 (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.
@ -993,8 +992,7 @@ PciReadBuffer (
If StartAddress > 0x0FFFFFFF, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
If Size > 0 and Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Bus, Device,
Function and Register.

View File

@ -1,5 +1,5 @@
/** @file
PEI Core Library implementation
Header file for PEI Services Library.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
@ -20,287 +20,279 @@
/**
This service enables a given PEIM to register an interface into the PEI Foundation.
@param PpiList A pointer to the list of interfaces that the caller shall install.
@param PpiList A pointer to the list of interfaces that the caller shall install.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
EFI_STATUS
EFIAPI
PeiServicesInstallPpi (
IN EFI_PEI_PPI_DESCRIPTOR *PpiList
)
;
IN EFI_PEI_PPI_DESCRIPTOR *PpiList
);
/**
This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
@param OldPpi Pointer to the old PEI PPI Descriptors.
@param NewPpi Pointer to the new PEI PPI Descriptors.
@param OldPpi Pointer to the old PEI PPI Descriptors.
@param NewPpi Pointer to the new PEI PPI Descriptors.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
@retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
@retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
installed.
**/
EFI_STATUS
EFIAPI
PeiServicesReInstallPpi (
IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
)
;
IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
);
/**
This service enables PEIMs to discover a given instance of an interface.
@param Guid A pointer to the GUID whose corresponding interface needs to be found.
@param Instance The N-th instance of the interface that is required.
@param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
@param Ppi A pointer to the instance of the interface.
@param Guid A pointer to the GUID whose corresponding interface needs to be
found.
@param Instance The N-th instance of the interface that is required.
@param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
@param Ppi A pointer to the instance of the interface.
@retval EFI_SUCCESS The interface was successfully returned.
@retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
@retval EFI_SUCCESS The interface was successfully returned.
@retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
**/
EFI_STATUS
EFIAPI
PeiServicesLocatePpi (
IN EFI_GUID *Guid,
IN UINTN Instance,
IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
IN OUT VOID **Ppi
)
;
IN EFI_GUID *Guid,
IN UINTN Instance,
IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
IN OUT VOID **Ppi
);
/**
This service enables PEIMs to register a given service to be invoked
when another service is installed or reinstalled.
This service enables PEIMs to register a given service to be invoked when another service is
installed or reinstalled.
@param NotifyList A pointer to the list of notification interfaces that the caller shall install.
@param NotifyList A pointer to the list of notification interfaces that the caller
shall install.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have
the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
EFI_STATUS
EFIAPI
PeiServicesNotifyPpi (
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
)
;
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
);
/**
This service enables PEIMs to ascertain the present value of the boot mode.
@param BootMode A pointer to contain the value of the boot mode.
@param BootMode A pointer to contain the value of the boot mode.
@retval EFI_SUCCESS The boot mode was returned successfully.
@retval EFI_INVALID_PARAMETER BootMode is NULL.
@retval EFI_SUCCESS The boot mode was returned successfully.
@retval EFI_INVALID_PARAMETER BootMode is NULL.
**/
EFI_STATUS
EFIAPI
PeiServicesGetBootMode (
IN OUT EFI_BOOT_MODE *BootMode
)
;
IN OUT EFI_BOOT_MODE *BootMode
);
/**
This service enables PEIMs to update the boot mode variable.
@param BootMode The value of the boot mode to set.
@param BootMode The value of the boot mode to set.
@retval EFI_SUCCESS The value was successfully updated
@retval EFI_SUCCESS The value was successfully updated
**/
EFI_STATUS
EFIAPI
PeiServicesSetBootMode (
IN EFI_BOOT_MODE BootMode
)
;
IN EFI_BOOT_MODE BootMode
);
/**
This service enables a PEIM to ascertain the address of the list of HOBs in memory.
@param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
@param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
@retval EFI_SUCCESS The list was successfully returned.
@retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
@retval EFI_SUCCESS The list was successfully returned.
@retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
**/
EFI_STATUS
EFIAPI
PeiServicesGetHobList (
IN OUT VOID **HobList
)
;
IN OUT VOID **HobList
);
/**
This service enables PEIMs to create various types of HOBs.
@param Type The type of HOB to be installed.
@param Length The length of the HOB to be added.
@param Hob The address of a pointer that will contain the HOB header.
@param Type The type of HOB to be installed.
@param Length The length of the HOB to be added.
@param Hob The address of a pointer that will contain the HOB header.
@retval EFI_SUCCESS The HOB was successfully created.
@retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
@retval EFI_SUCCESS The HOB was successfully created.
@retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
**/
EFI_STATUS
EFIAPI
PeiServicesCreateHob (
IN UINT16 Type,
IN UINT16 Length,
IN OUT VOID **Hob
)
;
IN UINT16 Type,
IN UINT16 Length,
IN OUT VOID **Hob
);
/**
This service enables PEIMs to discover additional firmware volumes.
@param Instance This instance of the firmware volume to find.
The value 0 is the Boot Firmware Volume (BFV).
@param FwVolHeader Pointer to the firmware volume header of the volume to return.
@param Instance This instance of the firmware volume to find. The value 0 is the
Boot Firmware Volume (BFV).
@param FwVolHeader Pointer to the firmware volume header of the volume to return.
@retval EFI_SUCCESS The volume was found.
@retval EFI_NOT_FOUND The volume was not found.
@retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
@retval EFI_SUCCESS The volume was found.
@retval EFI_NOT_FOUND The volume was not found.
@retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
**/
EFI_STATUS
EFIAPI
PeiServicesFfsFindNextVolume (
IN UINTN Instance,
IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
)
;
IN UINTN Instance,
IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
);
/**
This service enables PEIMs to discover additional firmware files.
@param SearchType A filter to find files only of this type.
@param FwVolHeader Pointer to the firmware volume header of the volume to search.
This parameter must point to a valid FFS volume.
@param FileHeader Pointer to the current file from which to begin searching.
@param SearchType A filter to find files only of this type.
@param FwVolHeader Pointer to the firmware volume header of the volume to search.
This parameter must point to a valid FFS volume.
@param FileHeader Pointer to the current file from which to begin searching.
@retval EFI_SUCCESS The file was found.
@retval EFI_NOT_FOUND The file was not found.
@retval EFI_NOT_FOUND The header checksum was not zero.
@retval EFI_SUCCESS The file was found.
@retval EFI_NOT_FOUND The file was not found.
@retval EFI_NOT_FOUND The header checksum was not zero.
**/
EFI_STATUS
EFIAPI
PeiServicesFfsFindNextFile (
IN EFI_FV_FILETYPE SearchType,
IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
IN OUT EFI_FFS_FILE_HEADER **FileHeader
)
;
IN EFI_FV_FILETYPE SearchType,
IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
IN OUT EFI_FFS_FILE_HEADER **FileHeader
);
/**
This service enables PEIMs to discover sections of a given type within a valid FFS file.
@param SearchType The value of the section type to find.
@param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
@param SectionData A pointer to the discovered section, if successful.
@param SearchType The value of the section type to find.
@param FfsFileHeader A pointer to the file header that contains the set of sections to
be searched.
@param SectionData A pointer to the discovered section, if successful.
@retval EFI_SUCCESS The section was found.
@retval EFI_NOT_FOUND The section was not found.
@retval EFI_SUCCESS The section was found.
@retval EFI_NOT_FOUND The section was not found.
**/
EFI_STATUS
EFIAPI
PeiServicesFfsFindSectionData (
IN EFI_SECTION_TYPE SectionType,
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
IN OUT VOID **SectionData
)
;
IN EFI_SECTION_TYPE SectionType,
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
IN OUT VOID **SectionData
);
/**
This service enables PEIMs to register the permanent memory configuration
that has been initialized with the PEI Foundation.
@param MemoryBegin The value of a region of installed memory.
@param MemoryLength The corresponding length of a region of installed memory.
@param MemoryBegin The value of a region of installed memory.
@param MemoryLength The corresponding length of a region of installed memory.
@retval EFI_SUCCESS The region was successfully installed in a HOB.
@retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
@retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
@retval EFI_SUCCESS The region was successfully installed in a HOB.
@retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
@retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
**/
EFI_STATUS
EFIAPI
PeiServicesInstallPeiMemory (
IN EFI_PHYSICAL_ADDRESS MemoryBegin,
IN UINT64 MemoryLength
)
;
IN EFI_PHYSICAL_ADDRESS MemoryBegin,
IN UINT64 MemoryLength
);
/**
This service enables PEIMs to allocate memory after the permanent memory has been installed by a PEIM.
This service enables PEIMs to allocate memory after the permanent memory has been installed by a
PEIM.
@param MemoryType Type of memory to allocate.
@param Pages Number of pages to allocate.
@param Memory Pointer of memory allocated.
@param MemoryType Type of memory to allocate.
@param Pages Number of pages to allocate.
@param Memory Pointer of memory allocated.
@retval EFI_SUCCESS The memory range was successfully allocated.
@retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
@retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
@retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
@retval EFI_SUCCESS The memory range was successfully allocated.
@retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
@retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
@retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
**/
EFI_STATUS
EFIAPI
PeiServicesAllocatePages (
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS *Memory
)
;
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS *Memory
);
/**
This service allocates memory from the Hand-Off Block (HOB) heap.
@param Size The number of bytes to allocate from the pool.
@param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer;
undefined otherwise.
@param Size The number of bytes to allocate from the pool.
@param Buffer If the call succeeds, a pointer to a pointer to the allocate
buffer; undefined otherwise.
@retval EFI_SUCCESS The allocation was successful
@retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
@retval EFI_SUCCESS The allocation was successful
@retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
**/
EFI_STATUS
EFIAPI
PeiServicesAllocatePool (
IN UINTN Size,
OUT VOID **Buffer
)
;
IN UINTN Size,
OUT VOID **Buffer
);
/**
This service resets the entire platform, including all processors and devices, and reboots the system.
This service resets the entire platform, including all processors and devices, and reboots the
system.
@retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
@retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
**/
EFI_STATUS
EFIAPI
PeiServicesResetSystem (
VOID
)
;
);
#endif

View File

@ -50,23 +50,27 @@
The Unicode string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list specified by Marker based on the
contents of the format string.
The length of the produced output buffer is returned.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
The number of Unicode characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@param Marker VA_LIST marker for the variable argument list.
@return return Length of the produced output buffer.
@return The number of Unicode characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -86,22 +90,26 @@ UnicodeVSPrint (
and BufferSize.
The Unicode string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list based on the contents of the format string.
The length of the produced output buffer is returned.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
The number of Unicode characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@return Length of the produced output buffer.
@return The number of Unicode characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -122,23 +130,27 @@ UnicodeSPrint (
The Unicode string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list specified by Marker based on the
contents of the format string.
The length of the produced output buffer is returned.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
The number of Unicode characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@param Marker VA_LIST marker for the variable argument list.
@return Length of the produced output buffer.
@return The number of Unicode characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -159,22 +171,26 @@ UnicodeVSPrintAsciiFormat (
The Unicode string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list based on the contents of the
format string.
The length of the produced output buffer is returned.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
The number of Unicode characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().
contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@return Length of the produced output buffer.
@return The number of Unicode characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -195,23 +211,27 @@ UnicodeSPrintAsciiFormat (
The ASCII string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list specified by Marker based on
the contents of the format string.
The length of the produced output buffer is returned.
The number of ASCII characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 0 and FormatString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
ASSERT().
If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
contains more than PcdMaximumAsciiStringLength ASCII characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
ASCII string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@param Marker VA_LIST marker for the variable argument list.
@return Length of the produced output buffer.
@return The number of ASCII characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -232,22 +252,26 @@ AsciiVSPrint (
The ASCII string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list based on the contents of the
format string.
The length of the produced output buffer is returned.
The number of ASCII characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 0 and FormatString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
ASSERT().
If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
contains more than PcdMaximumAsciiStringLength ASCII characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
ASCII string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@return Length of the produced output buffer.
@return The number of ASCII characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -268,23 +292,27 @@ AsciiSPrint (
The ASCII string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list specified by Marker based on
the contents of the format string.
The length of the produced output buffer is returned.
The number of ASCII characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
contains more than PcdMaximumAsciiStringLength ASCII characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
ASCII string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@param Marker VA_LIST marker for the variable argument list.
@return Length of the produced output buffer.
@return The number of ASCII characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -305,22 +333,26 @@ AsciiVSPrintUnicodeFormat (
The ASCII string is produced by parsing the format string specified by FormatString.
Arguments are pulled from the variable argument list based on the contents of the
format string.
The length of the produced output buffer is returned.
The number of ASCII characters in the produced output buffer is returned not including
the Null-terminator.
If BufferSize is 0, then no output buffer is produced and 0 is returned.
If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize is not 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().
If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 0 and FormatString is NULL, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
contains more than PcdMaximumAsciiStringLength ASCII characters not including the
Null-terminator, then ASSERT().
@param StartOfBuffer APointer to the output buffer for the produced Null-terminated
@param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
ASCII string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param FormatString Null-terminated Unicode format string.
@return Length of the produced output buffer.
@return The number of ASCII characters in the produced output buffer not including the
Null-terminator.
**/
UINTN
@ -338,7 +370,7 @@ AsciiSPrintUnicodeFormat (
Converts the decimal number specified by Value to a Null-terminated Unicode
string specified by Buffer containing at most Width characters.
If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
The total number of characters placed in Buffer is returned.
The number of Unicode characters in Buffer is returned not including the Null-terminator.
If the conversion contains more than Width characters, then only the first
Width characters are returned, and the total number of characters
required to perform the conversion is returned.
@ -362,9 +394,9 @@ AsciiSPrintUnicodeFormat (
Unicode string.
@param Flags The bitmask of flags that specify left justification, zero pad, and commas.
@param Value The 64-bit signed value to convert to a string.
@param Width The maximum number of Unicode characters to place in Buffer.
@param Width The maximum number of Unicode characters to place in Buffer.
@return Total number of characters required to perform the conversion.
@return The number of Unicode characters in Buffer not including the Null-terminator.
**/
UINTN
@ -382,7 +414,7 @@ UnicodeValueToString (
Converts the decimal number specified by Value to a Null-terminated ASCII string
specified by Buffer containing at most Width characters.
If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
The total number of characters placed in Buffer is returned.
The number of ASCII characters in Buffer is returned not including the Null-terminator.
If the conversion contains more than Width characters, then only the first Width
characters are returned, and the total number of characters required to perform
the conversion is returned.
@ -406,9 +438,9 @@ UnicodeValueToString (
ASCII string.
@param Flags The bitmask of flags that specify left justification, zero pad, and commas.
@param Value The 64-bit signed value to convert to a string.
@param Width The maximum number of ASCII characters to place in Buffer.
@param Width The maximum number of ASCII characters to place in Buffer.
@return Total number of characters required to perform the conversion.
@return The number of ASCII characters in Buffer not including the Null-terminator.
**/
UINTN

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -16,7 +16,7 @@
BaseMemoryLib
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -95,7 +95,8 @@ CompareGuid (
GUID in the target buffer is returned. If no match is found, then NULL is returned.
If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 128-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -115,16 +116,12 @@ ScanGuid (
{
CONST GUID *GuidPtr;
ASSERT (Buffer != NULL);
//
// Make sure Buffer is aligned on a 64-bit boundary.
//
ASSERT (((UINTN) Buffer & 7) == 0);
ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
GuidPtr = (GUID*)Buffer;
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
if (CompareGuid (GuidPtr, Guid)) {
return (VOID*)GuidPtr;

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -35,6 +35,7 @@
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -52,16 +53,14 @@ ScanMem16 (
IN UINT16 Value
)
{
UINTN Stride;
Stride = Length / sizeof (Value);
if (Stride == 0) {
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -35,6 +35,7 @@
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -52,16 +53,14 @@ ScanMem32 (
IN UINT32 Value
)
{
UINTN Stride;
Stride = Length / sizeof (Value);
if (Stride == 0) {
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -35,6 +35,7 @@
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Length is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -52,16 +53,14 @@ ScanMem64 (
IN UINT64 Value
)
{
UINTN Stride;
Stride = Length / sizeof (Value);
if (Stride == 0) {
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -32,7 +32,7 @@
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Memory to set.
@param Length Number of bytes to set
@param Length Number of bytes to set.
@param Value Value of the set operation.
@return Buffer.

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -95,7 +95,8 @@ CompareGuid (
GUID in the target buffer is returned. If no match is found, then NULL is returned.
If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 128-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -115,16 +116,12 @@ ScanGuid (
{
CONST GUID *GuidPtr;
ASSERT (Buffer != NULL);
//
// Make sure Buffer is aligned on a 64-bit boundary.
//
ASSERT (((UINTN) Buffer & 7) == 0);
ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
GuidPtr = (GUID*)Buffer;
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
if (CompareGuid (GuidPtr, Guid)) {
return (VOID*)GuidPtr;

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -35,6 +35,7 @@
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is not aligned on a 16-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -52,16 +53,14 @@ ScanMem16 (
IN UINT16 Value
)
{
UINTN Stride;
Stride = Length / sizeof (Value);
if (Stride == 0) {
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);
return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -35,6 +35,7 @@
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 32-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -52,16 +53,14 @@ ScanMem32 (
IN UINT32 Value
)
{
UINTN Stride;
Stride = Length / sizeof (Value);
if (Stride == 0) {
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -35,6 +35,7 @@
then NULL is returned. If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Length is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -52,16 +53,14 @@ ScanMem64 (
IN UINT64 Value
)
{
UINTN Stride;
Stride = Length / sizeof (Value);
if (Stride == 0) {
if (Length == 0) {
return NULL;
}
ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0);
return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);
return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
}

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -32,7 +32,7 @@
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Memory to set.
@param Length Number of bytes to set
@param Length Number of bytes to set.
@param Value Value of the set operation.
@return Buffer.

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/
@ -95,7 +95,8 @@ CompareGuid (
GUID in the target buffer is returned. If no match is found, then NULL is returned.
If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 128-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@ -115,16 +116,12 @@ ScanGuid (
{
CONST GUID *GuidPtr;
ASSERT (Buffer != NULL);
//
// Make sure Buffer is aligned on a 64-bit boundary.
//
ASSERT (((UINTN) Buffer & 7) == 0);
ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
GuidPtr = (GUID*)Buffer;
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
if (CompareGuid (GuidPtr, Guid)) {
return (VOID*)GuidPtr;

View File

@ -19,7 +19,7 @@
BaseMemoryLibSse2
BaseMemoryLibRepStr
PeiMemoryLib
UefiMemoryLib
DxeMemoryLib
**/

Some files were not shown because too many files have changed in this diff Show More