public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: <devel@edk2.groups.io>
Cc: Sami Mujawar <sami.mujawar@arm.com>, <ard.biesheuvel@arm.com>,
	<jiewen.yao@intel.com>, <lersek@redhat.com>,
	<thomas.abraham@arm.com>, <Sughosh.Ganu@arm.com>,
	<Matteo.Carlini@arm.com>, <Ben.Adderson@arm.com>, <nd@arm.com>
Subject: [PATCH v1 13/25] StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCoreEntryPoint
Date: Wed, 9 Dec 2020 18:46:58 +0000	[thread overview]
Message-ID: <20201209184710.20912-14-sami.mujawar@arm.com> (raw)
In-Reply-To: <20201209184710.20912-1-sami.mujawar@arm.com>

Add doxygen style function headers to fix ECC reported errors
"[4002] Function header doesn't exist Function".

Also update the corresponding declaration to add IN/OUT doxygen
style reference tags.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
 StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h                    | 34 +++++++-------
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c             | 48 ++++++++++++++++++++
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 14 +++++-
 3 files changed, 78 insertions(+), 18 deletions(-)

diff --git a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
index 0f9a032404582fd59e3d4e2bf2884b1077b78d5c..34c43897dded9aebe1470f2dbfe96b93590a9e45 100644
--- a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
+++ b/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
@@ -2,7 +2,7 @@
   Entry point to the Standalone MM Foundation when initialized during the SEC
   phase on ARM platforms
 
