From eef29d5100b4f4879d8280f5074ccc00e5067e01 Mon Sep 17 00:00:00 2001 From: Dun Tan Date: Wed, 12 Jun 2024 10:59:53 +0800 Subject: [PATCH] StandaloneMmPkg: Add a new MmCommunicationDxe driver Add a new MmCommunicationDxe driver. The driver is to: 1.Install gEfiMmCommunication2ProtocolGuid 2.Install gEfiMmCommunicationProtocolGuid 3.Create the notifications of some protocols and event that the Standalone Mm requires Signed-off-by: Dun Tan --- .../MmCommunicationDxe/MmCommunicationDxe.c | 30 +++++++++++++++ .../MmCommunicationDxe/MmCommunicationDxe.h | 11 ++++++ .../MmCommunicationDxe/MmCommunicationDxe.inf | 37 +++++++++++++++++++ StandaloneMmPkg/StandaloneMmPkg.dsc | 11 ++++++ 4 files changed, 89 insertions(+) create mode 100644 StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c create mode 100644 StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h create mode 100644 StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf diff --git a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c new file mode 100644 index 0000000000..a985d9b803 --- /dev/null +++ b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c @@ -0,0 +1,30 @@ +/** @file + MmCommunicationDxe driver produces MmCommunication protocol and + create the notifications of some protocols and event. + + Copyright (c) 2024, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "MmCommunicationDxe.h" + +/** + The Entry Point for MmCommunicateDxe driver. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval Other Some error occurred when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +MmCommunicationEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return EFI_SUCCESS; +} diff --git a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h new file mode 100644 index 0000000000..1e98aa1e8b --- /dev/null +++ b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h @@ -0,0 +1,11 @@ +/** @file + + Copyright (c) 2024, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef MM_COMMUNICATION_DXE_H_ +#define MM_COMMUNICATION_DXE_H_ + +#endif diff --git a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf new file mode 100644 index 0000000000..acfc5e433c --- /dev/null +++ b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf @@ -0,0 +1,37 @@ +## @file +# MmCommunicationDxe driver produces MmCommunication protocol and +# create the notifications of some protocols and event. +# +# Copyright (c) 2024, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001A + BASE_NAME = MmCommunicationDxe + FILE_GUID = 8d4b8bc7-e66b-4be2-add8-4988e08743ed + MODULE_TYPE = DXE_RUNTIME_DRIVER + VERSION_STRING = 1.0 + PI_SPECIFICATION_VERSION = 0x00010032 + ENTRY_POINT = MmCommunicationEntryPoint + +[Sources] + MmCommunicationDxe.c + MmCommunicationDxe.h + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiCpuPkg/UefiCpuPkg.dec + StandaloneMmPkg/StandaloneMmPkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + +[Guids] + +[Protocols] + +[Depex] diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc index fc2c12447d..20a05d0ebf 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dsc +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc @@ -78,6 +78,16 @@ [LibraryClasses.common.MM_STANDALONE] MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf +[LibraryClasses.common.DXE_RUNTIME_DRIVER] + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + ################################################################################ # # Pcd Section - list of all EDK II PCD Entries defined by this Platform @@ -121,6 +131,7 @@ StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf StandaloneMmPkg/Library/SmmLockBoxMmDependency/SmmLockBoxMmDependency.inf StandaloneMmPkg/Library/MmPlatformHobProducerLibNull/MmPlatformHobProducerLibNull.inf + StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf [Components.AARCH64, Components.ARM] StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf