]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/SmmAccess2.h
Move EFI_SMRAM_DESCRIPTOR into PiMultiPhase.h. Since the top level includes in the...
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmAccess2.h
1 /** @file
2 EFI SMM Access2 Protocol as defined in the PI 1.2 specification.
3
4 This protocol is used to control the visibility of the SMRAM on the platform.
5 It abstracts the location and characteristics of SMRAM. The expectation is
6 that the north bridge or memory controller would publish this protocol.
7
8 The principal functionality found in the memory controller includes the following:
9 - Exposing the SMRAM to all non-SMM agents, or the "open" state
10 - Shrouding the SMRAM to all but the SMM agents, or the "closed" state
11 - Preserving the system integrity, or "locking" the SMRAM, such that the settings cannot be
12 perturbed by either boot service or runtime agents
13
14 Copyright (c) 2009 - 2010, Intel Corporation
15 All rights reserved. This program and the accompanying materials
16 are licensed and made available under the terms and conditions of the BSD License
17 which accompanies this distribution. The full text of the license may be found at
18 http://opensource.org/licenses/bsd-license.php
19
20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
21 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22
23 **/
24
25 #ifndef _SMM_ACCESS2_H_
26 #define _SMM_ACCESS2_H_
27
28 ///
29 /// Note:
30 /// To avoid name conflict between PI and Framework SMM spec, the following names defined
31 /// in PI 1.2 SMM spec are renamed. These renamings are not yet in a public PI spec and errta.
32 ///
33 /// EFI_SMM_OPEN -> EFI_SMM_OPEN2
34 /// EFI_SMM_CLOSE -> EFI_SMM_CLOSE2
35 /// EFI_SMM_LOCK -> EFI_SMM_LOCK2
36 /// EFI_SMM_CAPABILITIES -> EFI_SMM_CAPABILITIES2
37 ///
38
39 #define EFI_SMM_ACCESS2_PROTOCOL_GUID \
40 { \
41 0xc2702b74, 0x800c, 0x4131, {0x87, 0x46, 0x8f, 0xb5, 0xb8, 0x9c, 0xe4, 0xac } \
42 }
43
44
45 typedef struct _EFI_SMM_ACCESS2_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL;
46
47 /**
48 Opens the SMRAM area to be accessible by a boot-service driver.
49
50 This function "opens" SMRAM so that it is visible while not inside of SMM. The function should
51 return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM. The function
52 should return EFI_DEVICE_ERROR if the SMRAM configuration is locked.
53
54 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
55
56 @retval EFI_SUCCESS The operation was successful.
57 @retval EFI_UNSUPPORTED The system does not support opening and closing of SMRAM.
58 @retval EFI_DEVICE_ERROR SMRAM cannot be opened, perhaps because it is locked.
59 **/
60 typedef
61 EFI_STATUS
62 (EFIAPI *EFI_SMM_OPEN2)(
63 IN EFI_SMM_ACCESS2_PROTOCOL *This
64 );
65
66 /**
67 Inhibits access to the SMRAM.
68
69 This function "closes" SMRAM so that it is not visible while outside of SMM. The function should
70 return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM.
71
72 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
73
74 @retval EFI_SUCCESS The operation was successful.
75 @retval EFI_UNSUPPORTED The system does not support opening and closing of SMRAM.
76 @retval EFI_DEVICE_ERROR SMRAM cannot be closed.
77 **/
78 typedef
79 EFI_STATUS
80 (EFIAPI *EFI_SMM_CLOSE2)(
81 IN EFI_SMM_ACCESS2_PROTOCOL *This
82 );
83
84 /**
85 Inhibits access to the SMRAM.
86
87 This function prohibits access to the SMRAM region. This function is usually implemented such
88 that it is a write-once operation.
89
90 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
91
92 @retval EFI_SUCCESS The device was successfully locked.
93 @retval EFI_UNSUPPORTED The system does not support locking of SMRAM.
94 **/
95 typedef
96 EFI_STATUS
97 (EFIAPI *EFI_SMM_LOCK2)(
98 IN EFI_SMM_ACCESS2_PROTOCOL *This
99 );
100
101 /**
102 Queries the memory controller for the possible regions that will support SMRAM.
103
104 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
105 @param[in,out] SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
106 @param[in,out] SmramMap A pointer to the buffer in which firmware places the current memory map.
107
108 @retval EFI_SUCCESS The chipset supported the given resource.
109 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small. The current buffer size
110 needed to hold the memory map is returned in SmramMapSize.
111 **/
112 typedef
113 EFI_STATUS
114 (EFIAPI *EFI_SMM_CAPABILITIES2)(
115 IN CONST EFI_SMM_ACCESS2_PROTOCOL *This,
116 IN OUT UINTN *SmramMapSize,
117 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
118 );
119
120 ///
121 /// EFI SMM Access2 Protocol is used to control the visibility of the SMRAM on the platform.
122 /// It abstracts the location and characteristics of SMRAM. The expectation is
123 /// that the north bridge or memory controller would publish this protocol.
124 ///
125 struct _EFI_SMM_ACCESS2_PROTOCOL {
126 EFI_SMM_OPEN2 Open;
127 EFI_SMM_CLOSE2 Close;
128 EFI_SMM_LOCK2 Lock;
129 EFI_SMM_CAPABILITIES2 GetCapabilities;
130 ///
131 /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is locked.
132 ///
133 BOOLEAN LockState;
134 ///
135 /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is open.
136 ///
137 BOOLEAN OpenState;
138 };
139
140 extern EFI_GUID gEfiSmmAccess2ProtocolGuid;
141
142 #endif
143