-Copyright (c) 2017 - 2018, ARM Ltd. All rights reserved.<BR>
+Copyright (c) 2017 - 2020, Arm Ltd. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -70,13 +70,13 @@ typedef RETURN_STATUS (*REGION_PERMISSION_UPDATE_FUNC) (
   sections in the Standalone MM Core module to be able to access RO and RW data
   and make further progress in the boot process.
 
-  @param  ImageContext           Pointer to PE/COFF image context
-  @param  ImageBase              Base of image in memory
-  @param  SectionHeaderOffset    Offset of PE/COFF image section header
-  @param  NumberOfSections       Number of Sections
-  @param  TextUpdater            Function to change code permissions
-  @param  ReadOnlyUpdater        Function to change RO permissions
-  @param  ReadWriteUpdater       Function to change RW permissions
+  @param  [in] ImageContext           Pointer to PE/COFF image context
+  @param  [in] ImageBase              Base of image in memory
+  @param  [in] SectionHeaderOffset    Offset of PE/COFF image section header
+  @param  [in] NumberOfSections       Number of Sections
+  @param  [in] TextUpdater            Function to change code permissions
+  @param  [in] ReadOnlyUpdater        Function to change RO permissions
+  @param  [in] ReadWriteUpdater       Function to change RW permissions
 
 **/
 EFI_STATUS
@@ -98,11 +98,11 @@ UpdateMmFoundationPeCoffPermissions (
   the Standalone MM Core module to be able to change permissions of the
   individual sections later in the boot process.
 
-  @param  TeData                 Pointer to PE/COFF image data
-  @param  ImageContext           Pointer to PE/COFF image context
-  @param  ImageBase              Pointer to ImageBase variable
-  @param  SectionHeaderOffset    Offset of PE/COFF image section header
-  @param  NumberOfSections       Number of Sections
+  @param  [in]      TeData                Pointer to PE/COFF image data
+  @param  [in, out] ImageContext          Pointer to PE/COFF image context
+  @param  [out]     ImageBase             Pointer to ImageBase variable
+  @param  [in, out] SectionHeaderOffset   Offset of PE/COFF image section header
+  @param  [in, out] NumberOfSections      Number of Sections
 
 **/
 EFI_STATUS
@@ -121,10 +121,10 @@ GetStandaloneMmCorePeCoffSections (
   by the Boot Firmware Volume. This function locates the Standalone MM Core
   module PE/COFF image in the BFV and returns this information.
 
-  @param  BfvAddress             Base Address of Boot Firmware Volume
-  @param  TeData                 Pointer to address for allocating memory for
-                                 PE/COFF image data
-  @param  TeDataSize             Pointer to size of PE/COFF image data
+  @param  [in]      BfvAddress         Base Address of Boot Firmware Volume
+  @param  [in, out] TeData             Pointer to address for allocating memory
+                                       for PE/COFF image data
+  @param  [in, out] TeDataSize         Pointer to size of PE/COFF image data
 
 **/
 EFI_STATUS
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
index 0ab6edaeb7f05bc814281d0e928305804633e970..f2e724cfc38e75d61bae5d8d21d40feda1685144 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
@@ -25,6 +25,21 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include <IndustryStandard/ArmStdSmc.h>
 
+/**
+  Privileged firmware assigns RO & Executable attributes to all memory occupied
+  by the Boot Firmware Volume. This function sets the correct permissions of
+  sections in the Standalone MM Core module to be able to access RO and RW data
+  and make further progress in the boot process.
+
+  @param  [in] ImageContext           Pointer to PE/COFF image context
+  @param  [in] ImageBase              Base of image in memory
+  @param  [in] SectionHeaderOffset    Offset of PE/COFF image section header
+  @param  [in] NumberOfSections       Number of Sections
+  @param  [in] TextUpdater            Function to change code permissions
+  @param  [in] ReadOnlyUpdater        Function to change RO permissions
+  @param  [in] ReadWriteUpdater       Function to change RW permissions
+
+**/
 EFI_STATUS
 EFIAPI
 UpdateMmFoundationPeCoffPermissions (
@@ -113,6 +128,17 @@ UpdateMmFoundationPeCoffPermissions (
   return RETURN_SUCCESS;
 }
 
+/**
+  Privileged firmware assigns RO & Executable attributes to all memory occupied
+  by the Boot Firmware Volume. This function locates the Standalone MM Core
+  module PE/COFF image in the BFV and returns this information.
+
+  @param  [in]      BfvAddress         Base Address of Boot Firmware Volume
+  @param  [in, out] TeData             Pointer to address for allocating memory
+                                       for PE/COFF image data
+  @param  [in, out] TeDataSize         Pointer to size of PE/COFF image data
+
+**/
 EFI_STATUS
 EFIAPI
 LocateStandaloneMmCorePeCoffData (
@@ -151,6 +177,15 @@ LocateStandaloneMmCorePeCoffData (
   return Status;
 }
 
+/**
+  Returns the PC COFF section information.
+
+  @param  [in, out] ImageContext         Pointer to PE/COFF image context
+  @param  [out]     ImageBase            Base of image in memory
+  @param  [out]     SectionHeaderOffset  Offset of PE/COFF image section header
+  @param  [out]     NumberOfSections     Number of Sections
+
+**/
 STATIC
 EFI_STATUS
 GetPeCoffSectionInformation (
@@ -241,6 +276,19 @@ GetPeCoffSectionInformation (
   return RETURN_SUCCESS;
 }
 
+/**
+  Privileged firmware assigns RO & Executable attributes to all memory occupied
+  by the Boot Firmware Volume. This function locates the section information of
+  the Standalone MM Core module to be able to change permissions of the
+  individual sections later in the boot process.
+
+  @param  [in]      TeData                Pointer to PE/COFF image data
+  @param  [in, out] ImageContext          Pointer to PE/COFF image context
+  @param  [out]     ImageBase             Pointer to ImageBase variable
+  @param  [in, out] SectionHeaderOffset   Offset of PE/COFF image section header
+  @param  [in, out] NumberOfSections      Number of Sections
+
+**/
 EFI_STATUS
 EFIAPI
 GetStandaloneMmCorePeCoffSections (
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
index 9cecfa667b905c975ddd348513c51fc8a5955718..3d3c772019df9afe9b8ec77019c776ea7c3b55fb 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
@@ -2,7 +2,7 @@
   Entry point to the Standalone MM Foundation when initialized during the SEC
   phase on ARM platforms
 
-Copyright (c) 2017 - 2018, ARM Ltd. All rights reserved.<BR>
+Copyright (c) 2017 - 2020, Arm Ltd. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -101,6 +101,12 @@ GetAndPrintBootinformation (
   return PayloadBootInfo;
 }
 
+/**
+  A loop to delegated events.
+
+  @param  [in] EventCompleteSvcArgs   Pointer to the event completion arguments.
+
+**/
 VOID
 EFIAPI
 DelegatedEventLoop (
@@ -156,6 +162,12 @@ DelegatedEventLoop (
   }
 }
 
+/**
+  Query the SPM version, check compatibility and return success if compatible.
+
+  @retval EFI_SUCCESS       SPM versions compatible.
+  @retval EFI_UNSUPPORTED   SPM versions not compatible.
+**/
 STATIC
 EFI_STATUS
 GetSpmVersion (VOID)
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


  parent reply	other threads:[~2020-12-09 18:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 18:46 [PATCH v1 00/25] Enable Core CI support for StandaloneMmPkg Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 01/25] StandaloneMmPkg: Add library header files to DEC Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 02/25] StandaloneMmPkg: Add library files to DSC Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 03/25] StandaloneMmPkg: Fix spell check reported errors Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 04/25] StandaloneMmPkg: Fix ECC error 9002 in Core dispatcher Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 05/25] StandaloneMmPkg: Fix ECC error 1001 in SMM Memory pool management Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 06/25] StandaloneMmPkg: Fix ECC error 3002 in StandaloneMmCpu Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 07/25] StandaloneMmPkg: Fix ECC error 4002 in FwVol helper Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 08/25] StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCoreEntryPoint Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 09/25] StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCpu Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 10/25] StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCore Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 11/25] StandaloneMmPkg: Fix ECC error 10014 in StandaloneMmCpu Sami Mujawar
