]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/MmCommunication.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / MmCommunication.h
CommitLineData
07c6a47e
ED
1/** @file\r
2 EFI MM Communication Protocol as defined in the PI 1.5 specification.\r
3\r
4 This protocol provides a means of communicating between drivers outside of MM and MMI\r
5 handlers inside of MM.\r
6\r
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
9344f092 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
07c6a47e
ED
9\r
10**/\r
11\r
12#ifndef _MM_COMMUNICATION_H_\r
13#define _MM_COMMUNICATION_H_\r
14\r
15#pragma pack(1)\r
16\r
17///\r
18/// To avoid confusion in interpreting frames, the communication buffer should always\r
19/// begin with EFI_MM_COMMUNICATE_HEADER\r
20///\r
21typedef struct {\r
22 ///\r
23 /// Allows for disambiguation of the message format.\r
24 ///\r
25 EFI_GUID HeaderGuid;\r
26 ///\r
27 /// Describes the size of Data (in bytes) and does not include the size of the header.\r
28 ///\r
29 UINTN MessageLength;\r
30 ///\r
31 /// Designates an array of bytes that is MessageLength in size.\r
32 ///\r
33 UINT8 Data[1];\r
34} EFI_MM_COMMUNICATE_HEADER;\r
35\r
36#pragma pack()\r
37\r
38#define EFI_MM_COMMUNICATION_PROTOCOL_GUID \\r
39 { \\r
40 0xc68ed8e2, 0x9dc6, 0x4cbd, { 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32 } \\r
41 }\r
42\r
43typedef struct _EFI_MM_COMMUNICATION_PROTOCOL EFI_MM_COMMUNICATION_PROTOCOL;\r
44\r
45/**\r
46 Communicates with a registered handler.\r
47\r
48 This function provides a service to send and receive messages from a registered UEFI service.\r
49\r
50 @param[in] This The EFI_MM_COMMUNICATION_PROTOCOL instance.\r
51 @param[in] CommBuffer A pointer to the buffer to convey into MMRAM.\r
c53190e9 52 @param[in] CommSize The size of the data buffer being passed in. On exit, the size of data\r
07c6a47e 53 being returned. Zero if the handler does not wish to reply with any data.\r
c53190e9 54 This parameter is optional and may be NULL.\r
07c6a47e
ED
55\r
56 @retval EFI_SUCCESS The message was successfully posted.\r
57 @retval EFI_INVALID_PARAMETER The CommBuffer was NULL.\r
c53190e9
SZ
58 @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM implementation.\r
59 If this error is returned, the MessageLength field\r
60 in the CommBuffer header or the integer pointed by\r
61 CommSize, are updated to reflect the maximum payload\r
62 size the implementation can accommodate.\r
63 @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommSize parameter,\r
64 if not omitted, are in address range that cannot be\r
65 accessed by the MM environment.\r
66\r
07c6a47e
ED
67**/\r
68typedef\r
69EFI_STATUS\r
70(EFIAPI *EFI_MM_COMMUNICATE)(\r
71 IN CONST EFI_MM_COMMUNICATION_PROTOCOL *This,\r
72 IN OUT VOID *CommBuffer,\r
c53190e9 73 IN OUT UINTN *CommSize OPTIONAL\r
07c6a47e
ED
74 );\r
75\r
76///\r
77/// EFI MM Communication Protocol provides runtime services for communicating\r
78/// between DXE drivers and a registered MMI handler.\r
79///\r
80struct _EFI_MM_COMMUNICATION_PROTOCOL {\r
81 EFI_MM_COMMUNICATE Communicate;\r
82};\r
83\r
84extern EFI_GUID gEfiMmCommunicationProtocolGuid;\r
85\r
86#endif\r
87\r