2 This file declares the SMM SMRAM Access abstraction protocol, which is used to control
3 the visibility of the SMRAM on the platform. The expectation is
4 that the north bridge or memory controller would publish this protocol.
5 For example, the Memory Controller Hub (MCH) has the hardware provision for this
6 type of control. Because of the protected, distinguished class of memory for IA-32
7 systems, the expectation is that this protocol would be supported only on IA-32 systems.
9 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
12 @par Revision Reference:
13 This Protocol is defined in Framework of EFI SMM Core Interface Spec
17 #ifndef _SMM_ACCESS_H_
18 #define _SMM_ACCESS_H_
20 #include <Guid/SmramMemoryReserve.h>
22 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL
;
24 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
26 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
30 // SMM Access specification Member Function
33 Opens the SMRAM area to be accessible by a boot-service driver.
35 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
36 @param DescriptorIndex Indicates that the driver wishes to open
37 the memory tagged by this index.
39 @retval EFI_SUCCESS The operation was successful.
40 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
41 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
46 (EFIAPI
*EFI_SMM_OPEN
)(
47 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
52 Inhibits access to the SMRAM.
54 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
55 @param DescriptorIndex Indicates that the driver wishes to close
56 the memory tagged by this index.
58 @retval EFI_SUCCESS The operation was successful.
59 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
60 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
61 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
66 (EFIAPI
*EFI_SMM_CLOSE
)(
67 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
72 Inhibits access to the SMRAM.
74 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
75 @param DescriptorIndex Indicates that the driver wishes to lock
76 the memory tagged by this index.
78 @retval EFI_SUCCESS The operation was successful.
79 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
80 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
81 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
86 (EFIAPI
*EFI_SMM_LOCK
)(
87 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
92 Queries the memory controller for the possible regions that will support SMRAM.
94 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
95 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
96 @param SmramMap A pointer to the buffer in which firmware places the current memory map.
98 @retval EFI_SUCCESS The chipset supported the given resource.
99 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
104 (EFIAPI
*EFI_SMM_CAPABILITIES
)(
105 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
106 IN OUT UINTN
*SmramMapSize
,
107 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
111 This protocol is used to control the visibility of the SMRAM on the platform.
113 struct _EFI_SMM_ACCESS_PROTOCOL
{
114 EFI_SMM_OPEN Open
; ///< Opens the SMRAM.
115 EFI_SMM_CLOSE Close
; ///< Closes the SMRAM.
116 EFI_SMM_LOCK Lock
; ///< Locks the SMRAM.
117 EFI_SMM_CAPABILITIES GetCapabilities
; ///< Gets information on possible SMRAM regions.
118 BOOLEAN LockState
; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
119 BOOLEAN OpenState
; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is open.
122 extern EFI_GUID gEfiSmmAccessProtocolGuid
;