Always install the SmmAccessPpi without checking S3 boot mode. The caller can add the S3 check to decide if it is need to install the Ppi
Signed-off-by: Guomin Jiang <guomin.ji...@intel.com> Cc: Ray Ni <ray...@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaga...@intel.com> --- .../PeiSmmAccessLib/PeiSmmAccessLib.inf | 40 ++++++++----------- .../Library/PeiSmmAccessLib/PeiSmmAccessLib.c | 16 +------- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf index 0c2411ea57c8..8cf6d7923398 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf @@ -1,41 +1,35 @@ ## @file # Library description file for the SmmAccess # -# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## - [Defines] -INF_VERSION = 0x00010017 -BASE_NAME = PeiSmmAccessLib -FILE_GUID = 54020881-B594-442A-8377-A57AFF98C7CF -VERSION_STRING = 1.0 -MODULE_TYPE = PEIM -LIBRARY_CLASS = SmmAccessLib - + INF_VERSION = 0x00010017 + BASE_NAME = PeiSmmAccessLib + FILE_GUID = 54020881-B594-442A-8377-A57AFF98C7CF + VERSION_STRING = 1.0 + MODULE_TYPE = PEIM + LIBRARY_CLASS = SmmAccessLib [LibraryClasses] -BaseLib -BaseMemoryLib -HobLib -PciSegmentLib -PeiServicesLib - + BaseLib + BaseMemoryLib + HobLib + PciSegmentLib + PeiServicesLib [Packages] -MdePkg/MdePkg.dec -IntelSiliconPkg/IntelSiliconPkg.dec - + MdePkg/MdePkg.dec + IntelSiliconPkg/IntelSiliconPkg.dec [Sources] -PeiSmmAccessLib.c - + PeiSmmAccessLib.c [Ppis] -gEfiPeiMmAccessPpiGuid ## PRODUCES - + gEfiPeiMmAccessPpiGuid ## PRODUCES [Guids] -gEfiSmmSmramMemoryGuid + gEfiSmmSmramMemoryGuid diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c index d9bf4fba983e..0e3f230e413e 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c @@ -1,7 +1,7 @@ /** @file This is to publish the SMM Access Ppi instance. - Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -234,7 +234,7 @@ GetCapabilities ( /** This function is to install an SMM Access PPI - <b>Introduction</b> \n - An API to install an instance of EFI_PEI_MM_ACCESS_PPI. This PPI is commonly used to control SMM mode memory access for S3 resume. + An API to install an instance of EFI_PEI_MM_ACCESS_PPI. @retval EFI_SUCCESS - Ppi successfully started and installed. @retval EFI_NOT_FOUND - Ppi can't be found. @@ -252,19 +252,7 @@ PeiInstallSmmAccessPpi ( EFI_SMRAM_HOB_DESCRIPTOR_BLOCK *DescriptorBlock; SMM_ACCESS_PRIVATE_DATA *SmmAccessPrivate; VOID *HobList; - EFI_BOOT_MODE BootMode; - Status = PeiServicesGetBootMode (&BootMode); - if (EFI_ERROR (Status)) { - // - // If not in S3 boot path. do nothing - // - return EFI_SUCCESS; - } - - if (BootMode != BOOT_ON_S3_RESUME) { - return EFI_SUCCESS; - } // // Initialize private data // -- 2.30.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81746): https://edk2.groups.io/g/devel/message/81746 Mute This Topic: https://groups.io/mt/86232239/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-