]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCoreEntryPoint
authorSami Mujawar <sami.mujawar@arm.com>
Mon, 7 Dec 2020 11:22:43 +0000 (11:22 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 7 Jan 2021 11:13:39 +0000 (11:13 +0000)
Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150)

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>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c

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