2020-12-09 18:46 ` [PATCH v1 12/25] StandaloneMmPkg: Fix ECC error 4002 and 9002 in StandaloneMmCore Sami Mujawar
2020-12-09 18:46 ` Sami Mujawar [this message]
2020-12-09 18:46 ` [PATCH v1 14/25] StandaloneMmPkg: Fix ECC error 9002 in StandaloneMmMemLib Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 15/25] StandaloneMmPkg: Fix ECC error 9002 in StandaloneMmCoreEntryPoint Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 16/25] StandaloneMmPkg: Fix ECC error 9003 " Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 17/25] StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 18/25] StandaloneMmPkg: Fix ECC error 9001 " Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 19/25] StandaloneMmPkg: Fix ECC error 9001 in Standalone MM Core Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 20/25] StandaloneMmPkg: Fix ECC error 9002 in CoreMemoryAllocationLib Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 21/25] StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 22/25] StandaloneMmPkg: Fix ECC error 8005 in StandaloneMmCoreEntryPoint Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 23/25] StandaloneMmPkg: Add EDK2 Core CI support Sami Mujawar
2020-12-09 20:09   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-12-09 20:42     ` Sami Mujawar
2020-12-09 22:37     ` Yao, Jiewen
2020-12-09 18:47 ` [PATCH v1 24/25] .azurepipelines: Add StandaloneMmPkg to CI matrix Sami Mujawar
2020-12-09 20:10   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-12-09 20:42     ` Sami Mujawar
2020-12-09 18:47 ` [PATCH v1 25/25] .pytool: CI Settings to support StandaloneMmPkg Sami Mujawar
2020-12-09 20:10   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-12-09 22:31 ` [PATCH v1 00/25] Enable Core CI support for StandaloneMmPkg Yao, Jiewen
2020-12-10  9:27 ` [edk2-devel] " Laszlo Ersek

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=20201209184710.20912-14-sami.mujawar@arm.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