diff --git a/UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h b/MdePkg/Include/Library/SmmCpuRendezvousLib.h similarity index 100% rename from UefiCpuPkg/Include/Library/SmmCpuRendezvousLib.h rename to MdePkg/Include/Library/SmmCpuRendezvousLib.h diff --git a/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c new file mode 100644 index 0000000000..474195bbb3 --- /dev/null +++ b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.c @@ -0,0 +1,29 @@ +/** @file + SMM CPU Rendezvous sevice implement. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + This routine wait for all AP processors to arrive in SMM. + + @param[in] BlockingMode Blocking mode or non-blocking mode. + + @retval EFI_SUCCESS All avaiable APs arrived. + @retval EFI_TIMEOUT Wait for all APs until timeout. + @retval OTHER Fail to register SMM CPU Rendezvous service Protocol. +**/ +EFI_STATUS +EFIAPI +SmmWaitForAllProcessor ( + IN BOOLEAN BlockingMode + ) +{ + ASSERT (FALSE); + return EFI_SUCCESS; +} diff --git a/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf new file mode 100644 index 0000000000..7c9bac9af2 --- /dev/null +++ b/MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf @@ -0,0 +1,26 @@ +## @file +# SMM CPU Rendezvous service lib. +# +# This is SMM CPU rendezvous service lib that wait for all +# APs to enter SMM mode. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = SmmCpuRendezvousLibNull + FILE_GUID = 1e5790ea-d013-4d7b-9047-b4342a762027 + MODULE_TYPE = DXE_SMM_DRIVER + LIBRARY_CLASS = SmmCpuRendezvousLib|MM_STANDALONE DXE_SMM_DRIVER + +[Sources] + SmmCpuRendezvousLibNull.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib diff --git a/MdePkg/MdeLibs.dsc.inc b/MdePkg/MdeLibs.dsc.inc index 015ce46f7d..fc6f385b30 100644 --- a/MdePkg/MdeLibs.dsc.inc +++ b/MdePkg/MdeLibs.dsc.inc @@ -5,7 +5,7 @@ # by using "!include MdePkg/MdeLibs.dsc.inc" to specify the library instances # of some EDKII basic/common library classes. # -# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2021 - 2022, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -14,3 +14,4 @@ [LibraryClasses] RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf + SmmCpuRendezvousLib|MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index faeb28c80c..f1ebf9e251 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -4,7 +4,7 @@ # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of # EFI1.10/UEFI2.7/PI1.7 and some Industry Standards. # -# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
# (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
# @@ -272,6 +272,9 @@ # CcProbeLib|Include/Library/CcProbeLib.h + ## @libraryclass Provides function for SMM CPU Rendezvous Library. + SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h + [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64] ## @libraryclass Provides services to generate random number. # diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index c8d282882e..3d8874e647 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -1,7 +1,7 @@ ## @file # EFI/PI MdePkg Package # -# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
# @@ -131,6 +131,7 @@ MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf + MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf [Components.IA32, Components.X64, Components.ARM, Components.AARCH64] # diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 525cde4634..1951eb294c 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -62,9 +62,6 @@ ## @libraryclass Provides function for loading microcode. MicrocodeLib|Include/Library/MicrocodeLib.h - ## @libraryclass Provides function for SMM CPU Rendezvous Library. - SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h - [Guids] gUefiCpuPkgTokenSpaceGuid = { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }} gMsegSmramGuid = { 0x5802bce4, 0xeeee, 0x4e33, { 0xa1, 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }}