]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmAccess.h
Updated IntelFrameworkPkg.nspd to add GUID/PPI/Protocol definitions.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmAccess.h
1 /** @file
2 This file declares SMM SMRAM Access abstraction protocol
3
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
9
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.
12
13 Module Name: SmmAccess.h
14
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
17 Version 0.9.
18 **/
19
20 #ifndef _SMM_ACCESS_H_
21 #define _SMM_ACCESS_H_
22
23 #include <SmramMemoryReserve.h>
24
25 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
26
27 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
28 { \
29 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
30 }
31
32 //
33 // SMM Access specification constant and types
34 //
35 // *******************************************************
36 // EFI_SMRAM_STATE
37 // *******************************************************
38 //
39 #define EFI_SMRAM_OPEN 0x00000001
40 #define EFI_SMRAM_CLOSED 0x00000002
41 #define EFI_SMRAM_LOCKED 0x00000004
42 #define EFI_CACHEABLE 0x00000008
43 #define EFI_ALLOCATED 0x00000010
44
45 //
46 // SMM Access specification Member Function
47 //
48 /**
49 Opens the SMRAM area to be accessible by a boot-service driver.
50
51 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
52 @param DescriptorIndex Indicates that the driver wishes to open
53 the memory tagged by this index.
54
55 @retval EFI_SUCCESS The operation was successful.
56 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
57 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
58
59 **/
60 typedef
61 EFI_STATUS
62 (EFIAPI *EFI_SMM_OPEN) (
63 IN EFI_SMM_ACCESS_PROTOCOL *This,
64 UINTN DescriptorIndex
65 );
66
67 /**
68 Inhibits access to the SMRAM.
69
70 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
71 @param DescriptorIndex Indicates that the driver wishes to open
72 the memory tagged by this index.
73
74 @retval EFI_SUCCESS The operation was successful.
75 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
76 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
77 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
78
79 **/
80 typedef
81 EFI_STATUS
82 (EFIAPI *EFI_SMM_CLOSE) (
83 IN EFI_SMM_ACCESS_PROTOCOL *This,
84 UINTN DescriptorIndex
85 );
86
87 /**
88 Inhibits access to the SMRAM.
89 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
90 @param DescriptorIndex Indicates that the driver wishes to open
91 the memory tagged by this index.
92
93 @retval EFI_SUCCESS The operation was successful.
94 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
95 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
96 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
97
98 **/
99 typedef
100 EFI_STATUS
101 (EFIAPI *EFI_SMM_LOCK) (
102 IN EFI_SMM_ACCESS_PROTOCOL *This,
103 UINTN DescriptorIndex
104 );
105
106 /**
107 Queries the memory controller for the possible regions that will support SMRAM.
108
109 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
110 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
111 @param SmramMap A pointer to the buffer in which firmware places the current memory map.
112
113 @retval EFI_SUCCESS The chipset supported the given resource.
114 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
115
116 **/
117 typedef
118 EFI_STATUS
119 (EFIAPI *EFI_SMM_CAPABILITIES) (
120 IN EFI_SMM_ACCESS_PROTOCOL *This,
121 IN OUT UINTN *SmramMapSize,
122 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
123 );
124
125 /**
126 @par Protocol Description:
127 This protocol is used to control the visibility of the SMRAM on the platform.
128
129 @param Open
130 Opens the SMRAM.
131
132 @param Close
133 Closes the SMRAM.
134
135 @param Lock
136 Locks the SMRAM.
137
138 @param GetCapabilities
139 Gets information on possible SMRAM regions.
140
141 @param LockState
142 Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
143
144 @param OpenState
145 Indicates the current state of the SMRAM. Set to TRUE if any region is open.
146
147 **/
148 struct _EFI_SMM_ACCESS_PROTOCOL {
149 EFI_SMM_OPEN Open;
150 EFI_SMM_CLOSE Close;
151 EFI_SMM_LOCK Lock;
152 EFI_SMM_CAPABILITIES GetCapabilities;
153 BOOLEAN LockState;
154 BOOLEAN OpenState;
155 };
156
157 extern EFI_GUID gEfiSmmAccessProtocolGuid;
158
159 #endif