]> xenbits.xensource.com Git - ovmf.git/commitdiff
PrmPkg: Update code to be more C11 compliant by using __func__
authorRebecca Cran <rebecca@bsdio.com>
Thu, 6 Apr 2023 19:52:17 +0000 (13:52 -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
PrmPkg.

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>
PrmPkg/Application/PrmInfo/PrmInfo.c
PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
PrmPkg/PrmConfigDxe/PrmConfigDxe.c
PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c

index 0cde2fad3b4b340286125f3e1117d4dcb964c13c..d7ce0d03be60316f0b140c7a7550d43b48ada55d 100644 (file)
@@ -493,7 +493,7 @@ ExecutePrmHandlerByGuid (
         DEBUG_ERROR,\r
         "%a - %a: An error occurred creating a context buffer for handler %g\n",\r
         gEfiCallerBaseName,\r
-        __FUNCTION__,\r
+        __func__,\r
         HandlerContext->Guid\r
         ));\r
     }\r
@@ -628,7 +628,7 @@ ParseParameterList (
       DEBUG_ERROR,\r
       "%a - %a: An error occurred during PRM module discovery (%r)\n",\r
       gEfiCallerBaseName,\r
-      __FUNCTION__,\r
+      __func__,\r
       Status\r
       ));\r
     ReturnStatus = Status;\r
@@ -719,7 +719,7 @@ UefiMain (
       DEBUG_ERROR,\r
       "%a - %a: An error occurred parsing user-provided arguments (%r)\n",\r
       gEfiCallerBaseName,\r
-      __FUNCTION__,\r
+      __func__,\r
       Status\r
       ));\r
   }\r
