]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmAccess.h
Initial import.
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmAccess.h
CommitLineData
878ddf1f 1/** @file\r
2 This file declares SMM SMRAM Access abstraction protocol\r
3\r
4 Copyright (c) 2006, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13 Module Name: SmmAccess.h\r
14\r
15 @par Revision Reference:\r
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
17 Version 0.9.\r
18**/\r
19\r
20#ifndef _SMM_ACCESS_H_\r
21#define _SMM_ACCESS_H_\r
22\r
23typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;\r
24\r
25#define EFI_SMM_ACCESS_PROTOCOL_GUID \\r
26 { \\r
27 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r
28 }\r
29\r
30//\r
31// SMM Access specification constant and types\r
32//\r
33// *******************************************************\r
34// EFI_SMRAM_STATE\r
35// *******************************************************\r
36//\r
37#define EFI_SMRAM_OPEN 0x00000001\r
38#define EFI_SMRAM_CLOSED 0x00000002\r
39#define EFI_SMRAM_LOCKED 0x00000004\r
40#define EFI_CACHEABLE 0x00000008\r
41#define EFI_ALLOCATED 0x00000010\r
42\r
43//\r
44// SMM Access specification Member Function\r
45//\r
46/**\r
47 Opens the SMRAM area to be accessible by a boot-service driver.\r
48\r
49 @param This The EFI_SMM_ACCESS_PROTOCOL instance. \r
50 \r
51 @param DescriptorIndex Indicates that the driver wishes to open \r
52 the memory tagged by this index. \r
53\r
54 @retval EFI_SUCCESS The operation was successful.\r
55 \r
56 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
57 \r
58 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
59\r
60**/\r
61typedef\r
62EFI_STATUS\r
63(EFIAPI *EFI_SMM_OPEN) (\r
64 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
65 UINTN DescriptorIndex\r
66 );\r
67\r
68/**\r
69 Inhibits access to the SMRAM.\r
70\r
71 @param This The EFI_SMM_ACCESS_PROTOCOL instance. \r
72 \r
73 @param DescriptorIndex Indicates that the driver wishes to open \r
74 the memory tagged by this index. \r
75\r
76 @retval EFI_SUCCESS The operation was successful.\r
77 \r
78 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
79 \r
80 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
81 \r
82 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
83\r
84**/\r
85typedef\r
86EFI_STATUS\r
87(EFIAPI *EFI_SMM_CLOSE) (\r
88 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
89 UINTN DescriptorIndex\r
90 );\r
91\r
92/**\r
93 Inhibits access to the SMRAM.\r
94 \r
95 @param This The EFI_SMM_ACCESS_PROTOCOL instance. \r
96 \r
97 @param DescriptorIndex Indicates that the driver wishes to open \r
98 the memory tagged by this index. \r
99\r
100 @retval EFI_SUCCESS The operation was successful.\r
101 \r
102 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
103 \r
104 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
105 \r
106 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
107\r
108**/\r
109typedef\r
110EFI_STATUS\r
111(EFIAPI *EFI_SMM_LOCK) (\r
112 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
113 UINTN DescriptorIndex\r
114 );\r
115\r
116/**\r
117 Queries the memory controller for the possible regions that will support SMRAM.\r
118\r
119 @param This The EFI_SMM_ACCESS_PROTOCOL instance. \r
120 \r
121 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r
122 \r
123 @param SmramMap A pointer to the buffer in which firmware places the current memory map.\r
124\r
125 @retval EFI_SUCCESS The chipset supported the given resource.\r
126 \r
127 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r
128\r
129**/\r
130typedef\r
131EFI_STATUS\r
132(EFIAPI *EFI_SMM_CAPABILITIES) (\r
133 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
134 IN OUT UINTN *SmramMapSize,\r
135 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r
136 );\r
137\r
138/**\r
139 @par Protocol Description:\r
140 This protocol is used to control the visibility of the SMRAM on the platform.\r
141\r
142 @param Open\r
143 Opens the SMRAM. \r
144\r
145 @param Close\r
146 Closes the SMRAM.\r
147\r
148 @param Lock\r
149 Locks the SMRAM. \r
150\r
151 @param GetCapabilities\r
152 Gets information on possible SMRAM regions.\r
153\r
154 @param LockState\r
155Indicates the current state of the SMRAM. Set to TRUE if any region is locked. \r
156\r
157 @param OpenState\r
158Indicates the current state of the SMRAM. Set to TRUE if any region is open. \r
159\r
160**/\r
161struct _EFI_SMM_ACCESS_PROTOCOL {\r
162 EFI_SMM_OPEN Open;\r
163 EFI_SMM_CLOSE Close;\r
164 EFI_SMM_LOCK Lock;\r
165 EFI_SMM_CAPABILITIES GetCapabilities;\r
166 BOOLEAN LockState;\r
167 BOOLEAN OpenState;\r
168};\r
169\r
170extern EFI_GUID gEfiSmmAccessProtocolGuid;\r
171\r
172#endif\r