]> xenbits.xensource.com Git - ovmf.git/commitdiff
UefiCpuPkg: Update code to be more C11 compliant by using __func__
authorRebecca Cran <rebecca@bsdio.com>
Thu, 6 Apr 2023 19:49:10 +0000 (13:49 -0600)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 10 Apr 2023 14:19:57 +0000 (14:19 +0000)
__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 <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
13 files changed:
UefiCpuPkg/CpuDxe/CpuDxe.c
UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c
UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.c
UefiCpuPkg/Library/CpuExceptionHandlerLib/UnitTest/CpuExceptionHandlerTestCommon.c
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
UefiCpuPkg/Library/MpInitLib/Microcode.c
UefiCpuPkg/Library/MpInitLib/MpLib.c
UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
UefiCpuPkg/SecCore/SecMain.c
UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.c
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c

index 3febd59d99e0db61a31508d115b4c05f4371f3aa..804ef5d1fe8ef0bb9df45668c61986ce96054b6a 100644 (file)
@@ -1078,7 +1078,7 @@ IntersectMemoryDescriptor (
       EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,\r
       "%a: %a: add [%Lx, %Lx): %r\n",\r
       gEfiCallerBaseName,\r
-      __FUNCTION__,\r
+      __func__,\r
       IntersectionBase,\r
       IntersectionEnd,\r
       Status\r
@@ -1091,7 +1091,7 @@ IntersectMemoryDescriptor (
     "%a: %a: desc [%Lx, %Lx) type %u cap %Lx conflicts "\r
     "with aperture [%Lx, %Lx) cap %Lx\n",\r
     gEfiCallerBaseName,\r
-    __FUNCTION__,\r
+    __func__,\r
     Descriptor->BaseAddress,\r
     Descriptor->BaseAddress + Descriptor->Length,\r
     (UINT32)Descriptor->GcdMemoryType,\r
@@ -1132,7 +1132,7 @@ AddMemoryMappedIoSpace (
       DEBUG_ERROR,\r
       "%a: %a: GetMemorySpaceMap(): %r\n",\r
       gEfiCallerBaseName,\r
-      __FUNCTION__,\r
+      __func__,\r
       Status\r
       ));\r
     return Status;\r
@@ -1215,7 +1215,7 @@ AddLocalApicMemorySpace (
       DEBUG_INFO,\r
       "%a: %a: AllocateMemorySpace() Status - %r\n",\r
       gEfiCallerBaseName,\r
-      __FUNCTION__,\r
+      __func__,\r
       Status\r
       ));\r
   }\r
index 7551e0653603741838c7693b8d998f85ce861c27..25fe3f54c325b5e9a802840a3e757b34ec1a1e01 100644 (file)
@@ -296,7 +296,7 @@ CpuSetMemoryAttributes (
   IN UINT64                 Attributes\r
   )\r
 {\r
-  DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __func__));\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -328,10 +328,10 @@ InitializeCpu (
     return EFI_NOT_FOUND;\r
   }\r
 \r
-  DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __FUNCTION__, FirmwareContext));\r
+  DEBUG ((DEBUG_INFO, " %a: Firmware Context is at 0x%x.\n", __func__, FirmwareContext));\r
 \r
   mBootHartId = FirmwareContext->BootHartId;\r
-  DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __FUNCTION__, mBootHartId));\r
+  DEBUG ((DEBUG_INFO, " %a: mBootHartId = 0x%x.\n", __func__, mBootHartId));\r
 \r
   InitializeCpuExceptionHandlers (NULL);\r
 \r
index 59a5d932eee203b255cb627c75845033274e004c..86ce5303cab40f3af42cd5f676ac1a0051b63719 100644 (file)
@@ -127,7 +127,7 @@ CpuS3DataOnEndOfDxe (
                                                     );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  DEBUG ((DEBUG_VERBOSE, "%a\n", __FUNCTION__));\r
+  DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));\r
   MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);\r
 \r
   //\r