index 3036aa503ec858a8c7d1ab9f4deaa347badd2622..a6ad141556a47552a335060ba582ea2050198b13 100644 (file)
@@ -40,7 +40,7 @@ FindContextBufferInModuleBuffers (
 {\r
   UINTN  Index;\r
 \r
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if ((HandlerGuid == NULL) || (ModuleContextBuffers == NULL) || (ContextBuffer == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -89,7 +89,7 @@ GetModuleContextBuffers (
   PRM_CONFIG_PROTOCOL       *PrmConfigProtocol;\r
   CONST PRM_CONTEXT_BUFFER  *PrmContextBuffer;\r
 \r
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if ((Guid == NULL) || (PrmModuleContextBuffers == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -122,7 +122,7 @@ GetModuleContextBuffers (
             DEBUG_INFO,\r
             "      %a %a: Found a PRM configuration protocol for PRM module %g.\n",\r
             _DBGMSGID_,\r
-            __FUNCTION__,\r
+            __func__,\r
             Guid\r
             ));\r
 \r
@@ -143,7 +143,7 @@ GetModuleContextBuffers (
     DEBUG_INFO,\r
     "      %a %a: Could not locate a PRM configuration protocol for PRM handler %g.\n",\r
     _DBGMSGID_,\r
-    __FUNCTION__,\r
+    __func__,\r
     Guid\r
     ));\r
 \r
@@ -176,7 +176,7 @@ GetContextBuffer (
   EFI_STATUS                        Status;\r
   CONST PRM_MODULE_CONTEXT_BUFFERS  *ContextBuffers;\r
 \r
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if ((PrmHandlerGuid == NULL) || (PrmContextBuffer == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
index fdc32993b82d2bc22b5745d17353e77365e2a433..212c4cf6aaba35c03c9e3cb33ea63e13213e8647 100644 (file)
@@ -384,7 +384,7 @@ VerifyGetModuleContextBuffers (
     UT_ASSERT_TRUE (CompareGuid (TestContext->ExpectedModuleGuid, &ContextBuffers->ModuleGuid));\r
     UT_LOG_INFO (\r
       "%a: Searching by %a GUID ({%g}) returned ContextBuffers at 0x%x\n",\r
-      __FUNCTION__,\r
+      __func__,\r
       ((TestContext->GuidSearchType == ByModuleGuid) ? "module" : "handler"),\r
       TestContext->Guid,\r
       (UINTN)ContextBuffers\r
index e6bea47bc5831f483648e13c031d665f47a7ce48..efd9f231baa0254756696ec7ed13adb9c2e7e10a 100644 (file)
@@ -48,7 +48,7 @@ GetNextPrmModuleEntry (
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY  *CurrentListEntry;\r
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY  *ForwardListEntry;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if (ModuleImageContext == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -94,7 +94,7 @@ CreateNewPrmModuleImageContextListEntry (
 {\r
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY  *PrmModuleImageContextListEntry;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   PrmModuleImageContextListEntry = AllocateZeroPool (sizeof (*PrmModuleImageContextListEntry));\r
   if (PrmModuleImageContextListEntry == NULL) {\r
@@ -105,7 +105,7 @@ CreateNewPrmModuleImageContextListEntry (
     DEBUG_INFO,\r
     "  %a %a: Allocated PrmModuleImageContextListEntry at 0x%x of size 0x%x bytes.\n",\r
     _DBGMSGID_,\r
-    __FUNCTION__,\r
+    __func__,\r
     (UINTN)PrmModuleImageContextListEntry,\r
     sizeof (*PrmModuleImageContextListEntry)\r
     ));\r
@@ -186,7 +186,7 @@ DiscoverPrmModules (
   EFI_MMRAM_DESCRIPTOR                 *MmramRanges;\r
   UINTN                                MmramRangeCount;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   PrmHandlerCount = 0;\r
   PrmModuleCount  = 0;\r
@@ -203,7 +203,7 @@ DiscoverPrmModules (
                   &HandleBuffer\r
                   );\r
   if (EFI_ERROR (Status) && (HandleCount == 0)) {\r
-    DEBUG ((DEBUG_ERROR, "%a %a: No LoadedImageProtocol instances found!\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "%a %a: No LoadedImageProtocol instances found!\n", _DBGMSGID_, __func__));\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -255,7 +255,7 @@ DiscoverPrmModules (
         DEBUG_WARN,\r
         "%a %a: ImageHandle 0x%016lx is not a valid PE/COFF image. It cannot be considered a PRM module.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__,\r
+        __func__,\r
         (EFI_PHYSICAL_ADDRESS)(UINTN)LoadedImageProtocol->ImageBase\r
         ));\r
       continue;\r
@@ -304,7 +304,7 @@ DiscoverPrmModules (
     InsertTailList (&mPrmModuleList, &PrmModuleImageContextListEntry->Link);\r
     PrmHandlerCount += TempPrmModuleImageContext.ExportDescriptor->Header.NumberPrmHandlers;\r
     PrmModuleCount++;\r
-    DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __func__));\r
   }\r
 \r
   if (HandlerCount != NULL) {\r
index d535c2c10596f7313abbf1fc8acc48bacb0555da..15792777b74b486c35a355a3d92a209ea83cc65e 100644 (file)
@@ -51,7 +51,7 @@ GetPrmModuleExportDescriptorTable (
   UINT32                               *ExportAddressTable;\r
   PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT  *TempExportDescriptor;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if ((ImageExportDirectory == NULL) ||\r
       (PeCoffLoaderImageContext == NULL) ||\r
@@ -67,7 +67,7 @@ GetPrmModuleExportDescriptorTable (
     DEBUG_INFO,\r
     "  %a %a: %d exported names found in this image.\n",\r
     _DBGMSGID_,\r
-    __FUNCTION__,\r
+    __func__,\r
     ImageExportDirectory->NumberOfNames\r
     ));\r
 \r
@@ -85,7 +85,7 @@ GetPrmModuleExportDescriptorTable (
       DEBUG_INFO,\r
       "  %a %a: Export Name[0x%x] - %a.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       Index,\r
       CurrentExportName\r
       ));\r
@@ -101,29 +101,29 @@ GetPrmModuleExportDescriptorTable (
         DEBUG_INFO,\r
         "  %a %a: PRM Module Export Descriptor found. Ordinal = %d.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__,\r
+        __func__,\r
         PrmModuleExportDescriptorOrdinal\r
         ));\r
       if (PrmModuleExportDescriptorOrdinal >= ImageExportDirectory->NumberOfFunctions) {\r
-        DEBUG ((DEBUG_ERROR, "%a %a: The PRM Module Export Descriptor ordinal value is invalid.\n", _DBGMSGID_, __FUNCTION__));\r
+        DEBUG ((DEBUG_ERROR, "%a %a: The PRM Module Export Descriptor ordinal value is invalid.\n", _DBGMSGID_, __func__));\r
         return EFI_NOT_FOUND;\r
       }\r
 \r
       TempExportDescriptor = (PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *)((UINTN)CurrentImageAddress + ExportAddressTable[PrmModuleExportDescriptorOrdinal]);\r
       if (TempExportDescriptor->Header.Signature == PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE) {\r
         *ExportDescriptor = TempExportDescriptor;\r
-        DEBUG ((DEBUG_INFO, "  %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN)ExportDescriptor));\r
+        DEBUG ((DEBUG_INFO, "  %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __func__, (UINTN)ExportDescriptor));\r
       } else {\r
         DEBUG ((\r
           DEBUG_INFO,\r
           "  %a %a: PRM Module Export Descriptor found at 0x%x but signature check failed.\n",\r
           _DBGMSGID_,\r
-          __FUNCTION__,\r
+          __func__,\r
           (UINTN)TempExportDescriptor\r
           ));\r
       }\r
 \r
-      DEBUG ((DEBUG_INFO, "  %a %a: Exiting export iteration since export descriptor found.\n", _DBGMSGID_, __FUNCTION__));\r
+      DEBUG ((DEBUG_INFO, "  %a %a: Exiting export iteration since export descriptor found.\n", _DBGMSGID_, __func__));\r
       return EFI_SUCCESS;\r
     }\r
   }\r
@@ -194,7 +194,7 @@ GetExportDirectoryInPeCoffImage (
         DEBUG_WARN,\r
         "%a %a: The machine type for this image is not valid for a PRM module.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__\r
+        __func__\r
         ));\r
       return EFI_UNSUPPORTED;\r
   }\r
@@ -208,7 +208,7 @@ GetExportDirectoryInPeCoffImage (
   // Check the PE/COFF Header Signature. Determine if the image is valid and/or a TE image.\r
   //\r
   if (OptionalHeaderPtrUnion.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {\r
-    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __func__));\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -237,18 +237,18 @@ GetExportDirectoryInPeCoffImage (
     //\r
     // The directory address overflows\r
     //\r
-    DEBUG ((DEBUG_ERROR, "%a %a: The export directory entry in this image results in overflow.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "%a %a: The export directory entry in this image results in overflow.\n", _DBGMSGID_, __func__));\r
     return EFI_UNSUPPORTED;\r
   } else {\r
-    DEBUG ((DEBUG_INFO, "%a %a: Export Directory Entry found in the image at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN)OptionalHeaderPtrUnion.Pe32));\r
-    DEBUG ((DEBUG_INFO, "  %a %a: Directory Entry Virtual Address = 0x%x.\n", _DBGMSGID_, __FUNCTION__, DirectoryEntry->VirtualAddress));\r
+    DEBUG ((DEBUG_INFO, "%a %a: Export Directory Entry found in the image at 0x%x.\n", _DBGMSGID_, __func__, (UINTN)OptionalHeaderPtrUnion.Pe32));\r
+    DEBUG ((DEBUG_INFO, "  %a %a: Directory Entry Virtual Address = 0x%x.\n", _DBGMSGID_, __func__, DirectoryEntry->VirtualAddress));\r
 \r
     ExportDirectory = (EFI_IMAGE_EXPORT_DIRECTORY *)((UINTN)Image + DirectoryEntry->VirtualAddress);\r
     DEBUG ((\r
       DEBUG_INFO,\r
       "  %a %a: Export Directory Table found successfully at 0x%x. Name address = 0x%x. Name = %a.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       (UINTN)ExportDirectory,\r
       ((UINTN)Image + ExportDirectory->Name),\r
       (CHAR8 *)((UINTN)Image + ExportDirectory->Name)\r
@@ -287,7 +287,7 @@ GetImageVersionInPeCoffImage (
   EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  OptionalHeaderPtrUnion;\r
   UINT16                               Magic;\r
 \r
-  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "    %a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if ((Image == NULL) || (PeCoffLoaderImageContext == NULL) || (ImageMajorVersion == NULL) || (ImageMinorVersion == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -320,7 +320,7 @@ GetImageVersionInPeCoffImage (
         DEBUG_WARN,\r
         "%a %a: The machine type for this image is not valid for a PRM module.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__\r
+        __func__\r
         ));\r
       return EFI_UNSUPPORTED;\r
   }\r
@@ -333,7 +333,7 @@ GetImageVersionInPeCoffImage (
   // Check the PE/COFF Header Signature. Determine if the image is valid and/or a TE image.\r
   //\r
   if (OptionalHeaderPtrUnion.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {\r
-    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __func__));\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -351,8 +351,8 @@ GetImageVersionInPeCoffImage (
     *ImageMinorVersion = OptionalHeaderPtrUnion.Pe32Plus->OptionalHeader.MinorImageVersion;\r
   }\r
 \r
-  DEBUG ((DEBUG_INFO, "      %a %a - Image Major Version: 0x%02x.\n", _DBGMSGID_, __FUNCTION__, *ImageMajorVersion));\r
-  DEBUG ((DEBUG_INFO, "      %a %a - Image Minor Version: 0x%02x.\n", _DBGMSGID_, __FUNCTION__, *ImageMinorVersion));\r
+  DEBUG ((DEBUG_INFO, "      %a %a - Image Major Version: 0x%02x.\n", _DBGMSGID_, __func__, *ImageMajorVersion));\r
+  DEBUG ((DEBUG_INFO, "      %a %a - Image Minor Version: 0x%02x.\n", _DBGMSGID_, __func__, *ImageMinorVersion));\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -404,7 +404,7 @@ GetExportEntryAddress (
 \r
       ASSERT (CurrentExportOrdinal < ImageExportDirectory->NumberOfFunctions);\r
       if (CurrentExportOrdinal >= ImageExportDirectory->NumberOfFunctions) {\r
-        DEBUG ((DEBUG_ERROR, "  %a %a: The export ordinal value is invalid.\n", _DBGMSGID_, __FUNCTION__));\r
+        DEBUG ((DEBUG_ERROR, "  %a %a: The export ordinal value is invalid.\n", _DBGMSGID_, __func__));\r
         break;\r
       }\r
 \r
index c175ee2183cec7bb86df67b4f78ed7a5a9d767d5..550ee64b4c53e2d528b22092a6517c61b7887d01 100644 (file)
@@ -71,7 +71,7 @@ SetRuntimeMemoryRangeAttributes (
   UINTN                            Index;\r
   EFI_GCD_MEMORY_SPACE_DESCRIPTOR  Descriptor;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if ((RuntimeMmioRanges == NULL) || (RuntimeMmioRanges->Count == 0)) {\r
     return;\r
@@ -82,14 +82,14 @@ SetRuntimeMemoryRangeAttributes (
       DEBUG_INFO,\r
       "      %a %a: Runtime MMIO Range [%d].\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       Index\r
       ));\r
     DEBUG ((\r
       DEBUG_INFO,\r
       "      %a %a: Physical address = 0x%016x. Length = 0x%x.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       RuntimeMmioRanges->Range[Index].PhysicalBaseAddress,\r
       RuntimeMmioRanges->Range[Index].Length\r
       ));\r
@@ -141,7 +141,7 @@ SetRuntimeMemoryRangeAttributes (
         DEBUG_ERROR,\r
         "      %a %a: Error [%r] finding descriptor for runtime memory range 0x%016x.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__,\r
+        __func__,\r
         Status,\r
         RuntimeMmioRanges->Range[Index].PhysicalBaseAddress\r
         ));\r
@@ -163,12 +163,12 @@ SetRuntimeMemoryRangeAttributes (
         DEBUG_ERROR,\r
         "      %a %a: Error [%r] setting descriptor for runtime memory range 0x%016x.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__,\r
+        __func__,\r
         Status,\r
         RuntimeMmioRanges->Range[Index].PhysicalBaseAddress\r
         ));\r
     } else {\r
-      DEBUG ((DEBUG_INFO, "      %a %a: Successfully set runtime attribute for the MMIO range.\n", _DBGMSGID_, __FUNCTION__));\r
+      DEBUG ((DEBUG_INFO, "      %a %a: Successfully set runtime attribute for the MMIO range.\n", _DBGMSGID_, __func__));\r
     }\r
   }\r
 }\r
@@ -189,7 +189,7 @@ StoreVirtualMemoryAddressChangePointers (
   EFI_HANDLE           *HandleBuffer;\r
   PRM_CONFIG_PROTOCOL  *PrmConfigProtocol;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   RangeIndex = 0;\r
 \r
@@ -199,7 +199,7 @@ StoreVirtualMemoryAddressChangePointers (
       DEBUG_ERROR,\r
       "  %a %a: Memory allocation for runtime MMIO pointer array failed.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__\r
+      __func__\r
       ));\r
     ASSERT (FALSE);\r
     return;\r
@@ -232,7 +232,7 @@ StoreVirtualMemoryAddressChangePointers (
             DEBUG_ERROR,\r
             "  %a %a: Index out of bounds - Actual count (%d) of runtime MMIO ranges exceeds maximum count (%d).\n",\r
             _DBGMSGID_,\r
-            __FUNCTION__,\r
+            __func__,\r
             RangeIndex + 1,\r
             mMaxRuntimeMmioRangeCount\r
             ));\r
@@ -248,7 +248,7 @@ StoreVirtualMemoryAddressChangePointers (
       DEBUG_INFO,\r
       "  %a %a: %d MMIO ranges buffers saved for future virtual memory conversion.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       RangeIndex\r
       ));\r
   }\r
@@ -277,12 +277,12 @@ ValidatePrmDataBuffer (
   }\r
 \r
   if (PrmDataBuffer->Header.Signature != PRM_DATA_BUFFER_HEADER_SIGNATURE) {\r
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer signature is invalid. PRM module.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer signature is invalid. PRM module.\n", _DBGMSGID_, __func__));\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
   if (PrmDataBuffer->Header.Length < sizeof (PRM_DATA_BUFFER_HEADER)) {\r
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer length is invalid.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM data buffer length is invalid.\n", _DBGMSGID_, __func__));\r
     return EFI_BUFFER_TOO_SMALL;\r
   }\r
 \r
@@ -311,12 +311,12 @@ ValidatePrmContextBuffer (
   }\r
 \r
   if (PrmContextBuffer->Signature != PRM_CONTEXT_BUFFER_SIGNATURE) {\r
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer signature is invalid.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer signature is invalid.\n", _DBGMSGID_, __func__));\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
   if (IsZeroGuid (&PrmContextBuffer->HandlerGuid)) {\r
-    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer GUID is zero.\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_ERROR, "  %a %a: The PRM context buffer GUID is zero.\n", _DBGMSGID_, __func__));\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -325,7 +325,7 @@ ValidatePrmContextBuffer (
       DEBUG_ERROR,\r
       "    %a %a: Error in static buffer for PRM handler %g.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       &PrmContextBuffer->HandlerGuid\r
       ));\r
     return EFI_NOT_FOUND;\r
@@ -387,7 +387,7 @@ PrmConfigEndOfDxeNotification (
   PRM_CONTEXT_BUFFER   *CurrentContextBuffer;\r
   PRM_CONFIG_PROTOCOL  *PrmConfigProtocol;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   HandleBuffer = NULL;\r
   Status       = gBS->LocateHandleBuffer (\r
@@ -413,11 +413,11 @@ PrmConfigEndOfDxeNotification (
         DEBUG_INFO,\r
         "  %a %a: Found PRM configuration protocol for PRM module %g.\n",\r
         _DBGMSGID_,\r
-        __FUNCTION__,\r
+        __func__,\r
         &PrmConfigProtocol->ModuleContextBuffers.ModuleGuid\r
         ));\r
 \r
-      DEBUG ((DEBUG_INFO, "      %a %a: Validating module context buffers...\n", _DBGMSGID_, __FUNCTION__));\r
+      DEBUG ((DEBUG_INFO, "      %a %a: Validating module context buffers...\n", _DBGMSGID_, __func__));\r
       for (BufferIndex = 0; BufferIndex < PrmConfigProtocol->ModuleContextBuffers.BufferCount; BufferIndex++) {\r
         CurrentContextBuffer = &(PrmConfigProtocol->ModuleContextBuffers.Buffer[BufferIndex]);\r
 \r
@@ -427,20 +427,20 @@ PrmConfigEndOfDxeNotification (
             DEBUG_ERROR,\r
             "        %a %a: Context buffer validation failed for PRM handler %g.\n",\r
             _DBGMSGID_,\r
-            __FUNCTION__,\r
+            __func__,\r
             CurrentContextBuffer->HandlerGuid\r
             ));\r
         }\r
       }\r
 \r
-      DEBUG ((DEBUG_INFO, "      %a %a: Module context buffer validation complete.\n", _DBGMSGID_, __FUNCTION__));\r
+      DEBUG ((DEBUG_INFO, "      %a %a: Module context buffer validation complete.\n", _DBGMSGID_, __func__));\r
 \r
       if (PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges != NULL) {\r
         DEBUG ((\r
           DEBUG_INFO,\r
           "    %a %a: Found %d PRM runtime MMIO ranges.\n",\r
           _DBGMSGID_,\r
-          __FUNCTION__,\r
+          __func__,\r
           PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges->Count\r
           ));\r
         SetRuntimeMemoryRangeAttributes (PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges);\r
@@ -478,7 +478,7 @@ PrmConfigEntryPoint (
   EFI_STATUS  Status;\r
   EFI_EVENT   Event;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   //\r
   // Register a notification function to change memory attributes at end of DXE\r
index 5a223d783d80b6ac3dabde337b896b9d17114d89..477c24c8b8ff1cefaa4b8b4963f15bb1180d0416 100644 (file)
@@ -73,7 +73,7 @@ ProcessPrmModules (
 \r
   UINT64  HandlerPhysicalAddress;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if (PrmAcpiDescriptionTable == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -89,19 +89,19 @@ ProcessPrmModules (
       DEBUG_ERROR,\r
       "  %a %a: The Platform GUID in the DSC file must be set to a unique non-zero value.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__\r
+      __func__\r
       ));\r
     ASSERT (!CompareGuid (&gEdkiiDscPlatformGuid, &gZeroGuid));\r
   }\r
 \r
-  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __FUNCTION__, mPrmModuleCount));\r
-  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __FUNCTION__, mPrmHandlerCount));\r
+  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __func__, mPrmModuleCount));\r
+  DEBUG ((DEBUG_INFO, "  %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __func__, mPrmHandlerCount));\r
 \r
   PrmAcpiDescriptionTableBufferSize = (UINT32)(OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure) +\r
                                                (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) *  mPrmModuleCount) +\r
                                                (sizeof (PRM_HANDLER_INFORMATION_STRUCT) * mPrmHandlerCount)\r
                                                );\r
-  DEBUG ((DEBUG_INFO, "  %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __FUNCTION__, PrmAcpiDescriptionTableBufferSize));\r
+  DEBUG ((DEBUG_INFO, "  %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __func__, PrmAcpiDescriptionTableBufferSize));\r
 \r
   PrmAcpiTable = AllocateZeroPool ((UINTN)PrmAcpiDescriptionTableBufferSize);\r
   if (PrmAcpiTable == NULL) {\r
@@ -139,7 +139,7 @@ ProcessPrmModules (
       DEBUG_INFO,\r
       "  %a %a: PRM Module - %a with %d handlers.\n",\r
       _DBGMSGID_,\r
-      __FUNCTION__,\r
+      __func__,\r
       (CHAR8 *)((UINTN)CurrentImageAddress + CurrentImageExportDirectory->Name),\r
       CurrentExportDescriptorStruct->Header.NumberPrmHandlers\r
       ));\r
@@ -212,7 +212,7 @@ ProcessPrmModules (
           DEBUG_INFO,\r
           "    %a %a: Found %a handler physical address at 0x%016x.\n",\r
           _DBGMSGID_,\r
-          __FUNCTION__,\r
+          __func__,\r
           CurrentExportDescriptorHandlerName,\r
           CurrentHandlerInfoStruct->PhysicalAddress\r
           ));\r
@@ -279,7 +279,7 @@ PublishPrmAcpiTable (
                                   &TableKey\r
                                   );\r
     if (!EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __FUNCTION__));\r
+      DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __func__));\r
     }\r
   }\r
 \r
@@ -316,7 +316,7 @@ PrmLoaderEndOfDxeNotification (
   EFI_STATUS                  Status;\r
   PRM_ACPI_DESCRIPTION_TABLE  *PrmAcpiDescriptionTable;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   Status = DiscoverPrmModules (&mPrmModuleCount, &mPrmHandlerCount);\r
   ASSERT_EFI_ERROR (Status);\r
@@ -354,7 +354,7 @@ PrmLoaderEntryPoint (
   EFI_STATUS  Status;\r
   EFI_EVENT   EndOfDxeEvent;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   //\r
   // Discover and process installed PRM modules at the End of DXE\r
@@ -369,7 +369,7 @@ PrmLoaderEntryPoint (
                   &EndOfDxeEvent\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "%a %a: EndOfDxe callback registration failed! %r.\n", _DBGMSGID_, __FUNCTION__, Status));\r
+    DEBUG ((DEBUG_ERROR, "%a %a: EndOfDxe callback registration failed! %r.\n", _DBGMSGID_, __func__, Status));\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
index e8bf4cfb8f2d9e2e0dc117ed70ce0ff70182dfa6..80ad7d37587dcb44e7073460adb33de3b7fa34ca 100644 (file)
@@ -42,7 +42,7 @@ InstallPrmSsdt (
   EFI_ACPI_TABLE_PROTOCOL      *AcpiTableProtocol;\r
   EFI_ACPI_DESCRIPTION_HEADER  *Ssdt;\r
 \r
-  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));\r
+  DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));\r
 \r
   if (OemId == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -61,7 +61,7 @@ InstallPrmSsdt (
                 &SsdtSize\r
                 );\r
     ASSERT_EFI_ERROR (Status);\r
-    DEBUG ((DEBUG_INFO, "%a %a: SSDT loaded...\n", _DBGMSGID_, __FUNCTION__));\r
+    DEBUG ((DEBUG_INFO, "%a %a: SSDT loaded...\n", _DBGMSGID_, __func__));\r
 \r
     //\r
     // Update OEM ID in the SSDT\r