]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: MmCommunication: Added definition of MM Communication PPI
authorKun Qin <kuqin12@gmail.com>
Thu, 16 Sep 2021 00:14:18 +0000 (08:14 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 30 Sep 2021 01:47:50 +0000 (01:47 +0000)
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>
MdePkg/Include/Ppi/MmCommunication.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Ppi/MmCommunication.h b/MdePkg/Include/Ppi/MmCommunication.h
new file mode 100644 (file)
index 0000000..7e06da2
--- /dev/null
@@ -0,0 +1,72 @@
+/** @file\r
+  EFI MM Communication PPI definition.\r
+\r
+  This PPI provides a means of communicating between drivers outside\r
+  of MM and MMI handlers inside of MM in PEI phase.\r
+\r
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) Microsoft Corporation.\r
+\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+\r
+#ifndef MM_COMMUNICATION_PPI_H_\r
+#define MM_COMMUNICATION_PPI_H_\r
+\r
+#define EFI_PEI_MM_COMMUNICATION_PPI_GUID \\r
+  { \\r
+    0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } \\r
+  }\r
+\r
+typedef struct _EFI_PEI_MM_COMMUNICATION_PPI  EFI_PEI_MM_COMMUNICATION_PPI;\r
+\r
+/**\r
+  Communicates with a registered handler.\r
+\r
+  This function provides a service to send and receive messages from a registered PEI service.\r
+  The EFI_PEI_MM_COMMUNICATION_PPI driver is responsible for doing any of the copies such that\r
+  the data lives in PEI-service-accessible RAM.\r
+\r
+  A given implementation of the EFI_PEI_MM_COMMUNICATION_PPI may choose to use the\r
+  EFI_MM_CONTROL_PPI for effecting the mode transition, or it may use some other method.\r
+\r
+  The agent invoking the communication interface must be physical/virtually 1:1 mapped.\r
+\r
+  To avoid confusion in interpreting frames, the CommBuffer parameter should always begin with\r
+  EFI_MM_COMMUNICATE_HEADER. The header data is mandatory for messages sent into the MM agent.\r
+\r
+  Once inside of MM, the MM infrastructure will call all registered handlers with the same\r
+  HandlerType as the GUID specified by HeaderGuid and the CommBuffer pointing to Data.\r
+\r
+  This function is not reentrant.\r
+\r
+  @param[in] This                 The EFI_PEI_MM_COMMUNICATION_PPI instance.\r
+  @param[in] CommBuffer           Pointer to the buffer to convey into MMRAM.\r
+  @param[in] CommSize             The size of the data buffer being passed in. On exit, the\r
+                                  size of data being returned. Zero if the handler does not\r
+                                  wish to reply with any data.\r
+\r
+  @retval EFI_SUCCESS             The message was successfully posted.\r
+  @retval EFI_INVALID_PARAMETER   The buffer was NULL.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_MM_COMMUNICATE)(\r
+  IN CONST EFI_PEI_MM_COMMUNICATION_PPI     *This,\r
+  IN OUT VOID                               *CommBuffer,\r
+  IN OUT UINTN                              *CommSize\r
+  );\r
+\r
+///\r
+/// EFI MM Communication PPI provides services for communicating between PEIM and a registered\r
+/// MMI handler.\r
+///\r
+struct _EFI_PEI_MM_COMMUNICATION_PPI {\r
+  EFI_PEI_MM_COMMUNICATE  Communicate;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiMmCommunicationPpiGuid;\r
+\r
+#endif\r
index a28a2daaffa8166d41f89d42337e7c8e5b0f65c9..9cdc915ebae94fa246c3883db5627819079add7e 100644 (file)
   ## Include/Ppi/MmConfiguration.h\r
   gEfiPeiMmConfigurationPpi       =  { 0xc109319, 0xc149, 0x450e, { 0xa3, 0xe3, 0xb9, 0xba, 0xdd, 0x9d, 0xc3, 0xa4 } }\r
 \r
+  ## Include/Ppi/MmCommunication.h\r
+  gEfiPeiMmCommunicationPpiGuid   =  { 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } }\r
+\r
   #\r
   # PPIs defined in PI 1.7.\r
   #\r