index bce089feb0da121fb8af88d6587584f980e20a16..73a9dd57658c51e7cfc24eeff51dce8bd3cb0d24 100644 (file)
@@ -230,7 +230,7 @@ RegisterCpuInterruptHandler (
   IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler\r
   )\r
 {\r
-  DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __FUNCTION__, ExceptionType, InterruptHandler));\r
+  DEBUG ((DEBUG_INFO, "%a: Type:%x Handler: %x\n", __func__, ExceptionType, InterruptHandler));\r
   if (EXCEPT_RISCV_IS_IRQ (ExceptionType)) {\r
     if (EXCEPT_RISCV_IRQ_INDEX (ExceptionType) > EXCEPT_RISCV_MAX_IRQS) {\r
       return EFI_UNSUPPORTED;\r
index 17afb592d3c89a9fb2dc7646bd4a7f7cd1dc7e09..9ba70c5b73403efb85623b9ee915382f3543b9ae 100644 (file)
@@ -292,7 +292,7 @@ GetBspStackBase (
       DEBUG ((\r
         DEBUG_INFO,\r
         "%a: Bsp StackBase = 0x%016lx  StackSize = 0x%016lx\n",\r
-        __FUNCTION__,\r
+        __func__,\r
         MemoryHob->AllocDescriptor.MemoryBaseAddress,\r
         MemoryHob->AllocDescriptor.MemoryLength\r
         ));\r
index 330676b700d1cfd9c6dd0efe1a8b81283a06eb32..57ddb86600a74349d6315f25534d0511eaf2e8b7 100644 (file)
@@ -463,7 +463,7 @@ MpInitChangeApLoopCallback (
       );\r
   }\r
 \r
-  DEBUG ((DEBUG_INFO, "%a() done!\n", __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a() done!\n", __func__));\r
 }\r
 \r
 /**\r
index f9f070fa8bf230e72b7643b5bd8f96212512905b..11720560afee7ccd28b37d4bc0955c27211aff4d 100644 (file)
@@ -170,7 +170,7 @@ ShadowMicrocodePatchWorker (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a: Required microcode patches have been loaded at 0x%lx, with size 0x%lx.\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     CpuMpData->MicrocodePatchAddress,\r
     CpuMpData->MicrocodePatchRegionSize\r
     ));\r
@@ -305,7 +305,7 @@ ShadowMicrocodePatchByPcd (
     DEBUG ((\r
       DEBUG_INFO,\r
       "%a: 0x%x microcode patches will be loaded into memory, with size 0x%x.\n",\r
-      __FUNCTION__,\r
+      __func__,\r
       PatchCount,\r
       TotalLoadSize\r
       ));\r
@@ -365,7 +365,7 @@ GetMicrocodePatchInfoFromHob (
 \r
   GuidHob = GetFirstGuidHob (&gEdkiiMicrocodePatchHobGuid);\r
   if (GuidHob == NULL) {\r
-    DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n", __FUNCTION__));\r
+    DEBUG ((DEBUG_INFO, "%a: Microcode patch cache HOB is not found.\n", __func__));\r
     return FALSE;\r
   }\r
 \r
@@ -377,7 +377,7 @@ GetMicrocodePatchInfoFromHob (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a: MicrocodeBase = 0x%lx, MicrocodeSize = 0x%lx\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     *Address,\r
     *RegionSize\r
     ));\r
index e5dc852ed95fd23a6fbd6f437cbc1e062e42e969..f1f2840714414c720715a2abfb880e4be4eeb8a0 100644 (file)
@@ -1537,7 +1537,7 @@ TimedWaitForApFinish (
     DEBUG ((\r
       DEBUG_VERBOSE,\r
       "%a: reached FinishedApLimit=%u in %Lu microseconds\n",\r
-      __FUNCTION__,\r
+      __func__,\r
       FinishedApLimit,\r
       DivU64x64Remainder (\r
         MultU64x32 (CpuMpData->TotalTime, 1000000),\r
index e732371ddd2195de7e0eedd6967cadff778adc8f..013f89b197d036c3435e0dcd454c3ab048519fab 100644 (file)
@@ -758,7 +758,7 @@ PlatformShadowMicrocode (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a: Required microcode patches have been loaded at 0x%lx, with size 0x%lx.\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     CpuMpData->MicrocodePatchAddress,\r
     CpuMpData->MicrocodePatchRegionSize\r
     ));\r
index 240eee6a7d2f5fe57b3c94065db5a02fb89ca590..0f7ee0372dbd01c9ddbaa826e4110b043f3b9f98 100644 (file)
@@ -932,7 +932,7 @@ InitSmmS3ResumeState (
     DEBUG ((\r
       DEBUG_ERROR,\r
       "ERROR:%a(): HOB(gEfiAcpiVariableGuid=%g) needed by S3 resume doesn't exist!\n",\r
-      __FUNCTION__,\r
+      __func__,\r
       &gEfiAcpiVariableGuid\r
       ));\r
     CpuDeadLoop ();\r
index fe03d8019a40dc93de8e7c4a5dbd52b9c76c3053..95375850ec7661375028cb76a500d0cc06865593 100644 (file)
@@ -170,7 +170,7 @@ SecStartup (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a() TempRAM Base: 0x%x, TempRAM Size: 0x%x, BootFirmwareVolume 0x%x\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     TempRamBase,\r
     SizeOfRam,\r
     BootFirmwareVolume\r
@@ -242,7 +242,7 @@ SecStartup (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%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",\r
-    __FUNCTION__,\r
+    __func__,\r
     SecCoreData.BootFirmwareVolumeBase,\r
     SecCoreData.BootFirmwareVolumeSize,\r
     SecCoreData.TemporaryRamBase,\r
@@ -345,7 +345,7 @@ SecStartupPhase2 (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a() PeiCoreEntryPoint: 0x%x\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     PeiCoreEntryPoint\r
     ));\r
 \r
@@ -394,7 +394,7 @@ SecStartupPhase2 (
     DEBUG ((\r
       DEBUG_INFO,\r
       "%a() PeiTemporaryRamBase: 0x%x, PeiTemporaryRamSize: 0x%x\n",\r
-      __FUNCTION__,\r
+      __func__,\r
       SecCoreData->PeiTemporaryRamBase,\r
       SecCoreData->PeiTemporaryRamSize\r
       ));\r
@@ -408,7 +408,7 @@ SecStartupPhase2 (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a() Stack Base: 0x%p, Stack Size: 0x%x\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     SecCoreData->StackBase,\r
     (UINT32)SecCoreData->StackSize\r
     ));\r
index ff79c5e8d43b32b11108cd9b840329e3d2d6cf07..7cd3f48d761f25eb62785f9740168160347e0be8 100644 (file)
@@ -45,7 +45,7 @@ InitUTContext (
 \r
   Status = MpServicesUnitTestWhoAmI (LocalContext->MpServices, &BspNumber);\r
   UT_ASSERT_NOT_EFI_ERROR (Status);\r
-  DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __FUNCTION__, BspNumber));\r
+  DEBUG ((DEBUG_INFO, "%a: BspNumber = 0x%x\n", __func__, BspNumber));\r
 \r
   Status = MpServicesUnitTestGetNumberOfProcessors (\r
              LocalContext->MpServices,\r
@@ -56,7 +56,7 @@ InitUTContext (
   DEBUG ((\r
     DEBUG_INFO,\r
     "%a: NumberOfProcessors = 0x%x, NumberOfEnabledProcessors = 0x%x\n",\r
-    __FUNCTION__,\r
+    __func__,\r
     NumberOfProcessors,\r
     NumberOfEnabledProcessors\r
     ));\r
@@ -89,7 +89,7 @@ InitUTContext (
         LocalContext->DisabledApNumber[IndexOfDisabledAPs] = ProcessorNumber;\r
         IndexOfDisabledAPs++;\r
 \r
-        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily enable it.\n", __FUNCTION__, ProcessorNumber));\r
+        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled and temporarily enable it.\n", __func__, ProcessorNumber));\r
         Status = MpServicesUnitTestEnableDisableAP (\r
                    LocalContext->MpServices,\r
                    ProcessorNumber,\r
@@ -134,7 +134,7 @@ CheckUTContext (
 \r
   if (BspNumber != LocalContext->BspNumber) {\r
     LocalContext->BspNumber = BspNumber;\r
-    DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __FUNCTION__, BspNumber));\r
+    DEBUG ((DEBUG_INFO, "%a: New BspNumber = 0x%x\n", __func__, BspNumber));\r
   }\r
 \r
   ASSERT (BspNumber == LocalContext->BspNumber);\r
@@ -148,11 +148,11 @@ CheckUTContext (
 \r
   if (NumberOfProcessors != LocalContext->NumberOfProcessors) {\r
     LocalContext->NumberOfProcessors = NumberOfProcessors;\r
-    DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n", __FUNCTION__, NumberOfProcessors));\r
+    DEBUG ((DEBUG_INFO, "%a: New NumberOfProcessors = 0x%x\n", __func__, NumberOfProcessors));\r
   }\r
 \r
   if (NumberOfEnabledProcessors != LocalContext->NumberOfProcessors) {\r
-    DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors = 0x%x\n", __FUNCTION__, NumberOfEnabledProcessors));\r
+    DEBUG ((DEBUG_INFO, "%a: New NumberOfEnabledProcessors = 0x%x\n", __func__, NumberOfEnabledProcessors));\r
 \r
     for (ProcessorNumber = 0; ProcessorNumber < LocalContext->NumberOfProcessors; ProcessorNumber++) {\r
       Status = MpServicesUnitTestGetProcessorInfo (\r
@@ -163,7 +163,7 @@ CheckUTContext (
       ASSERT_EFI_ERROR (Status);\r
 \r
       if (!(ProcessorInfoBuffer.StatusFlag & PROCESSOR_ENABLED_BIT)) {\r
-        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and reenable it.\n", __FUNCTION__, ProcessorNumber));\r
+        DEBUG ((DEBUG_INFO, "%a: AP(0x%x) is disabled unexpectedly and reenable it.\n", __func__, ProcessorNumber));\r
         Status = MpServicesUnitTestEnableDisableAP (\r
                    LocalContext->MpServices,\r
                    ProcessorNumber,\r
@@ -204,7 +204,7 @@ FreeUTContext (
       DEBUG ((\r
         DEBUG_INFO,\r
         "%a: Disable AP(0x%x) to restore its state.\n",\r
-        __FUNCTION__,\r
+        __func__,\r
         LocalContext->DisabledApNumber[IndexOfDisabledAPs]\r
         ));\r
 \r
index e82f179569e9a0ef285cf2d2330bd6715de14f11..9ea5f6f4e5e5f3367e45132356a4c8374381dd30 100644 (file)
@@ -509,7 +509,7 @@ S3ResumeBootOs (
     DEBUG ((\r
       DEBUG_INFO,\r
       "%a() Stack Base: 0x%x, Stack Size: 0x%x\n",\r
-      __FUNCTION__,\r
+      __func__,\r
       TempStackTop,\r
       sizeof (TempStack)\r
       ));\r