Add header file for the definition of StandaloneMmCorePlatformHookLib. Add NULL instance for StandaloneMmCorePlatformHookLib.
This library class defines a set of platform hooks called by the Standalone Mm Core. With this library, platform can perform specific tasks before and after invoking registered MMI handlers. Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org> Cc: Sami Mujawar <sami.muja...@arm.com> Cc: Ray Ni <ray...@intel.com> Signed-off-by: Wei6 Xu <wei6...@intel.com> --- .../StandaloneMmCorePlatformHookLibNull.c | 45 +++++++++++++++++++ .../Library/StandaloneMmCorePlatformHookLib.h | 44 ++++++++++++++++++ .../StandaloneMmCorePlatformHookLibNull.inf | 30 +++++++++++++ StandaloneMmPkg/StandaloneMmPkg.dec | 4 ++ StandaloneMmPkg/StandaloneMmPkg.dsc | 2 + 5 files changed, 125 insertions(+) create mode 100644 StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.c create mode 100644 StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLib.h create mode 100644 StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf diff --git a/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.c b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.c new file mode 100644 index 000000000000..dfd781e8c947 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.c @@ -0,0 +1,45 @@ +/** @file + NULL instance of StandaloneMmCorePlatformHookLib. + + Copyright (c) 2023, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include <Library/StandaloneMmCorePlatformHookLib.h> + +/** + Performs platform specific tasks before invoking registered SMI handlers. + + This function performs platform specific tasks before invoking registered SMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookBeforeMmDispatch ( + VOID + ) +{ + return EFI_SUCCESS; +} + +/** + Performs platform specific tasks after invoking registered SMI handlers. + + This function performs platform specific tasks after invoking registered SMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookAfterMmDispatch ( + VOID + ) +{ + return EFI_SUCCESS; +} diff --git a/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLib.h b/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLib.h new file mode 100644 index 000000000000..37eaa4e8946c --- /dev/null +++ b/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLib.h @@ -0,0 +1,44 @@ +/** @file + Standalone Mm Core Platform Hook Library. This library class defines a set of platform + hooks called by the Standalone Mm Core. + + Copyright (c) 2023, Intel Corporation. All rights reserved.<BR> + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef STANDALONE_MM_CORE_PLATFORM_HOOK_LIB_ +#define STANDALONE_MM_CORE_PLATFORM_HOOK_LIB_ + +/** + Performs platform specific tasks before invoking registered MMI handlers. + + This function performs platform specific tasks before invoking registered MMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookBeforeMmDispatch ( + VOID + ); + +/** + Performs platform specific tasks after invoking registered MMI handlers. + + This function performs platform specific tasks after invoking registered MMI handlers. + + @retval EFI_SUCCESS The platform hook completes successfully. + @retval Other values The platform hook cannot complete due to some error. + +**/ +EFI_STATUS +EFIAPI +PlatformHookAfterMmDispatch ( + VOID + ); + +#endif diff --git a/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf new file mode 100644 index 000000000000..917f2983c938 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf @@ -0,0 +1,30 @@ +## @file +# Standalone MM Core Platform Hook NULL Library instance. +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = StandaloneMmCorePlatformHookLibNull + FILE_GUID = A5924660-072B-4188-A850-C45FBED9FCE0 + MODULE_TYPE = MM_CORE_STANDALONE + VERSION_STRING = 1.0 + PI_SPECIFICATION_VERSION = 0x00010032 + LIBRARY_CLASS = StandaloneMmCorePlatformHookLib|MM_CORE_STANDALONE + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + StandaloneMmCorePlatformHookLibNull.c + +[Packages] + MdePkg/MdePkg.dec + StandaloneMmPkg/StandaloneMmPkg.dec diff --git a/StandaloneMmPkg/StandaloneMmPkg.dec b/StandaloneMmPkg/StandaloneMmPkg.dec index 46784d94e421..1e847ebd0635 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dec +++ b/StandaloneMmPkg/StandaloneMmPkg.dec @@ -29,6 +29,10 @@ [LibraryClasses] ## MM Memory Operation. MemLib|Include/Library/StandaloneMmMemLib.h + ## @libraryclass Defines a set of platform hooks called by the Standalone + ## Mm Core. + StandaloneMmCorePlatformHookLib|Include/Library/StandaloneMmCorePlatformHookLib.h + [LibraryClasses.AArch64, LibraryClasses.ARM] ## @libraryclass Defines a set of interfaces for the MM core entrypoint for ## AArch64 and ARM. diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc index 8012f93b7dcc..bfa1760f8e6f 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dsc +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc @@ -72,6 +72,7 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM] [LibraryClasses.common.MM_CORE_STANDALONE] HobLib|StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf + StandaloneMmCorePlatformHookLib|StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf [LibraryClasses.common.MM_STANDALONE] MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf @@ -117,6 +118,7 @@ [Components.common] StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf + StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf [Components.AARCH64, Components.ARM] StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf -- 2.29.2.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110178): https://edk2.groups.io/g/devel/message/110178 Mute This Topic: https://groups.io/mt/102214567/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-