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 |
29 | typedef 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 |
64 | typedef\r |
65 | EFI_STATUS\r |
69686d56 |
66 | (EFIAPI *EFI_SMM_OPEN)(\r |
79964ac8 |
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 |
693c4e02 |
75 | @param DescriptorIndex Indicates that the driver wishes to close\r |
79964ac8 |
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 |
84 | typedef\r |
85 | EFI_STATUS\r |
69686d56 |
86 | (EFIAPI *EFI_SMM_CLOSE)(\r |
79964ac8 |
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 |
693c4e02 |
93 | \r |
79964ac8 |
94 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r |
693c4e02 |
95 | @param DescriptorIndex Indicates that the driver wishes to lock\r |
79964ac8 |
96 | the memory tagged by this index.\r |
97 | \r |
98 | @retval EFI_SUCCESS The operation was successful.\r |
99 | @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r |
100 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r |
101 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r |
102 | \r |
103 | **/\r |
104 | typedef\r |
105 | EFI_STATUS\r |
69686d56 |
106 | (EFIAPI *EFI_SMM_LOCK)(\r |
79964ac8 |
107 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
108 | UINTN DescriptorIndex\r |
109 | );\r |
110 | \r |
111 | /**\r |
112 | Queries the memory controller for the possible regions that will support SMRAM.\r |
113 | \r |
114 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r |
115 | @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r |
116 | @param SmramMap A pointer to the buffer in which firmware places the current memory map.\r |
117 | \r |
118 | @retval EFI_SUCCESS The chipset supported the given resource.\r |
119 | @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r |
120 | \r |
121 | **/\r |
122 | typedef\r |
123 | EFI_STATUS\r |
69686d56 |
124 | (EFIAPI *EFI_SMM_CAPABILITIES)(\r |
79964ac8 |
125 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
126 | IN OUT UINTN *SmramMapSize,\r |
127 | IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r |
128 | );\r |
129 | \r |
130 | /**\r |
131 | @par Protocol Description:\r |
132 | This protocol is used to control the visibility of the SMRAM on the platform.\r |
133 | \r |
134 | @param Open\r |
135 | Opens the SMRAM.\r |
136 | \r |
137 | @param Close\r |
138 | Closes the SMRAM.\r |
139 | \r |
140 | @param Lock\r |
141 | Locks the SMRAM.\r |
142 | \r |
143 | @param GetCapabilities\r |
144 | Gets information on possible SMRAM regions.\r |
145 | \r |
146 | @param LockState\r |
700a7869 |
147 | Indicates the current state of the SMRAM. Set to TRUE if any region is locked.\r |
79964ac8 |
148 | \r |
149 | @param OpenState\r |
700a7869 |
150 | Indicates the current state of the SMRAM. Set to TRUE if any region is open.\r |
79964ac8 |
151 | \r |
152 | **/\r |
153 | struct _EFI_SMM_ACCESS_PROTOCOL {\r |
154 | EFI_SMM_OPEN Open;\r |
155 | EFI_SMM_CLOSE Close;\r |
156 | EFI_SMM_LOCK Lock;\r |
157 | EFI_SMM_CAPABILITIES GetCapabilities;\r |
158 | BOOLEAN LockState;\r |
159 | BOOLEAN OpenState;\r |
160 | };\r |
161 | \r |
162 | extern EFI_GUID gEfiSmmAccessProtocolGuid;\r |
163 | \r |
164 | #endif\r |