]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkPkg/Include/Protocol/SmmAccess.h
Committing changes to the comments, after review with engineers.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmAccess.h
... / ...
CommitLineData
1/** @file\r
2 This file declares the 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
8\r
9 Copyright (c) 2007 - 2009, 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
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
26#include <Guid/SmramMemoryReserve.h>\r
27\r
28typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;\r
29\r
30#define EFI_SMM_ACCESS_PROTOCOL_GUID \\r
31 { \\r
32 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r
33 }\r
34\r
35//\r
36// SMM Access specification constant and types\r
37//\r
38// *******************************************************\r
39// EFI_SMRAM_STATE\r
40// *******************************************************\r
41//\r
42#define EFI_SMRAM_OPEN 0x00000001\r
43#define EFI_SMRAM_CLOSED 0x00000002\r
44#define EFI_SMRAM_LOCKED 0x00000004\r
45#define EFI_CACHEABLE 0x00000008\r
46#define EFI_ALLOCATED 0x00000010\r
47\r
48//\r
49// SMM Access specification Member Function\r
50//\r
51/**\r
52 Opens the SMRAM area to be accessible by a boot-service driver.\r
53\r
54 @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
55 @param DescriptorIndex Indicates that the driver wishes to open\r
56 the memory tagged by this index.\r
57\r
58 @retval EFI_SUCCESS The operation was successful.\r
59 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
60 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
61\r
62**/\r
63typedef\r
64EFI_STATUS\r
65(EFIAPI *EFI_SMM_OPEN)(\r
66 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
67 UINTN DescriptorIndex\r
68 );\r
69\r
70/**\r
71 Inhibits access to the SMRAM.\r
72\r
73 @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
74 @param DescriptorIndex Indicates that the driver wishes to close\r
75 the memory tagged by this index.\r
76\r
77 @retval EFI_SUCCESS The operation was successful.\r
78 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
79 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
80 @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
81\r
82**/\r
83typedef\r
84EFI_STATUS\r
85(EFIAPI *EFI_SMM_CLOSE)(\r
86 IN EFI_SMM_ACCESS_PROTOCOL *This,\r
87 UINTN DescriptorIndex\r
88 );\r
89\r
90/**\r
91 Inhibits access to the SMRAM.\r
92\r
93 @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r
94 @param DescriptorIndex Indicates that the driver wishes to lock\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 This protocol is used to control the visibility of the SMRAM on the platform.\r
131**/\r
132struct _EFI_SMM_ACCESS_PROTOCOL {\r
133 EFI_SMM_OPEN Open; ///< Opens the SMRAM.\r
134 EFI_SMM_CLOSE Close; ///< Closes the SMRAM.\r
135 EFI_SMM_LOCK Lock; ///< Locks the SMRAM.\r
136 EFI_SMM_CAPABILITIES GetCapabilities; ///< Gets information on possible SMRAM regions.\r
137 BOOLEAN LockState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is locked.\r
138 BOOLEAN OpenState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is open.\r
139};\r
140\r
141extern EFI_GUID gEfiSmmAccessProtocolGuid;\r
142\r
143#endif\r