]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: introduce MM communicate 2 protocol
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Sat, 18 Apr 2020 16:44:52 +0000 (18:44 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 12 May 2020 19:23:44 +0000 (19:23 +0000)
Add the protocol definition of the MM communicate 2 protocol,
which has been introduced by version 1.7 errata A of the PI spec.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
MdePkg/Include/Protocol/MmCommunication2.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/MmCommunication2.h b/MdePkg/Include/Protocol/MmCommunication2.h
new file mode 100644 (file)
index 0000000..05f56dc
--- /dev/null
@@ -0,0 +1,69 @@
+/** @file\r
+  EFI MM Communication Protocol 2 as defined in the PI 1.7 errata A specification.\r
+\r
+  This protocol provides a means of communicating between drivers outside of MM and MMI\r
+  handlers inside of MM.\r
+\r
+  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2019, Arm Limited. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _MM_COMMUNICATION2_H_\r
+#define _MM_COMMUNICATION2_H_\r
+\r
+#include <Protocol/MmCommunication.h>\r
+\r
+#define EFI_MM_COMMUNICATION2_PROTOCOL_GUID \\r
+  { \\r
+    0x378daedc, 0xf06b, 0x4446, { 0x83, 0x14, 0x40, 0xab, 0x93, 0x3c, 0x87, 0xa3 } \\r
+  }\r
+\r
+typedef struct _EFI_MM_COMMUNICATION2_PROTOCOL  EFI_MM_COMMUNICATION2_PROTOCOL;\r
+\r
+/**\r
+  Communicates with a registered handler.\r
+\r
+  This function provides a service to send and receive messages from a registered UEFI service.\r
+\r
+  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.\r
+  @param[in] CommBufferPhysical  Physical address of the MM communication buffer\r
+  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer\r
+  @param[in] CommSize            The size of the data buffer being passed in. On exit, the size of data\r
+                                 being returned. Zero if the handler does not wish to reply with any data.\r
+                                 This parameter is optional and may be NULL.\r
+\r
+  @retval EFI_SUCCESS            The message was successfully posted.\r
+  @retval EFI_INVALID_PARAMETER  CommBufferPhysical was NULL or CommBufferVirtual was NULL.\r
+  @retval EFI_BAD_BUFFER_SIZE    The buffer is too large for the MM implementation.\r
+                                 If this error is returned, the MessageLength field\r
+                                 in the CommBuffer header or the integer pointed by\r
+                                 CommSize, are updated to reflect the maximum payload\r
+                                 size the implementation can accommodate.\r
+  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,\r
+                                 if not omitted, are in address range that cannot be\r
+                                 accessed by the MM environment.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MM_COMMUNICATE2)(\r
+  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,\r
+  IN OUT VOID                               *CommBufferPhysical,\r
+  IN OUT VOID                               *CommBufferVirtual,\r
+  IN OUT UINTN                              *CommSize OPTIONAL\r
+  );\r
+\r
+///\r
+/// EFI MM Communication Protocol provides runtime services for communicating\r
+/// between DXE drivers and a registered MMI handler.\r
+///\r
+struct _EFI_MM_COMMUNICATION2_PROTOCOL {\r
+  EFI_MM_COMMUNICATE2  Communicate;\r
+};\r
+\r
+extern EFI_GUID gEfiMmCommunication2ProtocolGuid;\r
+\r
+#endif\r
+\r
index 0b9c4bc40aced659fb5c32452f3c399ed096aa12..86545ac9b7351a4cbe7f787484c7a436f2fc19ba 100644 (file)
   ## Include/Protocol/SpiSmmNorFlash.h\r
   gEfiSpiSmmNorFlashProtocolGuid         = { 0xaab18f19, 0xfe14, 0x4666, { 0x86, 0x04, 0x87, 0xff, 0x6d, 0x66, 0x2c, 0x9a }}\r
 \r
+  #\r
+  # Protocols defined in PI 1.7.\r
+  #\r
+\r
+  ## Include/Protocol/MmCommunication2.h\r
+  gEfiMmCommunication2ProtocolGuid  = { 0x378daedc, 0xf06b, 0x4446, { 0x83, 0x14, 0x40, 0xab, 0x93, 0x3c, 0x87, 0xa3 }}\r
+\r
   #\r
   # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1\r
   #\r