2 EFI SMM Access2 Protocol as defined in the PI 1.2 specification.
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.
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
14 Copyright (c) 2009, 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
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.
25 #ifndef _SMM_ACCESS2_H_
26 #define _SMM_ACCESS2_H_
30 #define EFI_SMM_ACCESS2_PROTOCOL_GUID \
32 0xc2702b74, 0x800c, 0x4131, {0x87, 0x46, 0x8f, 0xb5, 0xb8, 0x9c, 0xe4, 0xac } \
36 /// SMRAM states and capabilities
38 #define EFI_SMRAM_OPEN 0x00000001
39 #define EFI_SMRAM_CLOSED 0x00000002
40 #define EFI_SMRAM_LOCKED 0x00000004
41 #define EFI_CACHEABLE 0x00000008
42 #define EFI_ALLOCATED 0x00000010
43 #define EFI_NEEDS_TESTING 0x00000020
44 #define EFI_NEEDS_ECC_INITIALIZATION 0x00000040
47 /// Structure describing a SMRAM region and its accessibility attributes
51 /// Designates the physical address of the SMRAM in memory. This view of memory is
52 /// the same as seen by I/O-based agents, for example, but it may not be the address seen
53 /// by the processors.
55 EFI_PHYSICAL_ADDRESS PhysicalStart
;
57 /// Designates the address of the SMRAM, as seen by software executing on the
58 /// processors. This address may or may not match PhysicalStart.
60 EFI_PHYSICAL_ADDRESS CpuStart
;
62 /// Describes the number of bytes in the SMRAM region.
66 /// Describes the accessibility attributes of the SMRAM. These attributes include the
67 /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical
68 /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC
72 } EFI_SMRAM_DESCRIPTOR
;
74 typedef struct _EFI_SMM_ACCESS2_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL
;
77 Opens the SMRAM area to be accessible by a boot-service driver.
79 This function "opens" SMRAM so that it is visible while not inside of SMM. The function should
80 return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM. The function
81 should return EFI_DEVICE_ERROR if the SMRAM configuration is locked.
83 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
85 @retval EFI_SUCCESS The operation was successful.
86 @retval EFI_UNSUPPORTED The system does not support opening and closing of SMRAM.
87 @retval EFI_DEVICE_ERROR SMRAM cannot be opened, perhaps because it is locked.
91 (EFIAPI
*EFI_SMM_OPEN
)(
92 IN CONST EFI_SMM_ACCESS2_PROTOCOL
*This
96 Inhibits access to the SMRAM.
98 This function "closes" SMRAM so that it is not visible while outside of SMM. The function should
99 return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM.
101 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
103 @retval EFI_SUCCESS The operation was successful.
104 @retval EFI_UNSUPPORTED The system does not support opening and closing of SMRAM.
105 @retval EFI_DEVICE_ERROR SMRAM cannot be closed.
109 (EFIAPI
*EFI_SMM_CLOSE
)(
110 IN CONST EFI_SMM_ACCESS2_PROTOCOL
*This
114 Inhibits access to the SMRAM.
116 This function prohibits access to the SMRAM region. This function is usually implemented such
117 that it is a write-once operation.
119 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
121 @retval EFI_SUCCESS The device was successfully locked.
122 @retval EFI_UNSUPPORTED The system does not support locking of SMRAM.
126 (EFIAPI
*EFI_SMM_LOCK
)(
127 IN CONST EFI_SMM_ACCESS2_PROTOCOL
*This
131 Queries the memory controller for the possible regions that will support SMRAM.
133 @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.
134 @param[in,out] SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
135 @param[in,out] SmramMap A pointer to the buffer in which firmware places the current memory map.
137 @retval EFI_SUCCESS The chipset supported the given resource.
138 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small. The current buffer size
139 needed to hold the memory map is returned in SmramMapSize.
143 (EFIAPI
*EFI_SMM_CAPABILITIES
)(
144 IN CONST EFI_SMM_ACCESS2_PROTOCOL
*This
,
145 IN OUT UINTN
*SmramMapSize
,
146 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
150 /// EFI SMM Access2 Protocol is used to control the visibility of the SMRAM on the platform.
151 /// It abstracts the location and characteristics of SMRAM. The expectation is
152 /// that the north bridge or memory controller would publish this protocol.
154 struct _EFI_SMM_ACCESS2_PROTOCOL
{
158 EFI_SMM_CAPABILITIES GetCapabilities
;
160 /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is locked.
164 /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is open.
169 extern EFI_GUID gEfiSmmAccess2ProtocolGuid
;