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