Skip to content

Commit

Permalink
Silicon/Intel: Support MM_STANDALONE for SmmSpiFlashCommonLib
Browse files Browse the repository at this point in the history
Signed-off-by: Ray Ni <[email protected]>
Co-authored-by: Jiaxin Wu <[email protected]>
  • Loading branch information
jiaxinwu authored and niruiyu committed Jun 28, 2024
1 parent 3b02f39 commit 959fdd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/** @file
SMM Library instance of SPI Flash Common Library Class
Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.<BR>
Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <Library/SmmServicesTableLib.h>
#include <Library/MmServicesTableLib.h>
#include <Protocol/Spi2.h>
#include <Library/DebugLib.h>

Expand All @@ -33,8 +33,7 @@ extern UINTN mBiosOffset;
EFI_STATUS
EFIAPI
SmmSpiFlashCommonLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
VOID
)
{
EFI_STATUS Status;
Expand All @@ -47,7 +46,7 @@ SmmSpiFlashCommonLibConstructor (
//
// Locate the SMM SPI2 protocol.
//
Status = gSmst->SmmLocateProtocol (
Status = gMmst->MmLocateProtocol (
&gPchSmmSpi2ProtocolGuid,
NULL,
(VOID **) &mSpi2Protocol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @file
# SMM Library instance of Spi Flash Common Library Class
#
# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2021 - 2024, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand All @@ -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.
Expand All @@ -26,8 +26,7 @@
DebugLib
IoLib
MemoryAllocationLib
SmmServicesTableLib
UefiLib
MmServicesTableLib

[Packages]
MdePkg/MdePkg.dec
Expand All @@ -49,3 +48,6 @@

[Depex.X64.DXE_SMM_DRIVER]
gPchSmmSpi2ProtocolGuid

[Depex.X64.MM_STANDALONE]
gPchSmmSpi2ProtocolGuid

0 comments on commit 959fdd7

Please sign in to comment.