]>
Commit | Line | Data |
---|---|---|
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 | |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef _MM_COMMUNICATION_H_\r | |
19 | #define _MM_COMMUNICATION_H_\r | |
20 | \r | |
21 | #pragma pack(1)\r | |
22 | \r | |
23 | ///\r | |
24 | /// To avoid confusion in interpreting frames, the communication buffer should always\r | |
25 | /// begin with EFI_MM_COMMUNICATE_HEADER\r | |
26 | ///\r | |
27 | typedef struct {\r | |
28 | ///\r | |
29 | /// Allows for disambiguation of the message format.\r | |
30 | ///\r | |
31 | EFI_GUID HeaderGuid;\r | |
32 | ///\r | |
33 | /// Describes the size of Data (in bytes) and does not include the size of the header.\r | |
34 | ///\r | |
35 | UINTN MessageLength;\r | |
36 | ///\r | |
37 | /// Designates an array of bytes that is MessageLength in size.\r | |
38 | ///\r | |
39 | UINT8 Data[1];\r | |
40 | } EFI_MM_COMMUNICATE_HEADER;\r | |
41 | \r | |
42 | #pragma pack()\r | |
43 | \r | |
44 | #define EFI_MM_COMMUNICATION_PROTOCOL_GUID \\r | |
45 | { \\r | |
46 | 0xc68ed8e2, 0x9dc6, 0x4cbd, { 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32 } \\r | |
47 | }\r | |
48 | \r | |
49 | typedef struct _EFI_MM_COMMUNICATION_PROTOCOL EFI_MM_COMMUNICATION_PROTOCOL;\r | |
50 | \r | |
51 | /**\r | |
52 | Communicates with a registered handler.\r | |
53 | \r | |
54 | This function provides a service to send and receive messages from a registered UEFI service.\r | |
55 | \r | |
56 | @param[in] This The EFI_MM_COMMUNICATION_PROTOCOL instance.\r | |
57 | @param[in] CommBuffer A pointer to the buffer to convey into MMRAM.\r | |
58 | @param[in] CommSize The size of the data buffer being passed in.On exit, the size of data\r | |
59 | being returned. Zero if the handler does not wish to reply with any data.\r | |
60 | \r | |
61 | @retval EFI_SUCCESS The message was successfully posted.\r | |
62 | @retval EFI_INVALID_PARAMETER The CommBuffer was NULL.\r | |
63 | **/\r | |
64 | typedef\r | |
65 | EFI_STATUS\r | |
66 | (EFIAPI *EFI_MM_COMMUNICATE)(\r | |
67 | IN CONST EFI_MM_COMMUNICATION_PROTOCOL *This,\r | |
68 | IN OUT VOID *CommBuffer,\r | |
69 | IN OUT UINTN *CommSize\r | |
70 | );\r | |
71 | \r | |
72 | ///\r | |
73 | /// EFI MM Communication Protocol provides runtime services for communicating\r | |
74 | /// between DXE drivers and a registered MMI handler.\r | |
75 | ///\r | |
76 | struct _EFI_MM_COMMUNICATION_PROTOCOL {\r | |
77 | EFI_MM_COMMUNICATE Communicate;\r | |
78 | };\r | |
79 | \r | |
80 | extern EFI_GUID gEfiMmCommunicationProtocolGuid;\r | |
81 | \r | |
82 | #endif\r | |
83 | \r |