Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernise edk2-platforms (replace EFI_D_* and __FUNCTION__ with DEBUG_* and __func__) #184

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions Drivers/OpTee/OpteeRpmbPkg/FixupPcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ FixPcdMemory (
);

DEBUG ((DEBUG_INFO, "%a: Fixup PcdFlashNvStorageVariableBase64: 0x%lx\n",
__FUNCTION__, PcdGet64 (PcdFlashNvStorageVariableBase64)));
__func__, PcdGet64 (PcdFlashNvStorageVariableBase64)));
DEBUG ((DEBUG_INFO, "%a: Fixup PcdFlashNvStorageFtwWorkingBase64: 0x%lx\n",
__FUNCTION__, PcdGet64 (PcdFlashNvStorageFtwWorkingBase64)));
__func__, PcdGet64 (PcdFlashNvStorageFtwWorkingBase64)));
DEBUG ((DEBUG_INFO, "%a: Fixup PcdFlashNvStorageFtwSpareBase64: 0x%lx\n",
__FUNCTION__, PcdGet64 (PcdFlashNvStorageFtwSpareBase64)));
__func__, PcdGet64 (PcdFlashNvStorageFtwSpareBase64)));

return Status;
}
22 changes: 11 additions & 11 deletions Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,22 +575,22 @@ ValidateFvHeader (
|| (FwVolHeader->Signature != EFI_FVH_SIGNATURE)
|| (FwVolHeader->FvLength != FvLength)) {
DEBUG ((DEBUG_INFO, "%a: No Firmware Volume header present\n",
__FUNCTION__));
__func__));
return EFI_NOT_FOUND;
}

// Check the Firmware Volume Guid
if (!CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiSystemNvDataFvGuid)) {
DEBUG ((DEBUG_INFO, "%a: Firmware Volume Guid non-compatible\n",
__FUNCTION__));
__func__));
return EFI_VOLUME_CORRUPTED;
}

// Verify the header checksum
Checksum = CalculateSum16 ((UINT16*)FwVolHeader, FwVolHeader->HeaderLength);
if (Checksum != 0) {
DEBUG ((DEBUG_INFO, "%a: FV checksum is invalid (Checksum:0x%X)\n",
__FUNCTION__, Checksum));
__func__, Checksum));
return EFI_VOLUME_CORRUPTED;
}

Expand All @@ -600,15 +600,15 @@ ValidateFvHeader (
// Check the Variable Store Guid
if (!CompareGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid) &&
!CompareGuid (&VariableStoreHeader->Signature, &gEfiAuthenticatedVariableGuid)) {
DEBUG ((DEBUG_INFO, "%a: Variable Store Guid non-compatible\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Variable Store Guid non-compatible\n", __func__));
return EFI_VOLUME_CORRUPTED;
}

VariableStoreLength = PcdGet32 (PcdFlashNvStorageVariableSize) -
FwVolHeader->HeaderLength;
if (VariableStoreHeader->Size != VariableStoreLength) {
DEBUG ((DEBUG_INFO, "%a: Variable Store Length does not match\n",
__FUNCTION__));
__func__));
return EFI_VOLUME_CORRUPTED;
}

Expand Down Expand Up @@ -754,15 +754,15 @@ FvbInitialize (
Status = ValidateFvHeader (FwVolHeader);
if (EFI_ERROR (Status)) {
// There is no valid header, so time to install one.
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __func__));

// Reset memory
SetMem64 (
(VOID *)(UINTN)Instance->MemBaseAddress,
Instance->NBlocks * Instance->BlockSize,
~0UL
);
DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __func__));
Status = ReadWriteRpmb (
SP_SVC_RPMB_WRITE,
Instance->MemBaseAddress,
Expand All @@ -776,13 +776,13 @@ FvbInitialize (
}
// Install all appropriate headers
DEBUG ((DEBUG_INFO, "%a: Installing a correct one for this volume.\n",
__FUNCTION__));
__func__));
Status = InitializeFvAndVariableStoreHeaders (Instance);
if (EFI_ERROR (Status)) {
return Status;
}
} else {
DEBUG ((DEBUG_INFO, "%a: Found valid FVB Header.\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Found valid FVB Header.\n", __func__));
}
Instance->Initialized = TRUE;

