From: "Rebecca Cran" <rebecca@bsdio.com>
To: devel@edk2.groups.io, Liming Gao <gaoliming@byosoft.com.cn>,
Michael D Kinney <michael.d.kinney@intel.com>,
Guomin Jiang <guomin.jiang@intel.com>,
Wei6 Xu <wei6.xu@intel.com>, Guo Dong <guo.dong@intel.com>,
Ray Ni <ray.ni@intel.com>, Sean Rhodes <sean@starlabs.systems>,
James Lu <james.lu@intel.com>, Gua Guo <gua.guo@intel.com>,
Andrew Fish <afish@apple.com>, Hao A Wu <hao.a.wu@intel.com>,
Maciej Rabeda <maciej.rabeda@linux.intel.com>,
Siyuan Fu <siyuan.fu@intel.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Jian J Wang <jian.j.wang@intel.com>,
Xiaoyu Lu <xiaoyu1.lu@intel.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Sami Mujawar <sami.mujawar@arm.com>,
Supreeth Venkatesh <supreeth.venkatesh@arm.com>,
Michael Kubacki <mikuback@linux.microsoft.com>,
Nate DeSimone <nathaniel.l.desimone@intel.com>,
Sean Brogan <sean.brogan@microsoft.com>
Cc: Rebecca Cran <rebecca@bsdio.com>,
Leif Lindholm <quic_llindhol@quicinc.com>,
Abner Chang <abner.chang@amd.com>,
Nickle Wang <nicklew@nvidia.com>,
Igor Kulchytskyy <igork@ami.com>,
Daniel Schaefer <git@danielschaefer.me>,
Min Xu <min.m.xu@intel.com>,
Jordan Justen <jordan.l.justen@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Peter Grehan <grehan@freebsd.org>,
Erdem Aktas <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Michael Roth <michael.roth@amd.com>,
Sunil V L <sunilvl@ventanamicro.com>,
Andrei Warkentin <andrei.warkentin@intel.com>
Subject: [PATCH 11/18] PrmPkg: Update code to be more C11 compliant by using __func__
Date: Thu, 6 Apr 2023 16:23:12 -0600 [thread overview]
Message-ID: <20230406222319.2281263-12-rebecca@bsdio.com> (raw)
In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com>
__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.
Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :
#define __func__ __FUNCTION__
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
PrmPkg/Application/PrmInfo/PrmInfo.c | 6 +--
PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c | 10 ++---
PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c | 2 +-
PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c | 14 +++----
PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c | 40 +++++++++---------
PrmPkg/PrmConfigDxe/PrmConfigDxe.c | 44 ++++++++++----------
PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c | 22 +++++-----
PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c | 4 +-
8 files changed, 71 insertions(+), 71 deletions(-)
diff --git a/PrmPkg/Application/PrmInfo/PrmInfo.c b/PrmPkg/Application/PrmInfo/PrmInfo.c
index 0cde2fad3b4b..d7ce0d03be60 100644
--- a/PrmPkg/Application/PrmInfo/PrmInfo.c
+++ b/PrmPkg/Application/PrmInfo/PrmInfo.c
@@ -493,7 +493,7 @@ ExecutePrmHandlerByGuid (
DEBUG_ERROR,
"%a - %a: An error occurred creating a context buffer for handler %g\n",
gEfiCallerBaseName,
- __FUNCTION__,
+ __func__,
HandlerContext->Guid
));
}
@@ -628,7 +628,7 @@ ParseParameterList (
DEBUG_ERROR,
"%a - %a: An error occurred during PRM module discovery (%r)\n",
gEfiCallerBaseName,
- __FUNCTION__,
+ __func__,
Status
));
ReturnStatus = Status;
@@ -719,7 +719,7 @@ UefiMain (
DEBUG_ERROR,
"%a - %a: An error occurred parsing user-provided arguments (%r)\n",
gEfiCallerBaseName,
- __FUNCTION__,
+ __func__,
Status
));
}
diff --git a/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c b/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
index 3036aa503ec8..a6ad141556a4 100644
--- a/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
+++ b/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
@@ -40,7 +40,7 @@ FindContextBufferInModuleBuffers (
{
UINTN Index;
- DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __func__));
if ((HandlerGuid == NULL) || (ModuleContextBuffers == NULL) || (ContextBuffer == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -89,7 +89,7 @@ GetModuleContextBuffers (
PRM_CONFIG_PROTOCOL *PrmConfigProtocol;
CONST PRM_CONTEXT_BUFFER *PrmContextBuffer;
- DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __func__));
if ((Guid == NULL) || (PrmModuleContextBuffers == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -122,7 +122,7 @@ GetModuleContextBuffers (
DEBUG_INFO,
" %a %a: Found a PRM configuration protocol for PRM module %g.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
Guid
));
@@ -143,7 +143,7 @@ GetModuleContextBuffers (
DEBUG_INFO,
" %a %a: Could not locate a PRM configuration protocol for PRM handler %g.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
Guid
));
@@ -176,7 +176,7 @@ GetContextBuffer (
EFI_STATUS Status;
CONST PRM_MODULE_CONTEXT_BUFFERS *ContextBuffers;
- DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __func__));
if ((PrmHandlerGuid == NULL) || (PrmContextBuffer == NULL)) {
return EFI_INVALID_PARAMETER;
diff --git a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
index fdc32993b82d..212c4cf6aaba 100644
--- a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
+++ b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c
@@ -384,7 +384,7 @@ VerifyGetModuleContextBuffers (
UT_ASSERT_TRUE (CompareGuid (TestContext->ExpectedModuleGuid, &ContextBuffers->ModuleGuid));
UT_LOG_INFO (
"%a: Searching by %a GUID ({%g}) returned ContextBuffers at 0x%x\n",
- __FUNCTION__,
+ __func__,
((TestContext->GuidSearchType == ByModuleGuid) ? "module" : "handler"),
TestContext->Guid,
(UINTN)ContextBuffers
diff --git a/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c b/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
index e6bea47bc583..efd9f231baa0 100644
--- a/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
+++ b/PrmPkg/Library/DxePrmModuleDiscoveryLib/DxePrmModuleDiscoveryLib.c
@@ -48,7 +48,7 @@ GetNextPrmModuleEntry (
PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY *CurrentListEntry;
PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY *ForwardListEntry;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
if (ModuleImageContext == NULL) {
return EFI_INVALID_PARAMETER;
@@ -94,7 +94,7 @@ CreateNewPrmModuleImageContextListEntry (
{
PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY *PrmModuleImageContextListEntry;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
PrmModuleImageContextListEntry = AllocateZeroPool (sizeof (*PrmModuleImageContextListEntry));
if (PrmModuleImageContextListEntry == NULL) {
@@ -105,7 +105,7 @@ CreateNewPrmModuleImageContextListEntry (
DEBUG_INFO,
" %a %a: Allocated PrmModuleImageContextListEntry at 0x%x of size 0x%x bytes.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
(UINTN)PrmModuleImageContextListEntry,
sizeof (*PrmModuleImageContextListEntry)
));
@@ -186,7 +186,7 @@ DiscoverPrmModules (
EFI_MMRAM_DESCRIPTOR *MmramRanges;
UINTN MmramRangeCount;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
PrmHandlerCount = 0;
PrmModuleCount = 0;
@@ -203,7 +203,7 @@ DiscoverPrmModules (
&HandleBuffer
);
if (EFI_ERROR (Status) && (HandleCount == 0)) {
- DEBUG ((DEBUG_ERROR, "%a %a: No LoadedImageProtocol instances found!\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a %a: No LoadedImageProtocol instances found!\n", _DBGMSGID_, __func__));
return EFI_NOT_FOUND;
}
@@ -255,7 +255,7 @@ DiscoverPrmModules (
DEBUG_WARN,
"%a %a: ImageHandle 0x%016lx is not a valid PE/COFF image. It cannot be considered a PRM module.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
(EFI_PHYSICAL_ADDRESS)(UINTN)LoadedImageProtocol->ImageBase
));
continue;
@@ -304,7 +304,7 @@ DiscoverPrmModules (
InsertTailList (&mPrmModuleList, &PrmModuleImageContextListEntry->Link);
PrmHandlerCount += TempPrmModuleImageContext.ExportDescriptor->Header.NumberPrmHandlers;
PrmModuleCount++;
- DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a: New PRM Module inserted into list to be processed.\n", _DBGMSGID_, __func__));
}
if (HandlerCount != NULL) {
diff --git a/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c b/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
index d535c2c10596..15792777b74b 100644
--- a/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
+++ b/PrmPkg/Library/DxePrmPeCoffLib/DxePrmPeCoffLib.c
@@ -51,7 +51,7 @@ GetPrmModuleExportDescriptorTable (
UINT32 *ExportAddressTable;
PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *TempExportDescriptor;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
if ((ImageExportDirectory == NULL) ||
(PeCoffLoaderImageContext == NULL) ||
@@ -67,7 +67,7 @@ GetPrmModuleExportDescriptorTable (
DEBUG_INFO,
" %a %a: %d exported names found in this image.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
ImageExportDirectory->NumberOfNames
));
@@ -85,7 +85,7 @@ GetPrmModuleExportDescriptorTable (
DEBUG_INFO,
" %a %a: Export Name[0x%x] - %a.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
Index,
CurrentExportName
));
@@ -101,29 +101,29 @@ GetPrmModuleExportDescriptorTable (
DEBUG_INFO,
" %a %a: PRM Module Export Descriptor found. Ordinal = %d.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
PrmModuleExportDescriptorOrdinal
));
if (PrmModuleExportDescriptorOrdinal >= ImageExportDirectory->NumberOfFunctions) {
- DEBUG ((DEBUG_ERROR, "%a %a: The PRM Module Export Descriptor ordinal value is invalid.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a %a: The PRM Module Export Descriptor ordinal value is invalid.\n", _DBGMSGID_, __func__));
return EFI_NOT_FOUND;
}
TempExportDescriptor = (PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *)((UINTN)CurrentImageAddress + ExportAddressTable[PrmModuleExportDescriptorOrdinal]);
if (TempExportDescriptor->Header.Signature == PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE) {
*ExportDescriptor = TempExportDescriptor;
- DEBUG ((DEBUG_INFO, " %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN)ExportDescriptor));
+ DEBUG ((DEBUG_INFO, " %a %a: PRM Module Export Descriptor found at 0x%x.\n", _DBGMSGID_, __func__, (UINTN)ExportDescriptor));
} else {
DEBUG ((
DEBUG_INFO,
" %a %a: PRM Module Export Descriptor found at 0x%x but signature check failed.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
(UINTN)TempExportDescriptor
));
}
- DEBUG ((DEBUG_INFO, " %a %a: Exiting export iteration since export descriptor found.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a: Exiting export iteration since export descriptor found.\n", _DBGMSGID_, __func__));
return EFI_SUCCESS;
}
}
@@ -194,7 +194,7 @@ GetExportDirectoryInPeCoffImage (
DEBUG_WARN,
"%a %a: The machine type for this image is not valid for a PRM module.\n",
_DBGMSGID_,
- __FUNCTION__
+ __func__
));
return EFI_UNSUPPORTED;
}
@@ -208,7 +208,7 @@ GetExportDirectoryInPeCoffImage (
// Check the PE/COFF Header Signature. Determine if the image is valid and/or a TE image.
//
if (OptionalHeaderPtrUnion.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {
- DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __func__));
return EFI_UNSUPPORTED;
}
@@ -237,18 +237,18 @@ GetExportDirectoryInPeCoffImage (
//
// The directory address overflows
//
- DEBUG ((DEBUG_ERROR, "%a %a: The export directory entry in this image results in overflow.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a %a: The export directory entry in this image results in overflow.\n", _DBGMSGID_, __func__));
return EFI_UNSUPPORTED;
} else {
- DEBUG ((DEBUG_INFO, "%a %a: Export Directory Entry found in the image at 0x%x.\n", _DBGMSGID_, __FUNCTION__, (UINTN)OptionalHeaderPtrUnion.Pe32));
- DEBUG ((DEBUG_INFO, " %a %a: Directory Entry Virtual Address = 0x%x.\n", _DBGMSGID_, __FUNCTION__, DirectoryEntry->VirtualAddress));
+ DEBUG ((DEBUG_INFO, "%a %a: Export Directory Entry found in the image at 0x%x.\n", _DBGMSGID_, __func__, (UINTN)OptionalHeaderPtrUnion.Pe32));
+ DEBUG ((DEBUG_INFO, " %a %a: Directory Entry Virtual Address = 0x%x.\n", _DBGMSGID_, __func__, DirectoryEntry->VirtualAddress));
ExportDirectory = (EFI_IMAGE_EXPORT_DIRECTORY *)((UINTN)Image + DirectoryEntry->VirtualAddress);
DEBUG ((
DEBUG_INFO,
" %a %a: Export Directory Table found successfully at 0x%x. Name address = 0x%x. Name = %a.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
(UINTN)ExportDirectory,
((UINTN)Image + ExportDirectory->Name),
(CHAR8 *)((UINTN)Image + ExportDirectory->Name)
@@ -287,7 +287,7 @@ GetImageVersionInPeCoffImage (
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION OptionalHeaderPtrUnion;
UINT16 Magic;
- DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a - Entry.\n", _DBGMSGID_, __func__));
if ((Image == NULL) || (PeCoffLoaderImageContext == NULL) || (ImageMajorVersion == NULL) || (ImageMinorVersion == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -320,7 +320,7 @@ GetImageVersionInPeCoffImage (
DEBUG_WARN,
"%a %a: The machine type for this image is not valid for a PRM module.\n",
_DBGMSGID_,
- __FUNCTION__
+ __func__
));
return EFI_UNSUPPORTED;
}
@@ -333,7 +333,7 @@ GetImageVersionInPeCoffImage (
// Check the PE/COFF Header Signature. Determine if the image is valid and/or a TE image.
//
if (OptionalHeaderPtrUnion.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {
- DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a %a: The PE signature is not valid for the current image.\n", _DBGMSGID_, __func__));
return EFI_UNSUPPORTED;
}
@@ -351,8 +351,8 @@ GetImageVersionInPeCoffImage (
*ImageMinorVersion = OptionalHeaderPtrUnion.Pe32Plus->OptionalHeader.MinorImageVersion;
}
- DEBUG ((DEBUG_INFO, " %a %a - Image Major Version: 0x%02x.\n", _DBGMSGID_, __FUNCTION__, *ImageMajorVersion));
- DEBUG ((DEBUG_INFO, " %a %a - Image Minor Version: 0x%02x.\n", _DBGMSGID_, __FUNCTION__, *ImageMinorVersion));
+ DEBUG ((DEBUG_INFO, " %a %a - Image Major Version: 0x%02x.\n", _DBGMSGID_, __func__, *ImageMajorVersion));
+ DEBUG ((DEBUG_INFO, " %a %a - Image Minor Version: 0x%02x.\n", _DBGMSGID_, __func__, *ImageMinorVersion));
return EFI_SUCCESS;
}
@@ -404,7 +404,7 @@ GetExportEntryAddress (
ASSERT (CurrentExportOrdinal < ImageExportDirectory->NumberOfFunctions);
if (CurrentExportOrdinal >= ImageExportDirectory->NumberOfFunctions) {
- DEBUG ((DEBUG_ERROR, " %a %a: The export ordinal value is invalid.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, " %a %a: The export ordinal value is invalid.\n", _DBGMSGID_, __func__));
break;
}
diff --git a/PrmPkg/PrmConfigDxe/PrmConfigDxe.c b/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
index c175ee2183ce..550ee64b4c53 100644
--- a/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
+++ b/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
@@ -71,7 +71,7 @@ SetRuntimeMemoryRangeAttributes (
UINTN Index;
EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
if ((RuntimeMmioRanges == NULL) || (RuntimeMmioRanges->Count == 0)) {
return;
@@ -82,14 +82,14 @@ SetRuntimeMemoryRangeAttributes (
DEBUG_INFO,
" %a %a: Runtime MMIO Range [%d].\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
Index
));
DEBUG ((
DEBUG_INFO,
" %a %a: Physical address = 0x%016x. Length = 0x%x.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
RuntimeMmioRanges->Range[Index].PhysicalBaseAddress,
RuntimeMmioRanges->Range[Index].Length
));
@@ -141,7 +141,7 @@ SetRuntimeMemoryRangeAttributes (
DEBUG_ERROR,
" %a %a: Error [%r] finding descriptor for runtime memory range 0x%016x.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
Status,
RuntimeMmioRanges->Range[Index].PhysicalBaseAddress
));
@@ -163,12 +163,12 @@ SetRuntimeMemoryRangeAttributes (
DEBUG_ERROR,
" %a %a: Error [%r] setting descriptor for runtime memory range 0x%016x.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
Status,
RuntimeMmioRanges->Range[Index].PhysicalBaseAddress
));
} else {
- DEBUG ((DEBUG_INFO, " %a %a: Successfully set runtime attribute for the MMIO range.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a: Successfully set runtime attribute for the MMIO range.\n", _DBGMSGID_, __func__));
}
}
}
@@ -189,7 +189,7 @@ StoreVirtualMemoryAddressChangePointers (
EFI_HANDLE *HandleBuffer;
PRM_CONFIG_PROTOCOL *PrmConfigProtocol;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
RangeIndex = 0;
@@ -199,7 +199,7 @@ StoreVirtualMemoryAddressChangePointers (
DEBUG_ERROR,
" %a %a: Memory allocation for runtime MMIO pointer array failed.\n",
_DBGMSGID_,
- __FUNCTION__
+ __func__
));
ASSERT (FALSE);
return;
@@ -232,7 +232,7 @@ StoreVirtualMemoryAddressChangePointers (
DEBUG_ERROR,
" %a %a: Index out of bounds - Actual count (%d) of runtime MMIO ranges exceeds maximum count (%d).\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
RangeIndex + 1,
mMaxRuntimeMmioRangeCount
));
@@ -248,7 +248,7 @@ StoreVirtualMemoryAddressChangePointers (
DEBUG_INFO,
" %a %a: %d MMIO ranges buffers saved for future virtual memory conversion.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
RangeIndex
));
}
@@ -277,12 +277,12 @@ ValidatePrmDataBuffer (
}
if (PrmDataBuffer->Header.Signature != PRM_DATA_BUFFER_HEADER_SIGNATURE) {
- DEBUG ((DEBUG_ERROR, " %a %a: The PRM data buffer signature is invalid. PRM module.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, " %a %a: The PRM data buffer signature is invalid. PRM module.\n", _DBGMSGID_, __func__));
return EFI_NOT_FOUND;
}
if (PrmDataBuffer->Header.Length < sizeof (PRM_DATA_BUFFER_HEADER)) {
- DEBUG ((DEBUG_ERROR, " %a %a: The PRM data buffer length is invalid.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, " %a %a: The PRM data buffer length is invalid.\n", _DBGMSGID_, __func__));
return EFI_BUFFER_TOO_SMALL;
}
@@ -311,12 +311,12 @@ ValidatePrmContextBuffer (
}
if (PrmContextBuffer->Signature != PRM_CONTEXT_BUFFER_SIGNATURE) {
- DEBUG ((DEBUG_ERROR, " %a %a: The PRM context buffer signature is invalid.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, " %a %a: The PRM context buffer signature is invalid.\n", _DBGMSGID_, __func__));
return EFI_NOT_FOUND;
}
if (IsZeroGuid (&PrmContextBuffer->HandlerGuid)) {
- DEBUG ((DEBUG_ERROR, " %a %a: The PRM context buffer GUID is zero.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, " %a %a: The PRM context buffer GUID is zero.\n", _DBGMSGID_, __func__));
return EFI_NOT_FOUND;
}
@@ -325,7 +325,7 @@ ValidatePrmContextBuffer (
DEBUG_ERROR,
" %a %a: Error in static buffer for PRM handler %g.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
&PrmContextBuffer->HandlerGuid
));
return EFI_NOT_FOUND;
@@ -387,7 +387,7 @@ PrmConfigEndOfDxeNotification (
PRM_CONTEXT_BUFFER *CurrentContextBuffer;
PRM_CONFIG_PROTOCOL *PrmConfigProtocol;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
HandleBuffer = NULL;
Status = gBS->LocateHandleBuffer (
@@ -413,11 +413,11 @@ PrmConfigEndOfDxeNotification (
DEBUG_INFO,
" %a %a: Found PRM configuration protocol for PRM module %g.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
&PrmConfigProtocol->ModuleContextBuffers.ModuleGuid
));
- DEBUG ((DEBUG_INFO, " %a %a: Validating module context buffers...\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a: Validating module context buffers...\n", _DBGMSGID_, __func__));
for (BufferIndex = 0; BufferIndex < PrmConfigProtocol->ModuleContextBuffers.BufferCount; BufferIndex++) {
CurrentContextBuffer = &(PrmConfigProtocol->ModuleContextBuffers.Buffer[BufferIndex]);
@@ -427,20 +427,20 @@ PrmConfigEndOfDxeNotification (
DEBUG_ERROR,
" %a %a: Context buffer validation failed for PRM handler %g.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
CurrentContextBuffer->HandlerGuid
));
}
}
- DEBUG ((DEBUG_INFO, " %a %a: Module context buffer validation complete.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, " %a %a: Module context buffer validation complete.\n", _DBGMSGID_, __func__));
if (PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges != NULL) {
DEBUG ((
DEBUG_INFO,
" %a %a: Found %d PRM runtime MMIO ranges.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges->Count
));
SetRuntimeMemoryRangeAttributes (PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges);
@@ -478,7 +478,7 @@ PrmConfigEntryPoint (
EFI_STATUS Status;
EFI_EVENT Event;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
//
// Register a notification function to change memory attributes at end of DXE
diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
index 5a223d783d80..477c24c8b8ff 100644
--- a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
+++ b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
@@ -73,7 +73,7 @@ ProcessPrmModules (
UINT64 HandlerPhysicalAddress;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
if (PrmAcpiDescriptionTable == NULL) {
return EFI_INVALID_PARAMETER;
@@ -89,19 +89,19 @@ ProcessPrmModules (
DEBUG_ERROR,
" %a %a: The Platform GUID in the DSC file must be set to a unique non-zero value.\n",
_DBGMSGID_,
- __FUNCTION__
+ __func__
));
ASSERT (!CompareGuid (&gEdkiiDscPlatformGuid, &gZeroGuid));
}
- DEBUG ((DEBUG_INFO, " %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __FUNCTION__, mPrmModuleCount));
- DEBUG ((DEBUG_INFO, " %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __FUNCTION__, mPrmHandlerCount));
+ DEBUG ((DEBUG_INFO, " %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __func__, mPrmModuleCount));
+ DEBUG ((DEBUG_INFO, " %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __func__, mPrmHandlerCount));
PrmAcpiDescriptionTableBufferSize = (UINT32)(OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure) +
(OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) * mPrmModuleCount) +
(sizeof (PRM_HANDLER_INFORMATION_STRUCT) * mPrmHandlerCount)
);
- DEBUG ((DEBUG_INFO, " %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __FUNCTION__, PrmAcpiDescriptionTableBufferSize));
+ DEBUG ((DEBUG_INFO, " %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __func__, PrmAcpiDescriptionTableBufferSize));
PrmAcpiTable = AllocateZeroPool ((UINTN)PrmAcpiDescriptionTableBufferSize);
if (PrmAcpiTable == NULL) {
@@ -139,7 +139,7 @@ ProcessPrmModules (
DEBUG_INFO,
" %a %a: PRM Module - %a with %d handlers.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
(CHAR8 *)((UINTN)CurrentImageAddress + CurrentImageExportDirectory->Name),
CurrentExportDescriptorStruct->Header.NumberPrmHandlers
));
@@ -212,7 +212,7 @@ ProcessPrmModules (
DEBUG_INFO,
" %a %a: Found %a handler physical address at 0x%016x.\n",
_DBGMSGID_,
- __FUNCTION__,
+ __func__,
CurrentExportDescriptorHandlerName,
CurrentHandlerInfoStruct->PhysicalAddress
));
@@ -279,7 +279,7 @@ PublishPrmAcpiTable (
&TableKey
);
if (!EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __func__));
}
}
@@ -316,7 +316,7 @@ PrmLoaderEndOfDxeNotification (
EFI_STATUS Status;
PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiDescriptionTable;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
Status = DiscoverPrmModules (&mPrmModuleCount, &mPrmHandlerCount);
ASSERT_EFI_ERROR (Status);
@@ -354,7 +354,7 @@ PrmLoaderEntryPoint (
EFI_STATUS Status;
EFI_EVENT EndOfDxeEvent;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
//
// Discover and process installed PRM modules at the End of DXE
@@ -369,7 +369,7 @@ PrmLoaderEntryPoint (
&EndOfDxeEvent
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a %a: EndOfDxe callback registration failed! %r.\n", _DBGMSGID_, __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a %a: EndOfDxe callback registration failed! %r.\n", _DBGMSGID_, __func__, Status));
ASSERT_EFI_ERROR (Status);
}
diff --git a/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c b/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c
index e8bf4cfb8f2d..80ad7d37587d 100644
--- a/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c
+++ b/PrmPkg/PrmSsdtInstallDxe/PrmSsdtInstallDxe.c
@@ -42,7 +42,7 @@ InstallPrmSsdt (
EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;
EFI_ACPI_DESCRIPTION_HEADER *Ssdt;
- DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __func__));
if (OemId == NULL) {
return EFI_INVALID_PARAMETER;
@@ -61,7 +61,7 @@ InstallPrmSsdt (
&SsdtSize
);
ASSERT_EFI_ERROR (Status);
- DEBUG ((DEBUG_INFO, "%a %a: SSDT loaded...\n", _DBGMSGID_, __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a %a: SSDT loaded...\n", _DBGMSGID_, __func__));
//
// Update OEM ID in the SSDT
--
2.34.1
next prev parent reply other threads:[~2023-04-06 22:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
2023-04-07 20:18 ` [edk2-devel] " Michael D Kinney
2023-04-06 22:23 ` [PATCH 02/18] ArmVirtPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
2023-04-07 3:09 ` Ni, Ray
2023-04-07 11:24 ` Sunil V L
2023-04-06 22:23 ` [PATCH 04/18] OvmfPkg: " Rebecca Cran
2023-04-07 11:19 ` Sunil V L
2023-04-06 22:23 ` [PATCH 05/18] MdeModulePkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 06/18] SecurityPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 07/18] EmbeddedPkg: " Rebecca Cran
2023-04-07 8:25 ` Chang, Abner
2023-04-06 22:23 ` [PATCH 08/18] RedfishPkg: " Rebecca Cran
2023-04-07 5:39 ` Nickle Wang
2023-04-06 22:23 ` [PATCH 09/18] ArmPlatformPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 10/18] UnitTestFrameworkPkg: Update " Rebecca Cran
2023-04-06 22:23 ` Rebecca Cran [this message]
2023-04-06 22:23 ` [PATCH 12/18] StandaloneMmPkg: Update code " Rebecca Cran
2023-04-06 22:23 ` [PATCH 13/18] CryptoPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 14/18] NetworkPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 15/18] SourceLevelDebugPkg: " Rebecca Cran
2023-04-07 3:08 ` Ni, Ray
2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
2023-04-07 3:08 ` Ni, Ray
2023-04-07 8:23 ` Chang, Abner
2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
2023-04-07 5:57 ` Guo, Gua
2023-04-07 7:55 ` Lu, James
2023-04-06 22:23 ` [PATCH 18/18] FmpDevicePkg: " Rebecca Cran
2023-04-10 1:05 ` Xu, Wei6
2023-04-07 10:09 ` [edk2-devel] [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Ard Biesheuvel
2023-04-10 14:21 ` Rebecca Cran
2023-04-11 9:15 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230406222319.2281263-12-rebecca@bsdio.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox