]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/MmCommunication.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Ppi / MmCommunication.h
1 /** @file
2 EFI MM Communication PPI definition.
3
4 This PPI provides a means of communicating between drivers outside
5 of MM and MMI handlers inside of MM in PEI phase.
6
7 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
8 Copyright (c) Microsoft Corporation.
9
10 SPDX-License-Identifier: BSD-2-Clause-Patent
11
12 **/
13
14 #ifndef MM_COMMUNICATION_PPI_H_
15 #define MM_COMMUNICATION_PPI_H_
16
17 #define EFI_PEI_MM_COMMUNICATION_PPI_GUID \
18 { \
19 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } \
20 }
21
22 typedef struct _EFI_PEI_MM_COMMUNICATION_PPI EFI_PEI_MM_COMMUNICATION_PPI;
23
24 /**
25 Communicates with a registered handler.
26
27 This function provides a service to send and receive messages from a registered PEI service.
28 The EFI_PEI_MM_COMMUNICATION_PPI driver is responsible for doing any of the copies such that
29 the data lives in PEI-service-accessible RAM.
30
31 A given implementation of the EFI_PEI_MM_COMMUNICATION_PPI may choose to use the
32 EFI_MM_CONTROL_PPI for effecting the mode transition, or it may use some other method.
33
34 The agent invoking the communication interface must be physical/virtually 1:1 mapped.
35
36 To avoid confusion in interpreting frames, the CommBuffer parameter should always begin with
37 EFI_MM_COMMUNICATE_HEADER. The header data is mandatory for messages sent into the MM agent.
38
39 Once inside of MM, the MM infrastructure will call all registered handlers with the same
40 HandlerType as the GUID specified by HeaderGuid and the CommBuffer pointing to Data.
41
42 This function is not reentrant.
43
44 @param[in] This The EFI_PEI_MM_COMMUNICATION_PPI instance.
45 @param[in] CommBuffer Pointer to the buffer to convey into MMRAM.
46 @param[in] CommSize The size of the data buffer being passed in. On exit, the
47 size of data being returned. Zero if the handler does not
48 wish to reply with any data.
49
50 @retval EFI_SUCCESS The message was successfully posted.
51 @retval EFI_INVALID_PARAMETER The buffer was NULL.
52 **/
53 typedef
54 EFI_STATUS
55 (EFIAPI *EFI_PEI_MM_COMMUNICATE)(
56 IN CONST EFI_PEI_MM_COMMUNICATION_PPI *This,
57 IN OUT VOID *CommBuffer,
58 IN OUT UINTN *CommSize
59 );
60
61 ///
62 /// EFI MM Communication PPI provides services for communicating between PEIM and a registered
63 /// MMI handler.
64 ///
65 struct _EFI_PEI_MM_COMMUNICATION_PPI {
66 EFI_PEI_MM_COMMUNICATE Communicate;
67 };
68
69 extern EFI_GUID gEfiPeiMmCommunicationPpiGuid;
70
71 #endif