From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=C66gpxE2; spf=pass (domain: bsdio.com, ip: 66.111.4.29, mailfrom: rebecca@bsdio.com) 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) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 06 Apr 2023 18:24:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1680819858; x= 1680906258; bh=9W9ukSvD7CcFhccVefL9cxS9P2XHza31kA+IlkILCtQ=; b=C 66gpxE24hNZzJNOwjufvKjZqSOuX9ctV2aVQ++mtXkPQui5VnFz5+kVY9YjD9EmI G9pBrKszMQAFDn44nJSjv/+R6uOIKT5tZiKLXfYJBu9P7cXliZXV75phB4JwHeIM jRjUvdiafPeDIhthszJIMKQ8fALpxZYnws9SzIsgM3M96RozVY4BXZkUZB0RO1/Q UxLOar4tKAzudCXSL/4xDlefSpmRRcFIxRjloO93ZTUBv7qfa+p1UmDOSPdWawEu f9ynHIXlaIm84+xWoncuhWUvktq5k9oEm9EQ+fpIRQVdGSlo06GrKGynjJx5e6p6 hbE4nkYtmdP1PzLXOu0ig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1680819858; x= 1680906258; bh=9W9ukSvD7CcFhccVefL9cxS9P2XHza31kA+IlkILCtQ=; b=V IybO7Qumko+NQ/rr54cMGXK1j5IRpRW24pTPlWjPJoaPKV6bs7az89vF/DJNKh72 erd1rTuqYysyXRkDTVe37N0q8RT4H7eqATSgZhd6VL7FYe/Qrgs8mar9puAkxRLS 4uUMcV+q7fyo6+Ka6pdDp5MbrdeXK+NSiSCDcau2jzpOtUTw07WW4UFVrn75Gwyj eI4Cgf5YwroZrpK3+D3sTQBpyAwSDV62F7PwtCOfuEMAB3r5y5GlVglbSAfg8rVC e6+STgeYm41JXllDGQYcgbcp+IbsjRDcGDsYLlC+JSXvcU29ixWOzo1Q1NUV4KKB QS+ud4dGbOyynb+jzYFNQ== 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 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: [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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com> References: <20230406222319.2281263-1-rebecca@bsdio.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit __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/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