summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorKun Qin <kuqin12@gmail.com>2021-09-16 08:14:18 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-09-30 01:47:50 +0000
commitf86de75862c20077aa9e7dbe71c9c9182d783d5f (patch)
treebb5d9bf73cb7024f1d68fb18899fb05c6286039f /MdePkg
parentbd298d75934a7a0cf6b9e2863a5e4975e9714285 (diff)
downloadedk2-f86de75862c20077aa9e7dbe71c9c9182d783d5f.tar.gz
edk2-f86de75862c20077aa9e7dbe71c9c9182d783d5f.tar.bz2
edk2-f86de75862c20077aa9e7dbe71c9c9182d783d5f.zip
MdePkg: MmCommunication: Added definition of MM Communication PPI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629 MM Communication PPI was defined in PI Specification since v1.5. This change added definition of such PPI and related GUIDs into MdePkg. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Ppi/MmCommunication.h72
-rw-r--r--MdePkg/MdePkg.dec3
2 files changed, 75 insertions, 0 deletions
diff --git a/MdePkg/Include/Ppi/MmCommunication.h b/MdePkg/Include/Ppi/MmCommunication.h
new file mode 100644
index 0000000000..7e06da2ec0
--- /dev/null
+++ b/MdePkg/Include/Ppi/MmCommunication.h
@@ -0,0 +1,72 @@
+/** @file
+ EFI MM Communication PPI definition.
+
+ This PPI provides a means of communicating between drivers outside
+ of MM and MMI handlers inside of MM in PEI phase.
+
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) Microsoft Corporation.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+
+#ifndef MM_COMMUNICATION_PPI_H_
+#define MM_COMMUNICATION_PPI_H_
+
+#define EFI_PEI_MM_COMMUNICATION_PPI_GUID \
+ { \
+ 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } \
+ }
+
+typedef struct _EFI_PEI_MM_COMMUNICATION_PPI EFI_PEI_MM_COMMUNICATION_PPI;
+
+/**
+ Communicates with a registered handler.
+
+ This function provides a service to send and receive messages from a registered PEI service.
+ The EFI_PEI_MM_COMMUNICATION_PPI driver is responsible for doing any of the copies such that
+ the data lives in PEI-service-accessible RAM.
+
+ A given implementation of the EFI_PEI_MM_COMMUNICATION_PPI may choose to use the
+ EFI_MM_CONTROL_PPI for effecting the mode transition, or it may use some other method.
+
+ The agent invoking the communication interface must be physical/virtually 1:1 mapped.
+
+ To avoid confusion in interpreting frames, the CommBuffer parameter should always begin with
+ EFI_MM_COMMUNICATE_HEADER. The header data is mandatory for messages sent into the MM agent.
+
+ Once inside of MM, the MM infrastructure will call all registered handlers with the same
+ HandlerType as the GUID specified by HeaderGuid and the CommBuffer pointing to Data.
+
+ This function is not reentrant.
+
+ @param[in] This The EFI_PEI_MM_COMMUNICATION_PPI instance.
+ @param[in] CommBuffer Pointer to the buffer to convey into MMRAM.
+ @param[in] CommSize The size of the data buffer being passed in. On exit, the
+ size of data being returned. Zero if the handler does not
+ wish to reply with any data.
+
+ @retval EFI_SUCCESS The message was successfully posted.
+ @retval EFI_INVALID_PARAMETER The buffer was NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_MM_COMMUNICATE)(
+ IN CONST EFI_PEI_MM_COMMUNICATION_PPI *This,
+ IN OUT VOID *CommBuffer,
+ IN OUT UINTN *CommSize
+ );
+
+///
+/// EFI MM Communication PPI provides services for communicating between PEIM and a registered
+/// MMI handler.
+///
+struct _EFI_PEI_MM_COMMUNICATION_PPI {
+ EFI_PEI_MM_COMMUNICATE Communicate;
+};
+
+extern EFI_GUID gEfiPeiMmCommunicationPpiGuid;
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index a28a2daaff..9cdc915eba 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -991,6 +991,9 @@
## Include/Ppi/MmConfiguration.h
gEfiPeiMmConfigurationPpi = { 0xc109319, 0xc149, 0x450e, { 0xa3, 0xe3, 0xb9, 0xba, 0xdd, 0x9d, 0xc3, 0xa4 } }
+ ## Include/Ppi/MmCommunication.h
+ gEfiPeiMmCommunicationPpiGuid = { 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } }
+
#
# PPIs defined in PI 1.7.
#