Subrata Banik | 20fe24b | 2021-12-09 02:46:38 +0530 | [diff] [blame] | 1 | /** @file |
| 2 | EFI MM Communication Protocol 2 as defined in the PI 1.7 errata A specification. |
| 3 | |
| 4 | This protocol provides a means of communicating between drivers outside of MM and MMI |
| 5 | handlers inside of MM. |
| 6 | |
| 7 | Copyright (c) 2017, Intel Corporation. All rights reserved.<BR> |
| 8 | Copyright (c) 2019, Arm Limited. All rights reserved.<BR> |
| 9 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 10 | |
| 11 | **/ |
| 12 | |
| 13 | #ifndef _MM_COMMUNICATION2_H_ |
| 14 | #define _MM_COMMUNICATION2_H_ |
| 15 | |
| 16 | #include <Protocol/MmCommunication.h> |
| 17 | |
| 18 | #define EFI_MM_COMMUNICATION2_PROTOCOL_GUID \ |
| 19 | { \ |
| 20 | 0x378daedc, 0xf06b, 0x4446, { 0x83, 0x14, 0x40, 0xab, 0x93, 0x3c, 0x87, 0xa3 } \ |
| 21 | } |
| 22 | |
| 23 | typedef struct _EFI_MM_COMMUNICATION2_PROTOCOL EFI_MM_COMMUNICATION2_PROTOCOL; |
| 24 | |
| 25 | /** |
| 26 | Communicates with a registered handler. |
| 27 | |
| 28 | This function provides a service to send and receive messages from a registered UEFI service. |
| 29 | |
| 30 | @param[in] This The EFI_MM_COMMUNICATION_PROTOCOL instance. |
| 31 | @param[in] CommBufferPhysical Physical address of the MM communication buffer |
| 32 | @param[in] CommBufferVirtual Virtual address of the MM communication buffer |
| 33 | @param[in] CommSize The size of the data buffer being passed in. On exit, the size of data |
| 34 | being returned. Zero if the handler does not wish to reply with any data. |
| 35 | This parameter is optional and may be NULL. |
| 36 | |
| 37 | @retval EFI_SUCCESS The message was successfully posted. |
| 38 | @retval EFI_INVALID_PARAMETER CommBufferPhysical was NULL or CommBufferVirtual was NULL. |
| 39 | @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM implementation. |
| 40 | If this error is returned, the MessageLength field |
| 41 | in the CommBuffer header or the integer pointed by |
| 42 | CommSize, are updated to reflect the maximum payload |
| 43 | size the implementation can accommodate. |
| 44 | @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommSize parameter, |
| 45 | if not omitted, are in address range that cannot be |
| 46 | accessed by the MM environment. |
| 47 | |
| 48 | **/ |
| 49 | typedef |
| 50 | EFI_STATUS |
| 51 | (EFIAPI *EFI_MM_COMMUNICATE2)( |
| 52 | IN CONST EFI_MM_COMMUNICATION2_PROTOCOL *This, |
| 53 | IN OUT VOID *CommBufferPhysical, |
| 54 | IN OUT VOID *CommBufferVirtual, |
| 55 | IN OUT UINTN *CommSize OPTIONAL |
| 56 | ); |
| 57 | |
| 58 | /// |
| 59 | /// EFI MM Communication Protocol provides runtime services for communicating |
| 60 | /// between DXE drivers and a registered MMI handler. |
| 61 | /// |
| 62 | struct _EFI_MM_COMMUNICATION2_PROTOCOL { |
| 63 | EFI_MM_COMMUNICATE2 Communicate; |
| 64 | }; |
| 65 | |
| 66 | extern EFI_GUID gEfiMmCommunication2ProtocolGuid; |
| 67 | |
| 68 | #endif |
| 69 | |