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