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 open
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.
93 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
94 @param DescriptorIndex Indicates that the driver wishes to open
95 the memory tagged by this index.
97 @retval EFI_SUCCESS The operation was successful.
98 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
99 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
100 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
105 (EFIAPI
*EFI_SMM_LOCK
)(
106 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
107 UINTN DescriptorIndex
111 Queries the memory controller for the possible regions that will support SMRAM.
113 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
114 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
115 @param SmramMap A pointer to the buffer in which firmware places the current memory map.
117 @retval EFI_SUCCESS The chipset supported the given resource.
118 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
123 (EFIAPI
*EFI_SMM_CAPABILITIES
)(
124 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
125 IN OUT UINTN
*SmramMapSize
,
126 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
130 @par Protocol Description:
131 This protocol is used to control the visibility of the SMRAM on the platform.
142 @param GetCapabilities
143 Gets information on possible SMRAM regions.
146 Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
149 Indicates the current state of the SMRAM. Set to TRUE if any region is open.
152 struct _EFI_SMM_ACCESS_PROTOCOL
{
156 EFI_SMM_CAPABILITIES GetCapabilities
;
161 extern EFI_GUID gEfiSmmAccessProtocolGuid
;