From 959fdd71711db7470034618549293608c5096440 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Sat, 22 Jun 2024 13:50:48 +0800 Subject: [PATCH] Silicon/Intel: Support MM_STANDALONE for SmmSpiFlashCommonLib Signed-off-by: Ray Ni Co-authored-by: Jiaxin Wu --- .../SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.c | 9 ++++----- .../SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf | 12 +++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.c b/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.c index c4c08cac127..37f79a91f20 100644 --- a/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.c @@ -1,13 +1,13 @@ /** @file SMM Library instance of SPI Flash Common Library Class - Copyright (c) 2021, Intel Corporation. All rights reserved.
+ Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#include +#include #include #include @@ -33,8 +33,7 @@ extern UINTN mBiosOffset; EFI_STATUS EFIAPI SmmSpiFlashCommonLibConstructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ) { EFI_STATUS Status; @@ -47,7 +46,7 @@ SmmSpiFlashCommonLibConstructor ( // // Locate the SMM SPI2 protocol. // - Status = gSmst->SmmLocateProtocol ( + Status = gMmst->MmLocateProtocol ( &gPchSmmSpi2ProtocolGuid, NULL, (VOID **) &mSpi2Protocol diff --git a/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf b/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf index 4227d213886..650144228cc 100644 --- a/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf +++ b/Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf @@ -1,7 +1,7 @@ ## @file # SMM Library instance of Spi Flash Common Library Class # -# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -11,8 +11,8 @@ BASE_NAME = SmmSpiFlashCommonLib FILE_GUID = 99721728-C39D-4600-BD38-71E8238FEEF2 VERSION_STRING = 1.0 - MODULE_TYPE = DXE_SMM_DRIVER - LIBRARY_CLASS = SpiFlashCommonLib|DXE_SMM_DRIVER + MODULE_TYPE = BASE + LIBRARY_CLASS = SpiFlashCommonLib|DXE_SMM_DRIVER MM_STANDALONE CONSTRUCTOR = SmmSpiFlashCommonLibConstructor # # The following information is for reference only and not required by the build tools. @@ -26,8 +26,7 @@ DebugLib IoLib MemoryAllocationLib - SmmServicesTableLib - UefiLib + MmServicesTableLib [Packages] MdePkg/MdePkg.dec @@ -49,3 +48,6 @@ [Depex.X64.DXE_SMM_DRIVER] gPchSmmSpi2ProtocolGuid + +[Depex.X64.MM_STANDALONE] + gPchSmmSpi2ProtocolGuid