__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
StandaloneMmPkg.
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>
---
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c | 22 ++++++++++----------
StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c | 2 +-
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 16 +++++++-------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
index 8f2833a13512..5c6bd0e1d7d2 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c
@@ -80,7 +80,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: ImageContext->ImageRead () failed (Status = %r)\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
@@ -89,7 +89,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has 0x%x permissions\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress,
SectionHeader.Characteristics
@@ -97,7 +97,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has %a name\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress,
SectionHeader.Name
@@ -105,7 +105,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has 0x%x address\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress,
ImageContext->ImageAddress + SectionHeader.VirtualAddress
@@ -113,7 +113,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Section %d of image at 0x%lx has 0x%x data\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress,
SectionHeader.PointerToRawData
@@ -133,7 +133,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Mapping section %d of image at 0x%lx with RW-XN permissions\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress
));
@@ -141,7 +141,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Mapping section %d of image at 0x%lx with RO-XN permissions\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress
));
@@ -150,7 +150,7 @@ UpdateMmFoundationPeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Ignoring section %d of image at 0x%lx with 0x%x permissions\n",
- __FUNCTION__,
+ __func__,
Index,
ImageContext->ImageAddress,
SectionHeader.Characteristics
@@ -251,7 +251,7 @@ GetPeCoffSectionInformation (
DEBUG ((
DEBUG_ERROR,
"%a: PeCoffLoaderGetImageInfo () failed (Status == %r)\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
@@ -266,7 +266,7 @@ GetPeCoffSectionInformation (
DEBUG ((
DEBUG_WARN,
"%a: non-TE Image at 0x%lx has SectionAlignment < 4 KB (%lu)\n",
- __FUNCTION__,
+ __func__,
ImageContext->ImageAddress,
ImageContext->SectionAlignment
));
@@ -296,7 +296,7 @@ GetPeCoffSectionInformation (
DEBUG ((
DEBUG_ERROR,
"%a: TmpContext->ImageRead () failed (Status = %r)\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
index c309d1bc6a56..0b4b1174de18 100644
--- a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
+++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
@@ -95,7 +95,7 @@ MmMemLibInternalPopulateMmramRanges (
EFI_MMRAM_DESCRIPTOR *MmramDescriptors;
HobStart = GetHobList ();
- DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __FUNCTION__, HobStart));
+ DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, HobStart));
//
// Extract MM Core Private context from the Hob. If absent search for
diff --git a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
index 426fd8dd74ac..492252843e12 100644
--- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
+++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
@@ -55,7 +55,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: PeCoffLoaderGetImageInfo () failed (Status = %r)\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
@@ -68,7 +68,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: ignoring XIP TE image at 0x%lx\n",
- __FUNCTION__,
+ __func__,
ImageContext->ImageAddress
));
return RETURN_SUCCESS;
@@ -84,7 +84,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_WARN,
"%a: non-TE Image at 0x%lx has SectionAlignment < 4 KB (%lu)\n",
- __FUNCTION__,
+ __func__,
ImageContext->ImageAddress,
TmpContext.SectionAlignment
));
@@ -114,7 +114,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: TmpContext.ImageRead () failed (Status = %r)\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
@@ -156,7 +156,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_ERROR,
"%a: TmpContext.ImageRead () failed (Status = %r)\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
@@ -169,7 +169,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n",
- __FUNCTION__,
+ __func__,
Index,
Base,
SectionHeader.Misc.VirtualSize
@@ -179,7 +179,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_WARN,
"%a: Mapping section %d of image at 0x%lx with RW-XN permissions and size 0x%x\n",
- __FUNCTION__,
+ __func__,
Index,
Base,
SectionHeader.Misc.VirtualSize
@@ -189,7 +189,7 @@ UpdatePeCoffPermissions (
DEBUG ((
DEBUG_INFO,
"%a: Mapping section %d of image at 0x%lx with RO-X permissions and size 0x%x\n",
- __FUNCTION__,
+ __func__,
Index,
Base,
SectionHeader.Misc.VirtualSize
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102642): https://edk2.groups.io/g/devel/message/102642
Mute This Topic: https://groups.io/mt/98115249/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-