From 9a0f88b5fd7b0c87dfa6e725ffdeb84bbecd250f Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Mon, 7 Dec 2020 12:55:48 +0000 Subject: [PATCH] StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix the ECC reported error "[4002] Function header doesn't exist". Signed-off-by: Sami Mujawar Acked-by: Jiewen Yao Acked-by: Ard Biesheuvel Reviewed-by: Liming Gao --- .../StandaloneMmCpu/AArch64/EventHandle.c | 9 ++++-- .../StandaloneMmCpu/AArch64/StandaloneMmCpu.c | 23 +++++++++++++- .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h | 31 ++++++++++++++++++- 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c index 03e887d777..d86d21bb01 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c @@ -196,10 +196,13 @@ MmFoundationEntryRegister ( This function is the main entry point for an MM handler dispatch or communicate-based callback. - @param DispatchHandle The unique handle assigned to this handler by MmiHandlerRegister(). - @param Context Points to an optional handler context which was specified when the handler was registered. + @param DispatchHandle The unique handle assigned to this handler by + MmiHandlerRegister(). + @param Context Points to an optional handler context which was + specified when the handler was registered. @param CommBuffer A pointer to a collection of data in memory that will - be conveyed from a non-MM environment into an MM environment. + be conveyed from a non-MM environment into an + MM environment. @param CommBufferSize The size of the CommBuffer. @return Status Code diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c index 9e49609601..6884095c49 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c @@ -44,6 +44,16 @@ EFI_MM_SYSTEM_TABLE *mMmst = NULL; // STATIC EFI_HANDLE mMmCpuHandle = NULL; +/** Returns the HOB data for the matching HOB GUID. + + @param [in] HobList Pointer to the HOB list. + @param [in] HobGuid The GUID for the HOB. + @param [out] HobData Pointer to the HOB data. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_NOT_FOUND Could not find HOB with matching GUID. +**/ EFI_STATUS GetGuidedHobData ( IN VOID *HobList, @@ -70,9 +80,20 @@ GetGuidedHobData ( return EFI_SUCCESS; } +/** Entry point for the Standalone MM CPU driver. + + @param [in] ImageHandle Unused. Not actual image handle. + @param [in] SystemTable Pointer to MM System table. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Out of resources. + @retval EFI_NOT_FOUND Failed to find the HOB for the CPU + driver endpoint descriptor. +**/ EFI_STATUS StandaloneMmCpuInitialize ( - IN EFI_HANDLE ImageHandle, // not actual imagehandle + IN EFI_HANDLE ImageHandle, // not actual imagehandle IN EFI_MM_SYSTEM_TABLE *SystemTable // not actual systemtable ) { diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h index 47a020c27b..2c96439c15 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h @@ -2,7 +2,7 @@ Private header with declarations and definitions specific to the MM Standalone CPU driver - Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2017 - 2021, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -33,6 +33,19 @@ extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer; extern MP_INFORMATION_HOB_DATA *mMpInformationHobData; extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig; +/** + The PI Standalone MM entry point for the TF-A CPU driver. + + @param [in] EventId The event Id. + @param [in] CpuNumber The CPU number. + @param [in] NsCommBufferAddr Address of the NS common buffer. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter was invalid. + @retval EFI_ACCESS_DENIED Access not permitted. + @retval EFI_OUT_OF_RESOURCES Out of resources. + @retval EFI_UNSUPPORTED Operation not supported. +**/ EFI_STATUS PiMmStandaloneArmTfCpuDriverEntry ( IN UINTN EventId, @@ -40,6 +53,22 @@ PiMmStandaloneArmTfCpuDriverEntry ( IN UINTN NsCommBufferAddr ); +/** + This function is the main entry point for an MM handler dispatch + or communicate-based callback. + + @param DispatchHandle The unique handle assigned to this handler by + MmiHandlerRegister(). + @param Context Points to an optional handler context which was + specified when the handler was registered. + @param CommBuffer A pointer to a collection of data in memory that will + be conveyed from a non-MM environment into an + MM environment. + @param CommBufferSize The size of the CommBuffer. + + @return Status Code + +**/ EFI_STATUS EFIAPI PiMmCpuTpFwRootMmiHandler ( -- 2.39.2