2 This file declares SMM SMRAM Access abstraction protocol
4 Copyright (c) 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: SmmAccess.h
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
20 #ifndef _SMM_ACCESS_H_
21 #define _SMM_ACCESS_H_
24 #include <Guid/SmramMemoryReserve.h>
26 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL
;
28 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
30 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
34 // SMM Access specification constant and types
36 // *******************************************************
38 // *******************************************************
40 #define EFI_SMRAM_OPEN 0x00000001
41 #define EFI_SMRAM_CLOSED 0x00000002
42 #define EFI_SMRAM_LOCKED 0x00000004
43 #define EFI_CACHEABLE 0x00000008
44 #define EFI_ALLOCATED 0x00000010
47 // SMM Access specification Member Function
50 Opens the SMRAM area to be accessible by a boot-service driver.
52 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
53 @param DescriptorIndex Indicates that the driver wishes to open
54 the memory tagged by this index.
56 @retval EFI_SUCCESS The operation was successful.
57 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
58 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
63 (EFIAPI
*EFI_SMM_OPEN
) (
64 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
69 Inhibits access to the SMRAM.
71 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
72 @param DescriptorIndex Indicates that the driver wishes to open
73 the memory tagged by this index.
75 @retval EFI_SUCCESS The operation was successful.
76 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
77 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
78 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
83 (EFIAPI
*EFI_SMM_CLOSE
) (
84 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
89 Inhibits access to the SMRAM.
90 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
91 @param DescriptorIndex Indicates that the driver wishes to open
92 the memory tagged by this index.
94 @retval EFI_SUCCESS The operation was successful.
95 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
96 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
97 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
102 (EFIAPI
*EFI_SMM_LOCK
) (
103 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
104 UINTN DescriptorIndex
108 Queries the memory controller for the possible regions that will support SMRAM.
110 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
111 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
112 @param SmramMap A pointer to the buffer in which firmware places the current memory map.
114 @retval EFI_SUCCESS The chipset supported the given resource.
115 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
120 (EFIAPI
*EFI_SMM_CAPABILITIES
) (
121 IN EFI_SMM_ACCESS_PROTOCOL
*This
,
122 IN OUT UINTN
*SmramMapSize
,
123 IN OUT EFI_SMRAM_DESCRIPTOR
*SmramMap
127 @par Protocol Description:
128 This protocol is used to control the visibility of the SMRAM on the platform.
139 @param GetCapabilities
140 Gets information on possible SMRAM regions.
143 Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
146 Indicates the current state of the SMRAM. Set to TRUE if any region is open.
149 struct _EFI_SMM_ACCESS_PROTOCOL
{
153 EFI_SMM_CAPABILITIES GetCapabilities
;
158 extern EFI_GUID gEfiSmmAccessProtocolGuid
;