]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmAccess.h
Update to BSD license header.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmAccess.h
CommitLineData
79964ac8 1/** @file\r
2 This file declares SMM SMRAM Access abstraction protocol\r
3\r
4 Copyright (c) 2007, 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
b80fbe85 23#include <PiDxe.h>\r
24#include <Guid/SmramMemoryReserve.h>\r
79964ac8 25\r
26typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;\r
27\r
28#define EFI_SMM_ACCESS_PROTOCOL_GUID \\r
29 { \\r
30 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r
31 }\r
32\r
33//\r
34// SMM Access specification constant and types\r
35//\r
36// *******************************************************\r
37// EFI_SMRAM_STATE\r
38// *******************************************************\r
39//\r
40#define EFI_SMRAM_OPEN 0x00000001\r
41#define EFI_SMRAM_CLOSED 0x00000002\r
42#define EFI_SMRAM_LOCKED 0x00000004\r
43#define EFI_CACHEABLE 0x00000008\r
44#define EFI_ALLOCATED 0x00000010\r
45\r
46//\r
47// SMM Access specification Member Function\r
48//\r
49/**\r
50 Opens the SMRAM area to be accessible by a boot-service driver.\r
51\r
52 @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
53 @param DescriptorIndex Indicates that the driver wishes to open\r
54 the memory tagged by this index.\r
55\r
56 @retval EFI_SUCCESS The operation was successful.\r
57 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\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 @param DescriptorIndex Indicates that the driver wishes to open\r
73 the memory tagged by this index.\r
74\r
75 @retval EFI_SUCCESS The operation was successful.\r
76 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
77 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
78 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
79\r
80**/\r
81typedef\r
82EFI_STATUS\r
83(EFIAPI *EFI_SMM_CLOSE) (\r
84 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
85 UINTN DescriptorIndex\r
86 );\r
87\r
88/**\r
89 Inhibits access to the SMRAM.\r
90 @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
91 @param DescriptorIndex Indicates that the driver wishes to open\r
92 the memory tagged by this index.\r
93\r
94 @retval EFI_SUCCESS The operation was successful.\r
95 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
96 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
97 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
98\r
99**/\r
100typedef\r
101EFI_STATUS\r
102(EFIAPI *EFI_SMM_LOCK) (\r
103 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
104 UINTN DescriptorIndex\r
105 );\r
106\r
107/**\r
108 Queries the memory controller for the possible regions that will support SMRAM.\r
109\r
110 @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
111 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r
112 @param SmramMap A pointer to the buffer in which firmware places the current memory map.\r
113\r
114 @retval EFI_SUCCESS The chipset supported the given resource.\r
115 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r
116\r
117**/\r
118typedef\r
119EFI_STATUS\r
120(EFIAPI *EFI_SMM_CAPABILITIES) (\r
121 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
122 IN OUT UINTN *SmramMapSize,\r
123 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r
124 );\r
125\r
126/**\r
127 @par Protocol Description:\r
128 This protocol is used to control the visibility of the SMRAM on the platform.\r
129\r
130 @param Open\r
131 Opens the SMRAM.\r
132\r
133 @param Close\r
134 Closes the SMRAM.\r
135\r
136 @param Lock\r
137 Locks the SMRAM.\r
138\r
139 @param GetCapabilities\r
140 Gets information on possible SMRAM regions.\r
141\r
142 @param LockState\r
143Indicates the current state of the SMRAM. Set to TRUE if any region is locked.\r
144\r
145 @param OpenState\r
146Indicates the current state of the SMRAM. Set to TRUE if any region is open.\r
147\r
148**/\r
149struct _EFI_SMM_ACCESS_PROTOCOL {\r
150 EFI_SMM_OPEN Open;\r
151 EFI_SMM_CLOSE Close;\r
152 EFI_SMM_LOCK Lock;\r
153 EFI_SMM_CAPABILITIES GetCapabilities;\r
154 BOOLEAN LockState;\r
155 BOOLEAN OpenState;\r
156};\r
157\r
158extern EFI_GUID gEfiSmmAccessProtocolGuid;\r
159\r
160#endif\r