MdePkg: Change use of EFI_D_* to DEBUG_*

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739

Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Michael D Kinney 2021-11-16 19:21:31 -08:00 committed by mergify[bot]
parent 87000d7708
commit 5f289f3ae3
6 changed files with 29 additions and 31 deletions

View File

@ -448,7 +448,7 @@ UnitTestDebugAssert (
do { \
if (DebugAssertEnabled ()) { \
if (EFI_ERROR (StatusParameter)) { \
DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \
DEBUG ((DEBUG_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \
_ASSERT (!EFI_ERROR (StatusParameter)); \
} \
} \

View File

@ -235,10 +235,9 @@ PeHotRelocateImageEx (
ASSERT (FALSE);
// break omitted - ARM instruction encoding not implemented
default:
DEBUG ((EFI_D_ERROR, "PeHotRelocateEx:unknown fixed type\n"));
DEBUG ((DEBUG_ERROR, "PeHotRelocateEx:unknown fixed type\n"));
return RETURN_UNSUPPORTED;
}
return RETURN_SUCCESS;
}

View File

@ -36,7 +36,7 @@ PostCode (
IN UINT32 Value
)
{
DEBUG((EFI_D_INFO, "POST %08x\n", Value));
DEBUG((DEBUG_INFO, "POST %08x\n", Value));
return Value;
}
@ -72,7 +72,7 @@ PostCodeWithDescription (
IN CONST CHAR8 *Description OPTIONAL
)
{
DEBUG((EFI_D_INFO, "POST %08x - %s\n", Value, Description));
DEBUG((DEBUG_INFO, "POST %08x - %s\n", Value, Description));
return Value;
}

View File

@ -161,15 +161,15 @@ InternalHstiIsValidTable (
// basic check for header
//
if (HstiData == NULL) {
DEBUG ((EFI_D_ERROR, "HstiData == NULL\n"));
DEBUG ((DEBUG_ERROR, "HstiData == NULL\n"));
return FALSE;
}
if (HstiSize < sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) {
DEBUG ((EFI_D_ERROR, "HstiSize < sizeof(ADAPTER_INFO_PLATFORM_SECURITY)\n"));
DEBUG ((DEBUG_ERROR, "HstiSize < sizeof(ADAPTER_INFO_PLATFORM_SECURITY)\n"));
return FALSE;
}
if (((HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < Hsti->SecurityFeaturesSize) {
DEBUG ((EFI_D_ERROR, "((HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < SecurityFeaturesSize\n"));
DEBUG ((DEBUG_ERROR, "((HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < SecurityFeaturesSize\n"));
return FALSE;
}
@ -177,7 +177,7 @@ InternalHstiIsValidTable (
// Check Version
//
if (Hsti->Version != PLATFORM_SECURITY_VERSION_VNEXTCS) {
DEBUG ((EFI_D_ERROR, "Version != PLATFORM_SECURITY_VERSION_VNEXTCS\n"));
DEBUG ((DEBUG_ERROR, "Version != PLATFORM_SECURITY_VERSION_VNEXTCS\n"));
return FALSE;
}
@ -186,8 +186,8 @@ InternalHstiIsValidTable (
//
if ((Hsti->Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) ||
(Hsti->Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM)) {
DEBUG ((EFI_D_ERROR, "Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE ||\n"));
DEBUG ((EFI_D_ERROR, "Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM\n"));
DEBUG ((DEBUG_ERROR, "Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE ||\n"));
DEBUG ((DEBUG_ERROR, "Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM\n"));
return FALSE;
}
@ -200,7 +200,7 @@ InternalHstiIsValidTable (
}
}
if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {
DEBUG ((EFI_D_ERROR, "ImplementationID has no NUL CHAR\n"));
DEBUG ((DEBUG_ERROR, "ImplementationID has no NUL CHAR\n"));
return FALSE;
}
@ -211,11 +211,11 @@ InternalHstiIsValidTable (
// basic check for ErrorString
//
if (ErrorStringSize == 0) {
DEBUG ((EFI_D_ERROR, "ErrorStringSize == 0\n"));
DEBUG ((DEBUG_ERROR, "ErrorStringSize == 0\n"));
return FALSE;
}
if ((ErrorStringSize & BIT0) != 0) {
DEBUG ((EFI_D_ERROR, "(ErrorStringSize & BIT0) != 0\n"));
DEBUG ((DEBUG_ERROR, "(ErrorStringSize & BIT0) != 0\n"));
return FALSE;
}
@ -232,11 +232,11 @@ InternalHstiIsValidTable (
// check the length of ErrorString
//
if (ErrorChar != 0) {
DEBUG ((EFI_D_ERROR, "ErrorString has no NUL CHAR\n"));
DEBUG ((DEBUG_ERROR, "ErrorString has no NUL CHAR\n"));
return FALSE;
}
if (ErrorStringLength == (ErrorStringSize/2)) {
DEBUG ((EFI_D_ERROR, "ErrorString Length incorrect\n"));
DEBUG ((DEBUG_ERROR, "ErrorString Length incorrect\n"));
return FALSE;
}

View File

@ -97,7 +97,7 @@ SmmMemLibInternalCalculateMaximumSupportAddress (
// Save the maximum support address in one global variable
//
mSmmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1);
DEBUG ((EFI_D_INFO, "mSmmMemLibInternalMaximumSupportAddress = 0x%lx\n", mSmmMemLibInternalMaximumSupportAddress));
DEBUG ((DEBUG_INFO, "mSmmMemLibInternalMaximumSupportAddress = 0x%lx\n", mSmmMemLibInternalMaximumSupportAddress));
}
/**
@ -129,7 +129,7 @@ SmmIsBufferOutsideSmmValid (
// Overflow happen
//
DEBUG ((
EFI_D_ERROR,
DEBUG_ERROR,
"SmmIsBufferOutsideSmmValid: Overflow: Buffer (0x%lx) - Length (0x%lx), MaximumSupportAddress (0x%lx)\n",
Buffer,
Length,
@ -142,13 +142,13 @@ SmmIsBufferOutsideSmmValid (
if (((Buffer >= mSmmMemLibInternalSmramRanges[Index].CpuStart) && (Buffer < mSmmMemLibInternalSmramRanges[Index].CpuStart + mSmmMemLibInternalSmramRanges[Index].PhysicalSize)) ||
((mSmmMemLibInternalSmramRanges[Index].CpuStart >= Buffer) && (mSmmMemLibInternalSmramRanges[Index].CpuStart < Buffer + Length))) {
DEBUG ((
EFI_D_ERROR,
DEBUG_ERROR,
"SmmIsBufferOutsideSmmValid: Overlap: Buffer (0x%lx) - Length (0x%lx), ",
Buffer,
Length
));
DEBUG ((
EFI_D_ERROR,
DEBUG_ERROR,
"CpuStart (0x%lx) - PhysicalSize (0x%lx)\n",
mSmmMemLibInternalSmramRanges[Index].CpuStart,
mSmmMemLibInternalSmramRanges[Index].PhysicalSize
@ -176,7 +176,7 @@ SmmIsBufferOutsideSmmValid (
if (!InValidCommunicationRegion) {
DEBUG ((
EFI_D_ERROR,
DEBUG_ERROR,
"SmmIsBufferOutsideSmmValid: Not in ValidCommunicationRegion: Buffer (0x%lx) - Length (0x%lx)\n",
Buffer,
Length
@ -191,7 +191,7 @@ SmmIsBufferOutsideSmmValid (
if (((Buffer >= mSmmMemLibGcdMemSpace[Index].BaseAddress) && (Buffer < mSmmMemLibGcdMemSpace[Index].BaseAddress + mSmmMemLibGcdMemSpace[Index].Length)) ||
((mSmmMemLibGcdMemSpace[Index].BaseAddress >= Buffer) && (mSmmMemLibGcdMemSpace[Index].BaseAddress < Buffer + Length))) {
DEBUG ((
EFI_D_ERROR,
DEBUG_ERROR,
"SmmIsBufferOutsideSmmValid: In Untested Memory Region: Buffer (0x%lx) - Length (0x%lx)\n",
Buffer,
Length
@ -213,7 +213,7 @@ SmmIsBufferOutsideSmmValid (
if (((Buffer >= Entry->PhysicalStart) && (Buffer < Entry->PhysicalStart + LShiftU64 (Entry->NumberOfPages, EFI_PAGE_SHIFT))) ||
((Entry->PhysicalStart >= Buffer) && (Entry->PhysicalStart < Buffer + Length))) {
DEBUG ((
EFI_D_ERROR,
DEBUG_ERROR,
"SmmIsBufferOutsideSmmValid: In RuntimeCode Region: Buffer (0x%lx) - Length (0x%lx)\n",
Buffer,
Length
@ -255,7 +255,7 @@ SmmCopyMemToSmram (
)
{
if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)SourceBuffer, Length)) {
DEBUG ((EFI_D_ERROR, "SmmCopyMemToSmram: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
DEBUG ((DEBUG_ERROR, "SmmCopyMemToSmram: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
return EFI_SECURITY_VIOLATION;
}
CopyMem (DestinationBuffer, SourceBuffer, Length);
@ -288,7 +288,7 @@ SmmCopyMemFromSmram (
)
{
if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)DestinationBuffer, Length)) {
DEBUG ((EFI_D_ERROR, "SmmCopyMemFromSmram: Security Violation: Destination (0x%x), Length (0x%x)\n", DestinationBuffer, Length));
DEBUG ((DEBUG_ERROR, "SmmCopyMemFromSmram: Security Violation: Destination (0x%x), Length (0x%x)\n", DestinationBuffer, Length));
return EFI_SECURITY_VIOLATION;
}
CopyMem (DestinationBuffer, SourceBuffer, Length);
@ -322,11 +322,11 @@ SmmCopyMem (
)
{
if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)DestinationBuffer, Length)) {
DEBUG ((EFI_D_ERROR, "SmmCopyMem: Security Violation: Destination (0x%x), Length (0x%x)\n", DestinationBuffer, Length));
DEBUG ((DEBUG_ERROR, "SmmCopyMem: Security Violation: Destination (0x%x), Length (0x%x)\n", DestinationBuffer, Length));
return EFI_SECURITY_VIOLATION;
}
if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)SourceBuffer, Length)) {
DEBUG ((EFI_D_ERROR, "SmmCopyMem: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
DEBUG ((DEBUG_ERROR, "SmmCopyMem: Security Violation: Source (0x%x), Length (0x%x)\n", SourceBuffer, Length));
return EFI_SECURITY_VIOLATION;
}
CopyMem (DestinationBuffer, SourceBuffer, Length);
@ -358,7 +358,7 @@ SmmSetMem (
)
{
if (!SmmIsBufferOutsideSmmValid ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Length)) {
DEBUG ((EFI_D_ERROR, "SmmSetMem: Security Violation: Source (0x%x), Length (0x%x)\n", Buffer, Length));
DEBUG ((DEBUG_ERROR, "SmmSetMem: Security Violation: Source (0x%x), Length (0x%x)\n", Buffer, Length));
return EFI_SECURITY_VIOLATION;
}
SetMem (Buffer, Length, Value);

View File

@ -80,7 +80,7 @@ EfiCreateEventLegacyBootEx (
ASSERT (LegacyBootEvent != NULL);
if (gST->Hdr.Revision < EFI_2_00_SYSTEM_TABLE_REVISION) {
DEBUG ((EFI_D_ERROR, "EFI1.1 can't support LegacyBootEvent!"));
DEBUG ((DEBUG_ERROR, "EFI1.1 can't support LegacyBootEvent!"));
ASSERT (FALSE);
return EFI_UNSUPPORTED;
@ -175,7 +175,7 @@ EfiCreateEventReadyToBootEx (
ASSERT (ReadyToBootEvent != NULL);
if (gST->Hdr.Revision < EFI_2_00_SYSTEM_TABLE_REVISION) {
DEBUG ((EFI_D_ERROR, "EFI1.1 can't support ReadyToBootEvent!"));
DEBUG ((DEBUG_ERROR, "EFI1.1 can't support ReadyToBootEvent!"));
ASSERT (FALSE);
return EFI_UNSUPPORTED;
@ -327,4 +327,3 @@ EfiInitializeFwVolDevicepathNode (
CopyGuid (&FvDevicePathNode->FvFileName, NameGuid);
}