Skip to content

Commit

Permalink
UefiCpuPkg: Update code to be more C11 compliant by using __func__
Browse files Browse the repository at this point in the history
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
UefiCpuPkg.

Signed-off-by: Rebecca Cran <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
Reviewed-by: Sunil V L <[email protected]>
  • Loading branch information
bexcran authored and mergify[bot] committed Apr 10, 2023
1 parent 1639b6b commit 089013a
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions UefiCpuPkg/CpuDxe/CpuDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ IntersectMemoryDescriptor (
EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
"%a: %a: add [%Lx, %Lx): %r\n",
gEfiCallerBaseName,
__FUNCTION__,
__func__,
IntersectionBase,
IntersectionEnd,
Status
Expand All @@ -1091,7 +1091,7 @@ IntersectMemoryDescriptor (
"%a: %a: desc [%Lx, %Lx) type %u cap %Lx conflicts "
"with aperture [%Lx, %Lx) cap %Lx\n",
gEfiCallerBaseName,
__FUNCTION__,
__func__,
Descriptor->BaseAddress,
Descriptor->BaseAddress + Descriptor->Length,
(UINT32)Descriptor->GcdMemoryType,
Expand Down Expand Up @@ -1132,7 +1132,7 @@ AddMemoryMappedIoSpace (
DEBUG_ERROR,
"%a: %a: GetMemorySpaceMap(): %r\n",
gEfiCallerBaseName,
__FUNCTION__,
__func__,
Status
));
return Status;
Expand Down Expand Up @@ -1215,7 +1215,7 @@ AddLocalApicMemorySpace (
DEBUG_INFO,
"%a: %a: AllocateMemorySpace() Status - %r\n",
gEfiCallerBaseName,
__FUNCTION__,
__func__,
Status
));
}
Expand Down
6 changes: 3 additions & 3 deletions UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ CpuSetMemoryAttributes (
IN UINT64 Attributes
)
{
DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __func__));
return EFI_SUCCESS;
}

Expand Down Expand Up @@ -328,10 +328,10 @@ InitializeCpu (
return EFI_NOT_FOUND;
}

DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __FUNCTION__, FirmwareContext));
DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __func__, FirmwareContext));

mBootHartId = FirmwareContext->BootHartId;
DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __FUNCTION__, mBootHartId));
DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __func__, mBootHartId));

InitializeCpuExceptionHandlers (NULL);

Expand Down
2 changes: 1 addition & 1 deletion UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ CpuS3DataOnEndOfDxe (
);
ASSERT_EFI_ERROR (Status);

DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));
DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ RegisterCpuInterruptHandler (
IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
)
{
DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __FUNCTION__, ExceptionType, InterruptHandler));
DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __func__, ExceptionType, InterruptHandler));
if (EXCEPT_RISCV_IS_IRQ (ExceptionType)) {
if (EXCEPT_RISCV_IRQ_INDEX (ExceptionType) > EXCEPT_RISCV_MAX_IRQS) {
return EFI_UNSUPPORTED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ GetBspStackBase (
DEBUG ((
DEBUG_INFO,
"%a: Bsp StackBase = 0x%016lx StackSize = 0x%016lx\n",
__FUNCTION__,
__func__,
MemoryHob->AllocDescriptor.MemoryBaseAddress,
MemoryHob->AllocDescriptor.MemoryLength
));
Expand Down
2 changes: 1 addition & 1 deletion UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ MpInitChangeApLoopCallback (
);
}

DEBUG ((DEBUG_INFO, "%a() done!\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a() done!\n", __func__));
}

/**
Expand Down
8 changes: 4 additions & 4 deletions UefiCpuPkg/Library/MpInitLib/Microcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ ShadowMicrocodePatchWorker (
DEBUG ((
DEBUG_INFO,
"%a: Required microcode patches have been loaded at 0x%lx, with size 0x%lx.\n",
__FUNCTION__,
__func__,
CpuMpData->MicrocodePatchAddress,
CpuMpData->MicrocodePatchRegionSize
));
Expand Down Expand Up @@ -305,7 +305,7 @@ ShadowMicrocodePatchByPcd (
DEBUG ((
DEBUG_INFO,
"%a: 0x%x microcode patches will be loaded into memory, with size 0x%x.\n",
__FUNCTION__,
__func__,
PatchCount,
TotalLoadSize
));
Expand Down Expand Up @@ -365,7 +365,7 @@ GetMicrocodePatchInfoFromHob (

GuidHob = GetFirstGuidHob (&gEdkiiMicrocodePatchHobGuid);
if (GuidHob == NULL) {
DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n", __func__));
return FALSE;
}

Expand All @@ -377,7 +377,7 @@ GetMicrocodePatchInfoFromHob (
DEBUG ((
DEBUG_INFO,
"%a: MicrocodeBase = 0x%lx, MicrocodeSize = 0x%lx\n",
__FUNCTION__,
__func__,
*Address,
*RegionSize
));
Expand Down
2 changes: 1 addition & 1 deletion UefiCpuPkg/Library/MpInitLib/MpLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ TimedWaitForApFinish (
DEBUG ((
DEBUG_VERBOSE,
"%a: reached FinishedApLimit=%u in %Lu microseconds\n",
__FUNCTION__,
__func__,
FinishedApLimit,
DivU64x64Remainder (
MultU64x32 (CpuMpData->TotalTime, 1000000),
Expand Down
2 changes: 1 addition & 1 deletion UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ PlatformShadowMicrocode (
DEBUG ((
DEBUG_INFO,
"%a: Required microcode patches have been loaded at 0x%lx, with size 0x%lx.\n",
__FUNCTION__,
__func__,
CpuMpData->MicrocodePatchAddress,
CpuMpData->MicrocodePatchRegionSize
));
Expand Down
2 changes: 1 addition & 1 deletion UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ InitSmmS3ResumeState (
DEBUG ((
DEBUG_ERROR,
"ERROR:%a(): HOB(gEfiAcpiVariableGuid=%g) needed by S3 resume doesn't exist!\n",
__FUNCTION__,
__func__,
&gEfiAcpiVariableGuid
));
CpuDeadLoop ();
Expand Down
10 changes: 5 additions & 5 deletions UefiCpuPkg/SecCore/SecMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ SecStartup (
DEBUG ((
DEBUG_INFO,
"%a() TempRAM Base: 0x%x, TempRAM Size: 0x%x, BootFirmwareVolume 0x%x\n",
__FUNCTION__,
__func__,
TempRamBase,
SizeOfRam,
BootFirmwareVolume
Expand Down Expand Up @@ -242,7 +242,7 @@ SecStartup (
DEBUG ((
DEBUG_INFO,
"%a() BFV Base: 0x%x, BFV Size: 0x%x, TempRAM Base: 0x%x, TempRAM Size: 0x%x, PeiTempRamBase: 0x%x, PeiTempRamSize: 0x%x, StackBase: 0x%x, StackSize: 0x%x\n",
__FUNCTION__,
__func__,
SecCoreData.BootFirmwareVolumeBase,
SecCoreData.BootFirmwareVolumeSize,
SecCoreData.TemporaryRamBase,
Expand Down Expand Up @@ -345,7 +345,7 @@ SecStartupPhase2 (
DEBUG ((
DEBUG_INFO,
"%a() PeiCoreEntryPoint: 0x%x\n",
__FUNCTION__,
__func__,
PeiCoreEntryPoint
));

Expand Down Expand Up @@ -394,7 +394,7 @@ SecStartupPhase2 (
DEBUG ((
DEBUG_INFO,
"%a() PeiTemporaryRamBase: 0x%x, PeiTemporaryRamSize: 0x%x\n",
__FUNCTION__,
__func__,
SecCoreData->PeiTemporaryRamBase,
SecCoreData->PeiTemporaryRamSize
));
Expand All @@ -408,7 +408,7 @@ SecStartupPhase2 (
DEBUG ((
DEBUG_INFO,
"%a() Stack Base: 0x%p, Stack Size: 0x%x\n",
__FUNCTION__,
__func__,
SecCoreData->StackBase,
(UINT32)SecCoreData->StackSize
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ InitUTContext (

Status = MpServicesUnitTestWhoAmI (LocalContext->MpServices, &BspNumber);
UT_ASSERT_NOT_EFI_ERROR (Status);
DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __FUNCTION__, BspNumber));
DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __func__, BspNumber));

Status = MpServicesUnitTestGetNumberOfProcessors (
LocalContext->MpServices,
Expand All @@ -56,7 +56,7 @@ InitUTContext (
DEBUG ((
DEBUG_INFO,
"%a: NumberOfProcessors = 0x%x, NumberOfEnabledProcessors = 0x%x\n",
__FUNCTION__,
__func__,
NumberOfProcessors,
NumberOfEnabledProcessors
));
Expand Down Expand Up @@ -89,7 +89,7 @@ InitUTContext (
LocalContext->DisabledApNumber[IndexOfDisabledAPs] = ProcessorNumber;
IndexOfDisabledAPs++;

DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily enable it.\n", __FUNCTION__, ProcessorNumber));
DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily enable it.\n", __func__, ProcessorNumber));
Status = MpServicesUnitTestEnableDisableAP (
LocalContext->MpServices,
ProcessorNumber,
Expand Down Expand Up @@ -134,7 +134,7 @@ CheckUTContext (

if (BspNumber != LocalContext->BspNumber) {
LocalContext->BspNumber = BspNumber;
DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __FUNCTION__, BspNumber));
DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __func__, BspNumber));
}

ASSERT (BspNumber == LocalContext->BspNumber);
Expand All @@ -148,11 +148,11 @@ CheckUTContext (

if (NumberOfProcessors != LocalContext->NumberOfProcessors) {
LocalContext->NumberOfProcessors = NumberOfProcessors;
DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n", __FUNCTION__, NumberOfProcessors));
DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n", __func__, NumberOfProcessors));
}

if (NumberOfEnabledProcessors != LocalContext->NumberOfProcessors) {
DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors = 0x%x\n", __FUNCTION__, NumberOfEnabledProcessors));
DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors = 0x%x\n", __func__, NumberOfEnabledProcessors));

for (ProcessorNumber = 0; ProcessorNumber < LocalContext->NumberOfProcessors; ProcessorNumber++) {
Status = MpServicesUnitTestGetProcessorInfo (
Expand All @@ -163,7 +163,7 @@ CheckUTContext (
ASSERT_EFI_ERROR (Status);

if (!(ProcessorInfoBuffer.StatusFlag & PROCESSOR_ENABLED_BIT)) {
DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and reenable it.\n", __FUNCTION__, ProcessorNumber));
DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and reenable it.\n", __func__, ProcessorNumber));
Status = MpServicesUnitTestEnableDisableAP (
LocalContext->MpServices,
ProcessorNumber,
Expand Down Expand Up @@ -204,7 +204,7 @@ FreeUTContext (
DEBUG ((
DEBUG_INFO,
"%a: Disable AP(0x%x) to restore its state.\n",
__FUNCTION__,
__func__,
LocalContext->DisabledApNumber[IndexOfDisabledAPs]
));

Expand Down
2 changes: 1 addition & 1 deletion UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ S3ResumeBootOs (
DEBUG ((
DEBUG_INFO,
"%a() Stack Base: 0x%x, Stack Size: 0x%x\n",
__FUNCTION__,
__func__,
TempStackTop,
sizeof (TempStack)
));
Expand Down

0 comments on commit 089013a

Please sign in to comment.