]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Ppi/MmCommunication.h
MdePkg: MmCommunication: Added definition of MM Communication PPI
[mirror_edk2.git] / MdePkg / Include / Ppi / MmCommunication.h
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