]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/MmAccess.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Protocol / MmAccess.h
CommitLineData
07c6a47e
ED
1/** @file\r
2 EFI MM Access Protocol as defined in the PI 1.5 specification.\r
3\r
4 This protocol is used to control the visibility of the MMRAM on the platform.\r
5 It abstracts the location and characteristics of MMRAM. The expectation is\r
6 that the north bridge or memory controller would publish this protocol.\r
7\r
8 The principal functionality found in the memory controller includes the following:\r
9 - Exposing the MMRAM to all non-MM agents, or the "open" state\r
10 - Shrouding the MMRAM to all but the MM agents, or the "closed" state\r
11 - Preserving the system integrity, or "locking" the MMRAM, such that the settings cannot be\r
12 perturbed by either boot service or runtime agents\r
13\r
14 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
9344f092 15 SPDX-License-Identifier: BSD-2-Clause-Patent\r
07c6a47e
ED
16\r
17**/\r
18\r
19#ifndef _MM_ACCESS_H_\r
20#define _MM_ACCESS_H_\r
21\r
22#define EFI_MM_ACCESS_PROTOCOL_GUID \\r
23 { \\r
24 0xc2702b74, 0x800c, 0x4131, {0x87, 0x46, 0x8f, 0xb5, 0xb8, 0x9c, 0xe4, 0xac } \\r
25 }\r
26\r
2f88bd3a 27typedef struct _EFI_MM_ACCESS_PROTOCOL EFI_MM_ACCESS_PROTOCOL;\r
07c6a47e
ED
28\r
29/**\r
30 Opens the MMRAM area to be accessible by a boot-service driver.\r
31\r
32 This function "opens" MMRAM so that it is visible while not inside of MM. The function should\r
33 return EFI_UNSUPPORTED if the hardware does not support hiding of MMRAM. The function\r
34 should return EFI_DEVICE_ERROR if the MMRAM configuration is locked.\r
35\r
36 @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.\r
37\r
38 @retval EFI_SUCCESS The operation was successful.\r
39 @retval EFI_UNSUPPORTED The system does not support opening and closing of MMRAM.\r
40 @retval EFI_DEVICE_ERROR MMRAM cannot be opened, perhaps because it is locked.\r
41**/\r
42typedef\r
43EFI_STATUS\r
44(EFIAPI *EFI_MM_OPEN)(\r
45 IN EFI_MM_ACCESS_PROTOCOL *This\r
46 );\r
47\r
48/**\r
49 Inhibits access to the MMRAM.\r
50\r
51 This function "closes" MMRAM so that it is not visible while outside of MM. The function should\r
52 return EFI_UNSUPPORTED if the hardware does not support hiding of MMRAM.\r
53\r
54 @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.\r
55\r
56 @retval EFI_SUCCESS The operation was successful.\r
57 @retval EFI_UNSUPPORTED The system does not support opening and closing of MMRAM.\r
58 @retval EFI_DEVICE_ERROR MMRAM cannot be closed.\r
59**/\r
60typedef\r
61EFI_STATUS\r
62(EFIAPI *EFI_MM_CLOSE)(\r
63 IN EFI_MM_ACCESS_PROTOCOL *This\r
64 );\r
65\r
66/**\r
67 Inhibits access to the MMRAM.\r
68\r
69 This function prohibits access to the MMRAM region. This function is usually implemented such\r
70 that it is a write-once operation.\r
71\r
72 @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.\r
73\r
74 @retval EFI_SUCCESS The device was successfully locked.\r
75 @retval EFI_UNSUPPORTED The system does not support locking of MMRAM.\r
76**/\r
77typedef\r
78EFI_STATUS\r
79(EFIAPI *EFI_MM_LOCK)(\r
80 IN EFI_MM_ACCESS_PROTOCOL *This\r
81 );\r
82\r
83/**\r
84 Queries the memory controller for the possible regions that will support MMRAM.\r
85\r
86 @param[in] This The EFI_MM_ACCESS_PROTOCOL instance.\r
87 @param[in,out] MmramMapSize A pointer to the size, in bytes, of the MmramMemoryMap buffer.\r
88 @param[in,out] MmramMap A pointer to the buffer in which firmware places the current memory map.\r
89\r
90 @retval EFI_SUCCESS The chipset supported the given resource.\r
91 @retval EFI_BUFFER_TOO_SMALL The MmramMap parameter was too small. The current buffer size\r
92 needed to hold the memory map is returned in MmramMapSize.\r
93**/\r
94typedef\r
95EFI_STATUS\r
96(EFIAPI *EFI_MM_CAPABILITIES)(\r
97 IN CONST EFI_MM_ACCESS_PROTOCOL *This,\r
98 IN OUT UINTN *MmramMapSize,\r
99 IN OUT EFI_MMRAM_DESCRIPTOR *MmramMap\r
100 );\r
101\r
102///\r
103/// EFI MM Access Protocol is used to control the visibility of the MMRAM on the platform.\r
104/// It abstracts the location and characteristics of MMRAM. The platform should report all\r
105/// MMRAM via EFI_MM_ACCESS_PROTOCOL. The expectation is that the north bridge or memory\r
106/// controller would publish this protocol.\r
107///\r
108struct _EFI_MM_ACCESS_PROTOCOL {\r
2f88bd3a
MK
109 EFI_MM_OPEN Open;\r
110 EFI_MM_CLOSE Close;\r
111 EFI_MM_LOCK Lock;\r
112 EFI_MM_CAPABILITIES GetCapabilities;\r
07c6a47e
ED
113 ///\r
114 /// Indicates the current state of the MMRAM. Set to TRUE if MMRAM is locked.\r
115 ///\r
2f88bd3a 116 BOOLEAN LockState;\r
07c6a47e
ED
117 ///\r
118 /// Indicates the current state of the MMRAM. Set to TRUE if MMRAM is open.\r
119 ///\r
2f88bd3a 120 BOOLEAN OpenState;\r
07c6a47e
ED
121};\r
122\r
2f88bd3a 123extern EFI_GUID gEfiMmAccessProtocolGuid;\r
07c6a47e
ED
124\r
125#endif\r