Expand Down Expand Up @@ -861,9 +861,9 @@ OpTeeRpmbFvbInit (
);
ASSERT_EFI_ERROR (Status);

DEBUG ((DEBUG_INFO, "%a: Register OP-TEE RPMB Fvb\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Register OP-TEE RPMB Fvb\n", __func__));
DEBUG ((DEBUG_INFO, "%a: Using NV store FV in-memory copy at 0x%lx\n",
__FUNCTION__, PatchPcdGet64 (PcdFlashNvStorageVariableBase64)));
__func__, PatchPcdGet64 (PcdFlashNvStorageVariableBase64)));

return Status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Uint32SqRt (
Mask = Mask >> 1
) {
SqRtMask = SqRt | Mask;
//DEBUG ((EFI_D_INFO, "Uint32=0x%x SqRtMask=0x%x\n", Uint32, SqRtMask));
//DEBUG ((DEBUG_INFO, "Uint32=0x%x SqRtMask=0x%x\n", Uint32, SqRtMask));
Squared = (UINT32) (SqRtMask * SqRtMask);
if (Squared > Uint32) {
continue;
Expand Down Expand Up @@ -196,14 +196,14 @@ TestColor (
10000000
);
if (TriWidth > ScreenWidth) {
DEBUG ((EFI_D_INFO, "TriWidth at %d was too big\n", TriWidth));
DEBUG ((DEBUG_INFO, "TriWidth at %d was too big\n", TriWidth));
TriWidth = ScreenWidth;
} else if (TriHeight > ScreenHeight) {
DEBUG ((EFI_D_INFO, "TriHeight at %d was too big\n", TriHeight));
DEBUG ((DEBUG_INFO, "TriHeight at %d was too big\n", TriHeight));
TriHeight = ScreenHeight;
}

DEBUG ((EFI_D_INFO, "Triangle Width: %d; Height: %d\n", TriWidth, TriHeight));
DEBUG ((DEBUG_INFO, "Triangle Width: %d; Height: %d\n", TriWidth, TriHeight));

X1 = (ScreenWidth - TriWidth) / 2;
X3 = X1 + TriWidth - 1;
Expand Down
16 changes: 8 additions & 8 deletions Drivers/OptionRomPkg/AtapiPassThruDxe/AtapiPassThru.c
Original file line number Diff line number Diff line change
Expand Up @@ -3215,15 +3215,15 @@ Routine Description:

if (StatusRegister & DWF) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Write Fault\n",
StatusRegister)
);
}

if (StatusRegister & CORR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Corrected Data\n",
StatusRegister)
);
Expand All @@ -3235,47 +3235,47 @@ Routine Description:

if (ErrorRegister & BBK_ERR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Bad Block Detected\n",
ErrorRegister)
);
}

if (ErrorRegister & UNC_ERR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Uncorrectable Data\n",
ErrorRegister)
);
}

if (ErrorRegister & MC_ERR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Media Change\n",
ErrorRegister)
);
}

if (ErrorRegister & ABRT_ERR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Abort\n",
ErrorRegister)
);
}

if (ErrorRegister & TK0NF_ERR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Track 0 Not Found\n",
ErrorRegister)
);
}

