]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmAccess.h
Modified header files to make them compile
[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 <PiDxe.h>
24 #include <Guid/SmramMemoryReserve.h>
25
26 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
27
28 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
29 { \
30 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
31 }
32
33 //
34 // SMM Access specification constant and types
35 //
36 // *******************************************************
37 // EFI_SMRAM_STATE
38 // *******************************************************
39 //
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
45
46 //
47 // SMM Access specification Member Function
48 //
49 /**
50 Opens the SMRAM area to be accessible by a boot-service driver.
51
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.
55
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.
59
60 **/
61 typedef
62 EFI_STATUS
63 (EFIAPI *EFI_SMM_OPEN) (
64 IN EFI_SMM_ACCESS_PROTOCOL *This,
65 UINTN DescriptorIndex
66 );
67
68 /**
69 Inhibits access to the SMRAM.
70
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.
74
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.
79
80 **/
81 typedef
82 EFI_STATUS
83 (EFIAPI *EFI_SMM_CLOSE) (
84 IN EFI_SMM_ACCESS_PROTOCOL *This,
85 UINTN DescriptorIndex
86 );
87
88 /**
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.
93
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.
98
99 **/
100 typedef
101 EFI_STATUS
102 (EFIAPI *EFI_SMM_LOCK) (
103 IN EFI_SMM_ACCESS_PROTOCOL *This,
104 UINTN DescriptorIndex
105 );
106
107 /**
108 Queries the memory controller for the possible regions that will support SMRAM.
109
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.
113
114 @retval EFI_SUCCESS The chipset supported the given resource.
115 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
116
117 **/
118 typedef
119 EFI_STATUS
120 (EFIAPI *EFI_SMM_CAPABILITIES) (
121 IN EFI_SMM_ACCESS_PROTOCOL *This,
122 IN OUT UINTN *SmramMapSize,
123 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
124 );
125
126 /**
127 @par Protocol Description:
128 This protocol is used to control the visibility of the SMRAM on the platform.
129
130 @param Open
131 Opens the SMRAM.
132
133 @param Close
134 Closes the SMRAM.
135
136 @param Lock
137 Locks the SMRAM.
138
139 @param GetCapabilities
140 Gets information on possible SMRAM regions.
141
142 @param LockState
143 Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
144
145 @param OpenState
146 Indicates the current state of the SMRAM. Set to TRUE if any region is open.
147
148 **/
149 struct _EFI_SMM_ACCESS_PROTOCOL {
150 EFI_SMM_OPEN Open;
151 EFI_SMM_CLOSE Close;
152 EFI_SMM_LOCK Lock;
153 EFI_SMM_CAPABILITIES GetCapabilities;
154 BOOLEAN LockState;
155 BOOLEAN OpenState;
156 };
157
158 extern EFI_GUID gEfiSmmAccessProtocolGuid;
159
160 #endif