\r
#include <Protocol/SmmBase2.h>\r
#include <Protocol/SmmCommunication.h>\r
+#include <Protocol/MmCommunication2.h>\r
#include <Protocol/SmmAccess2.h>\r
#include <Protocol/SmmConfiguration.h>\r
#include <Protocol/SmmControl2.h>\r
IN OUT UINTN *CommSize OPTIONAL\r
);\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 The CommBuffer 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
+EFI_STATUS\r
+EFIAPI\r
+SmmCommunicationMmCommunicate2 (\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
Event notification that is fired every time a gEfiSmmConfigurationProtocol installs.\r
\r
SmmCommunicationCommunicate\r
};\r
\r
+//\r
+// PI 1.7 MM Communication Protocol 2 instance\r
+//\r
+EFI_MM_COMMUNICATION2_PROTOCOL mMmCommunication2 = {\r
+ SmmCommunicationMmCommunicate2\r
+};\r
+\r
//\r
// SMM Core Private Data structure that contains the data shared between\r
// the SMM IPL and the SMM Core.\r
return (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;\r
}\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 The CommBuffer 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
+EFI_STATUS\r
+EFIAPI\r
+SmmCommunicationMmCommunicate2 (\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
+ return SmmCommunicationCommunicate (&mSmmCommunication,\r
+ CommBufferPhysical,\r
+ CommSize);\r
+}\r
+\r
/**\r
Event notification that is fired when GUIDed Event Group is signaled.\r
\r
&mSmmIplHandle,\r
&gEfiSmmBase2ProtocolGuid, &mSmmBase2,\r
&gEfiSmmCommunicationProtocolGuid, &mSmmCommunication,\r
+ &gEfiMmCommunication2ProtocolGuid, &mMmCommunication2,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r