if (ErrorRegister & AMNF_ERR) {
DEBUG (
(EFI_D_BLKIO,
(DEBUG_BLKIO,
"AtapiPassThruCheckErrorStatus()-- %02x : Error : Address Mark Not Found\n",
ErrorRegister)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ ConfigurePixelBitMaskFormat (
mPixelShr[Loop] = 0;
}
MergedMasks = (UINT32) (MergedMasks | Masks[Loop]);
DEBUG ((EFI_D_INFO, "%d: shl:%d shr:%d mask:%x\n", Loop, mPixelShl[Loop], mPixelShr[Loop], Masks[Loop]));
DEBUG ((DEBUG_INFO, "%d: shl:%d shr:%d mask:%x\n", Loop, mPixelShl[Loop], mPixelShr[Loop], Masks[Loop]));
}
MergedMasks = (UINT32) (MergedMasks | Masks[3]);

ASSERT (MergedMasks != 0);
mBltLibBytesPerPixel = (UINTN) ((HighBitSet32 (MergedMasks) + 7) / 8);

DEBUG ((EFI_D_INFO, "Bytes per pixel: %d\n", mBltLibBytesPerPixel));
DEBUG ((DEBUG_INFO, "Bytes per pixel: %d\n", mBltLibBytesPerPixel));

CopyMem (&mPixelBitMasks, BitMask, sizeof (*BitMask));
}
Expand Down Expand Up @@ -245,17 +245,17 @@ BltLibVideoFill (
// BltBuffer to Video: Source is BltBuffer, destination is Video
//
if (DestinationY + Height > mBltLibHeight) {
DEBUG ((EFI_D_INFO, "VideoFill: Past screen (Y)\n"));
DEBUG ((DEBUG_INFO, "VideoFill: Past screen (Y)\n"));
return EFI_INVALID_PARAMETER;
}

if (DestinationX + Width > mBltLibWidthInPixels) {
DEBUG ((EFI_D_INFO, "VideoFill: Past screen (X)\n"));
DEBUG ((DEBUG_INFO, "VideoFill: Past screen (X)\n"));
return EFI_INVALID_PARAMETER;
}

if (Width == 0 || Height == 0) {
DEBUG ((EFI_D_INFO, "VideoFill: Width or Height is 0\n"));
DEBUG ((DEBUG_INFO, "VideoFill: Width or Height is 0\n"));
return EFI_INVALID_PARAMETER;
}

Expand All @@ -268,7 +268,7 @@ BltLibVideoFill (
(((Uint32 << mPixelShl[1]) >> mPixelShr[1]) & mPixelBitMasks.GreenMask) |
(((Uint32 << mPixelShl[2]) >> mPixelShr[2]) & mPixelBitMasks.BlueMask)
);
VDEBUG ((EFI_D_INFO, "VideoFill: color=0x%x, wide-fill=0x%x\n", Uint32, WideFill));
VDEBUG ((DEBUG_INFO, "VideoFill: color=0x%x, wide-fill=0x%x\n", Uint32, WideFill));

//
// If the size of the pixel data evenly divides the sizeof
Expand Down Expand Up @@ -299,7 +299,7 @@ BltLibVideoFill (
}

if (UseWideFill && (DestinationX == 0) && (Width == mBltLibWidthInPixels)) {
VDEBUG ((EFI_D_INFO, "VideoFill (wide, one-shot)\n"));
VDEBUG ((DEBUG_INFO, "VideoFill (wide, one-shot)\n"));
Offset = DestinationY * mBltLibWidthInPixels;
Offset = mBltLibBytesPerPixel * Offset;
BltMemDst = (VOID*) (mBltLibFrameBuffer + Offset);
Expand All @@ -319,7 +319,7 @@ BltLibVideoFill (
BltMemDst = (VOID*) (mBltLibFrameBuffer + Offset);

if (UseWideFill && (((UINTN) BltMemDst & 7) == 0)) {
VDEBUG ((EFI_D_INFO, "VideoFill (wide)\n"));
VDEBUG ((DEBUG_INFO, "VideoFill (wide)\n"));
SizeInBytes = WidthInBytes;
if (SizeInBytes >= 8) {
SetMem64 (BltMemDst, SizeInBytes & ~7, WideFill);
Expand All @@ -329,7 +329,7 @@ BltLibVideoFill (
CopyMem (BltMemDst, (VOID*) &WideFill, SizeInBytes);
}
} else {
VDEBUG ((EFI_D_INFO, "VideoFill (not wide)\n"));
VDEBUG ((DEBUG_INFO, "VideoFill (not wide)\n"));
if (!LineBufferReady) {
CopyMem (mBltLibLineBuffer, &WideFill, mBltLibBytesPerPixel);
for (X = 1; X < Width; ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ PostCodeStatusCodeReportWorker (

PostCodeValue = GetPostCodeFromStatusCode (CodeType, Value);
if (PostCodeValue != 0) {
DEBUG ((EFI_D_INFO, "POSTCODE=<%02x>\n", PostCodeValue));
DEBUG ((DEBUG_INFO, "POSTCODE=<%02x>\n", PostCodeValue));
PostCode (PostCodeValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PostCodeStatusCodeReportWorker (

PostCodeValue = GetPostCodeFromStatusCode (CodeType, Value);
if (PostCodeValue != 0) {
DEBUG ((EFI_D_INFO, "POSTCODE=<%02x>\n", PostCodeValue));
DEBUG ((DEBUG_INFO, "POSTCODE=<%02x>\n", PostCodeValue));
PostCode (PostCodeValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ PostCodeStatusCodeReportWorker (

PostCodeValue = GetPostCodeFromStatusCode (CodeType, Value);
if (PostCodeValue != 0) {
DEBUG ((EFI_D_INFO, "POSTCODE=<%02x>\n", PostCodeValue));
DEBUG ((DEBUG_INFO, "POSTCODE=<%02x>\n", PostCodeValue));
PostCode (PostCodeValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Routine Description:
&DataSize
);
if (Status == EFI_SUCCESS) {
DEBUG ((EFI_D_INFO, "IPMI: SendCommand success!\n"));
DEBUG ((DEBUG_INFO, "IPMI: SendCommand success!\n"));
break;
} else {
//
// Display message and retry.
//
DEBUG (
(DEBUG_WARN | EFI_D_INFO,
(DEBUG_WARN | DEBUG_INFO,
"IPMI: Waiting for BMC (KCS 0x%x)...\n",
IpmiInstance->IpmiIoBase)
);
Expand Down
4 changes: 2 additions & 2 deletions Features/Intel/PowerManagement/S3FeaturePkg/S3Dxe/S3Dxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ S3DxeEntryPoint (
ACPI_S3_MEMORY S3MemoryInfo;
EFI_STATUS Status;

DEBUG ((DEBUG_INFO, "%a() Start\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a() Start\n", __func__));

S3PeiMemSize = (UINTN) GetPeiMemSize ();
S3PeiMemBase = (UINTN) AllocateAcpiNvsMemoryBelow4G (S3PeiMemSize);
Expand All @@ -150,6 +150,6 @@ S3DxeEntryPoint (
);
ASSERT_EFI_ERROR (Status);

DEBUG ((DEBUG_INFO, "%a() End\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a() End\n", __func__));
return EFI_SUCCESS;
}
6 changes: 3 additions & 3 deletions Platform/96Boards/96BoardsI2cDxe/96BoardsI2cDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ EnableI2cBusConfiguration (
&gEfiI2cMasterProtocolGuid, (VOID **)&I2cMaster);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: gBS->HandleProtocol() failed - %r\n",
__FUNCTION__, Status));
__func__, Status));
return Status;
}

BusClockHertz = Bus->BusFrequency;
Status = I2cMaster->SetBusFrequency (I2cMaster, &BusClockHertz);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: I2cMaster->SetBusFrequency() failed - %r\n",
__FUNCTION__, Status));
__func__, Status));
return Status;
}

Expand Down Expand Up @@ -162,7 +162,7 @@ RegisterI2cBus (
Status = gBS->LocateHandle (ByProtocol, Guid, NULL, &BufferSize,
&I2cBus->I2cMasterHandle);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "%a: gBS->LocateHandle() failed - %r\n", __FUNCTION__,
DEBUG ((DEBUG_INFO, "%a: gBS->LocateHandle() failed - %r\n", __func__,
Status));
return;
}
Expand Down
Loading