2 This file declares 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, Intel Corporation
10 All rights reserved. This program and the accompanying materials
11 are licensed and made available under the terms and conditions of the BSD License
12 which accompanies this distribution. The full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 @par Revision Reference:
19 This Protocol is defined in Framework of EFI SMM Core Interface Spec
23 #ifndef _SMM_ACCESS_H_
24 #define _SMM_ACCESS_H_
27 #include <Guid/SmramMemoryReserve.h>
29 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL
;
31 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
33 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
37 // SMM Access specification constant and types
39 // *******************************************************
41 // *******************************************************
43 #define EFI_SMRAM_OPEN 0x00000001
44 #define EFI_SMRAM_CLOSED 0x00000002
45 #define EFI_SMRAM_LOCKED 0x00000004
46 #define EFI_CACHEABLE 0x00000008
47 #define EFI_ALLOCATED 0x00000010
50 // SMM Access specification Member Function
53 Opens the SMRAM area to be accessible by a boot-service driver.
55 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
56 @param DescriptorIndex Indicates that the driver wishes to open
57 the memory tagged by this index.
59 @retval EFI_SUCCESS The operation was successful.
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_OPEN
)(
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 close
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_CLOSE
)(
87 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
92 Inhibits access to the SMRAM.
94 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
95 @param DescriptorIndex Indicates that the driver wishes to lock
96 the memory tagged by this index.
98 @retval EFI_SUCCESS The operation was successful.
99 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
100 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
101 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
106 (EFIAPI
*EFI_SMM_LOCK
)(
107 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
108 UINTN DescriptorIndex
112 Queries the memory controller for the possible regions that will support SMRAM.
114 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
115 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
116 @param SmramMap A pointer to the buffer in which firmware places the current memory map.
118 @retval EFI_SUCCESS The chipset supported the given resource.
119 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
124 (EFIAPI
*EFI_SMM_CAPABILITIES
)(
125 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
126 IN OUT UINTN
*SmramMapSize
,
127 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
131 @par Protocol Description:
132 This protocol is used to control the visibility of the SMRAM on the platform.
143 @param GetCapabilities
144 Gets information on possible SMRAM regions.
147 Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
150 Indicates the current state of the SMRAM. Set to TRUE if any region is open.
153 struct _EFI_SMM_ACCESS_PROTOCOL
{
157 EFI_SMM_CAPABILITIES GetCapabilities
;
162 extern EFI_GUID gEfiSmmAccessProtocolGuid
;