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