From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 14F6E7803CF for ; Fri, 27 Oct 2023 03:28:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=NA5bKvla1b+KDIS8JFzPHzII8wbZTTI9qAeU3wvY5IA=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698377289; v=1; b=DYZW5JQ8B/g4Io2LFYb4tB2SipykMzdgrvkLTvYHoLkrKQ1EVLMynUhtOw2BalHfxVQ6wTpO 1NMQLPSdYhDph0qDvpiySp9DiX8suwAkQ0DcQ8sT3hBWbGTvVA5Pkk8sYQZ15mybpE80mdajc66 1+DA+kWs+OFKLPrpnNTng7OE= X-Received: by 127.0.0.2 with SMTP id D2TIYY7687511xpy08e7VB67; Thu, 26 Oct 2023 20:28:09 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.89154.1698377286242718615 for ; Thu, 26 Oct 2023 20:28:09 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="473943438" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="473943438" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 20:28:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10875"; a="829832834" X-IronPort-AV: E=Sophos;i="6.03,255,1694761200"; d="scan'208";a="829832834" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by fmsmga004.fm.intel.com with ESMTP; 26 Oct 2023 20:28:07 -0700 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Ard Biesheuvel , Sami Mujawar , Ray Ni Subject: [edk2-devel] [PATCH 1/2] StandaloneMmPkg: Add Standalone Mm Core platform hook lib. Date: Fri, 27 Oct 2023 11:28:01 +0800 Message-Id: <74ca409bcfbd0041c8ead9f504776d76420c4b03.1698375369.git.wei6.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wei6.xu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3chqWG6QcsXoE4F3oD8eA8Qqx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=DYZW5JQ8; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 Cc: Sami Mujawar Cc: Ray Ni Signed-off-by: Wei6 Xu --- .../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/StandaloneMmCorePlatformHookLib= Null/StandaloneMmCorePlatformHookLibNull.c create mode 100644 StandaloneMmPkg/Include/Library/StandaloneMmCorePlatfor= mHookLib.h create mode 100644 StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLib= Null/StandaloneMmCorePlatformHookLibNull.inf diff --git a/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/St= andaloneMmCorePlatformHookLibNull.c b/StandaloneMmPkg/Library/StandaloneMmC= orePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.c new file mode 100644 index 000000000000..dfd781e8c947 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/Standalon= eMmCorePlatformHookLibNull.c @@ -0,0 +1,45 @@ +/** @file=0D + NULL instance of StandaloneMmCorePlatformHookLib.=0D +=0D + Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include =0D +=0D +/**=0D + Performs platform specific tasks before invoking registered SMI handlers= .=0D +=0D + This function performs platform specific tasks before invoking registere= d SMI handlers.=0D +=0D + @retval EFI_SUCCESS The platform hook completes successfully.=0D + @retval Other values The platform hook cannot complete due to some = error.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PlatformHookBeforeMmDispatch (=0D + VOID=0D + )=0D +{=0D + return EFI_SUCCESS;=0D +}=0D +=0D +/**=0D + Performs platform specific tasks after invoking registered SMI handlers.= =0D +=0D + This function performs platform specific tasks after invoking registered= SMI handlers.=0D +=0D + @retval EFI_SUCCESS The platform hook completes successfully.=0D + @retval Other values The platform hook cannot complete due to some = error.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PlatformHookAfterMmDispatch (=0D + VOID=0D + )=0D +{=0D + return EFI_SUCCESS;=0D +}=0D diff --git a/StandaloneMmPkg/Include/Library/StandaloneMmCorePlatformHookLi= b.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=0D + Standalone Mm Core Platform Hook Library. This library class defines a s= et of platform=0D + hooks called by the Standalone Mm Core.=0D +=0D + Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef STANDALONE_MM_CORE_PLATFORM_HOOK_LIB_=0D +#define STANDALONE_MM_CORE_PLATFORM_HOOK_LIB_=0D +=0D +/**=0D + Performs platform specific tasks before invoking registered MMI handlers= .=0D +=0D + This function performs platform specific tasks before invoking registere= d MMI handlers.=0D +=0D + @retval EFI_SUCCESS The platform hook completes successfully.=0D + @retval Other values The platform hook cannot complete due to some = error.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PlatformHookBeforeMmDispatch (=0D + VOID=0D + );=0D +=0D +/**=0D + Performs platform specific tasks after invoking registered MMI handlers.= =0D +=0D + This function performs platform specific tasks after invoking registered= MMI handlers.=0D +=0D + @retval EFI_SUCCESS The platform hook completes successfully.=0D + @retval Other values The platform hook cannot complete due to some = error.=0D +=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PlatformHookAfterMmDispatch (=0D + VOID=0D + );=0D +=0D +#endif=0D diff --git a/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/St= andaloneMmCorePlatformHookLibNull.inf b/StandaloneMmPkg/Library/StandaloneM= mCorePlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf new file mode 100644 index 000000000000..917f2983c938 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/Standalon= eMmCorePlatformHookLibNull.inf @@ -0,0 +1,30 @@ +## @file=0D +# Standalone MM Core Platform Hook NULL Library instance.=0D +#=0D +# Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D StandaloneMmCorePlatformHookLibNull=0D + FILE_GUID =3D A5924660-072B-4188-A850-C45FBED9FCE0= =0D + MODULE_TYPE =3D MM_CORE_STANDALONE=0D + VERSION_STRING =3D 1.0=0D + PI_SPECIFICATION_VERSION =3D 0x00010032=0D + LIBRARY_CLASS =3D StandaloneMmCorePlatformHookLib|MM_CO= RE_STANDALONE=0D +=0D +#=0D +# The following information is for reference only and not required by the = build tools.=0D +#=0D +# VALID_ARCHITECTURES =3D IA32 X64=0D +#=0D +=0D +[Sources]=0D + StandaloneMmCorePlatformHookLibNull.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + StandaloneMmPkg/StandaloneMmPkg.dec=0D diff --git a/StandaloneMmPkg/StandaloneMmPkg.dec b/StandaloneMmPkg/Standalo= neMmPkg.dec index 46784d94e421..1e847ebd0635 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dec +++ b/StandaloneMmPkg/StandaloneMmPkg.dec @@ -29,6 +29,10 @@ [LibraryClasses] ## MM Memory Operation.=0D MemLib|Include/Library/StandaloneMmMemLib.h=0D =0D + ## @libraryclass Defines a set of platform hooks called by the Standal= one=0D + ## Mm Core.=0D + StandaloneMmCorePlatformHookLib|Include/Library/StandaloneMmCorePlatform= HookLib.h=0D +=0D [LibraryClasses.AArch64, LibraryClasses.ARM]=0D ## @libraryclass Defines a set of interfaces for the MM core entrypoin= t for=0D ## AArch64 and ARM.=0D diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/Standalo= neMmPkg.dsc index 8012f93b7dcc..bfa1760f8e6f 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dsc +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc @@ -72,6 +72,7 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM] =0D [LibraryClasses.common.MM_CORE_STANDALONE]=0D HobLib|StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHo= bLib.inf=0D + StandaloneMmCorePlatformHookLib|StandaloneMmPkg/Library/StandaloneMmCore= PlatformHookLibNull/StandaloneMmCorePlatformHookLibNull.inf=0D =0D [LibraryClasses.common.MM_STANDALONE]=0D MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocation= Lib/StandaloneMmMemoryAllocationLib.inf=0D @@ -117,6 +118,7 @@ [Components.common] StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf=0D StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemo= ryAllocationLib.inf=0D StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf=0D + StandaloneMmPkg/Library/StandaloneMmCorePlatformHookLibNull/StandaloneMm= CorePlatformHookLibNull.inf=0D =0D [Components.AARCH64, Components.ARM]=0D StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf=0D --=20 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-