]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmAccess.h
df19758a29ec856c7f9f0500b790cd9393b66f82
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmAccess.h
1 /** @file
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.
8
9 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
11
12 @par Revision Reference:
13 This Protocol is defined in Framework of EFI SMM Core Interface Spec
14 Version 0.9.
15 **/
16
17 #ifndef _SMM_ACCESS_H_
18 #define _SMM_ACCESS_H_
19
20 #include <Guid/SmramMemoryReserve.h>
21
22 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
23
24 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
25 { \
26 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
27 }
28
29 //
30 // SMM Access specification Member Function
31 //
32 /**
33 Opens the SMRAM area to be accessible by a boot-service driver.
34
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.
38
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.
42
43 **/
44 typedef
45 EFI_STATUS
46 (EFIAPI *EFI_SMM_OPEN)(
47 IN EFI_SMM_ACCESS_PROTOCOL *This,
48 UINTN DescriptorIndex
49 );
50
51 /**
52 Inhibits access to the SMRAM.
53
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.
57
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.
62
63 **/
64 typedef
65 EFI_STATUS
66 (EFIAPI *EFI_SMM_CLOSE)(
67 IN EFI_SMM_ACCESS_PROTOCOL *This,
68 UINTN DescriptorIndex
69 );
70
71 /**
72 Inhibits access to the SMRAM.
73
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.
77
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.
82
83 **/
84 typedef
85 EFI_STATUS
86 (EFIAPI *EFI_SMM_LOCK)(
87 IN EFI_SMM_ACCESS_PROTOCOL *This,
88 UINTN DescriptorIndex
89 );
90
91 /**
92 Queries the memory controller for the possible regions that will support SMRAM.
93
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.
97
98 @retval EFI_SUCCESS The chipset supported the given resource.
99 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
100
101 **/
102 typedef
103 EFI_STATUS
104 (EFIAPI *EFI_SMM_CAPABILITIES)(
105 IN EFI_SMM_ACCESS_PROTOCOL *This,
106 IN OUT UINTN *SmramMapSize,
107 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
108 );
109
110 /**
111 This protocol is used to control the visibility of the SMRAM on the platform.
112 **/
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.
120 };
121
122 extern EFI_GUID gEfiSmmAccessProtocolGuid;
123
124 #endif