From nobody Tue Feb 10 12:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+102642+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102642+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1680819860; cv=none; d=zohomail.com; s=zohoarc; b=bWlWKgyyZZb73841nDzj1l9HaPDgsDxpk4rmOqe1xrKIZJMkbilZnhBulzJ8D1GyGVw1tT2t0So/VNaBpXUd8deVV0poLrz0+hVMdYmz87snr2+guPdIAAi+QuDSNGNoLLmY8v2bMPTp9hkbZ0gyePVTkoD1hPabGNOSUV+zNwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680819860; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qgIYA1MprSYfyPtBjFnOJ1LLTkkyqgRYyLB3oxhmJFk=; b=EdbURzvI8W6nTkC5uL4E8jp1/jl2nuszYTewaU6yxA4Pzu91d3ixRJMlPFPu0gPAdCo7gUGi4KTzkCRQ7xZwIHm2EdKg1PeP0zRx3t6Lkrc0od1ch7j2rT4pAz1GeSO8wJIICqtdAAabrPCUGTpJs0I0QK2slv1sTtm/qXcAXVI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102642+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1680819860501958.1011904819541; Thu, 6 Apr 2023 15:24:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FwH7YY1788612xWdaGo3r4T1; Thu, 06 Apr 2023 15:24:20 -0700 X-Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx.groups.io with SMTP id smtpd.web11.171751.1680819859367975774 for ; Thu, 06 Apr 2023 15:24:19 -0700 X-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B150D5C01D6; Thu, 6 Apr 2023 18:24:18 -0400 (EDT) X-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 06 Apr 2023 18:24:18 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepgeffueeuledvgefgvddvgfetvdduhfefkedukeeikedtudekfeetteeifedv leefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprh gvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Apr 2023 18:24:15 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu , Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo , Andrew Fish , Hao A Wu , Maciej Rabeda , Siyuan Fu , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Ard Biesheuvel , Sami Mujawar , Supreeth Venkatesh , Michael Kubacki , Nate DeSimone , Sean Brogan Cc: Rebecca Cran , Leif Lindholm , Abner Chang , Nickle Wang , Igor Kulchytskyy , Daniel Schaefer , Min Xu , Jordan Justen , Gerd Hoffmann , Peter Grehan , Erdem Aktas , James Bottomley , Tom Lendacky , Michael Roth , Sunil V L , Andrei Warkentin Subject: [edk2-devel] [PATCH 12/18] StandaloneMmPkg: Update code to be more C11 compliant by using __func__ Date: Thu, 6 Apr 2023 16:23:13 -0600 Message-Id: <20230406222319.2281263-13-rebecca@bsdio.com> In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com> References: <20230406222319.2281263-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: fbcKXWyAEz4dXipVKu8pcIspx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680819860; bh=cllGxWUmSR9yB2/hB5c+0MU0ovbk3DTPwCwB5GKqgB4=; h=Cc:Date:From:Reply-To:Subject:To; b=q4i+Mji4W1oWnNaS+Hys7vf7VbIRxsitPEJysHChjC9XfAv6RkW7K0B4SRQjmfV3oYz /oBartdF//jfheOpu0RwCd738Tp5skvlC7C7djLnRS26rznI4talYTwSUXOYMyQk7t9L0 f968g0J8mRzJnEVQC8HQDZjG3VKSrbFB53o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680819862463100003 Content-Type: text/plain; charset="utf-8" __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 --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c = | 22 ++++++++++---------- StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c= | 2 +- StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Standalon= eMmPeCoffExtraActionLib.c | 16 +++++++------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPerm= issions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermi= ssions.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 =3D %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 =3D=3D %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 =3D %r)\n", - __FUNCTION__, + __func__, Status )); return Status; diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemL= ibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMe= mLibInternal.c index c309d1bc6a56..0b4b1174de18 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInter= nal.c +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInter= nal.c @@ -95,7 +95,7 @@ MmMemLibInternalPopulateMmramRanges ( EFI_MMRAM_DESCRIPTOR *MmramDescriptors; =20 HobStart =3D GetHobList (); - DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __FUNCTION__, HobStart)); + DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, HobStart)); =20 // // Extract MM Core Private context from the Hob. If absent search for diff --git a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch= 64/StandaloneMmPeCoffExtraActionLib.c b/StandaloneMmPkg/Library/StandaloneM= mPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c index 426fd8dd74ac..492252843e12 100644 --- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Stan= daloneMmPeCoffExtraActionLib.c +++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/Stan= daloneMmPeCoffExtraActionLib.c @@ -55,7 +55,7 @@ UpdatePeCoffPermissions ( DEBUG (( DEBUG_ERROR, "%a: PeCoffLoaderGetImageInfo () failed (Status =3D %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 =3D %r)\n", - __FUNCTION__, + __func__, Status )); return Status; @@ -156,7 +156,7 @@ UpdatePeCoffPermissions ( DEBUG (( DEBUG_ERROR, "%a: TmpContext.ImageRead () failed (Status =3D %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 an= d size 0x%x\n", - __FUNCTION__, + __func__, Index, Base, SectionHeader.Misc.VirtualSize --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-