]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/AcpiSystemDescriptionTable.h
MdePkg: Add the missing spec version information for header files
[mirror_edk2.git] / MdePkg / Include / Protocol / AcpiSystemDescriptionTable.h
1 /** @file
2 This protocol provides services for creating ACPI system description tables.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 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 @par Revision Reference:
14 This Protocol was introduced in PI Specification 1.2.
15
16 **/
17
18 #ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
19 #define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
20
21 #define EFI_ACPI_SDT_PROTOCOL_GUID \
22 { 0xeb97088e, 0xcfdf, 0x49c6, { 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }}
23
24 typedef UINT32 EFI_ACPI_TABLE_VERSION;
25 typedef VOID *EFI_ACPI_HANDLE;
26
27 #define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
28 #define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
29 #define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
30 #define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
31 #define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)
32 #define EFI_ACPI_TABLE_VERSION_5_0 (1 << 5)
33
34 typedef UINT32 EFI_ACPI_DATA_TYPE;
35 #define EFI_ACPI_DATA_TYPE_NONE 0
36 #define EFI_ACPI_DATA_TYPE_OPCODE 1
37 #define EFI_ACPI_DATA_TYPE_NAME_STRING 2
38 #define EFI_ACPI_DATA_TYPE_OP 3
39 #define EFI_ACPI_DATA_TYPE_UINT 4
40 #define EFI_ACPI_DATA_TYPE_STRING 5
41 #define EFI_ACPI_DATA_TYPE_CHILD 6
42
43 typedef struct {
44 UINT32 Signature;
45 UINT32 Length;
46 UINT8 Revision;
47 UINT8 Checksum;
48 CHAR8 OemId[6];
49 CHAR8 OemTableId[8];
50 UINT32 OemRevision;
51 UINT32 CreatorId;
52 UINT32 CreatorRevision;
53 } EFI_ACPI_SDT_HEADER;
54
55 typedef
56 EFI_STATUS
57 (EFIAPI *EFI_ACPI_NOTIFICATION_FN)(
58 IN EFI_ACPI_SDT_HEADER *Table, ///< A pointer to the ACPI table header.
59 IN EFI_ACPI_TABLE_VERSION Version, ///< The ACPI table's version.
60 IN UINTN TableKey ///< The table key for this ACPI table.
61 );
62
63 /**
64 Returns a requested ACPI table.
65
66 The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated
67 with the Index that was input. The following structures are not considered elements in the list of
68 ACPI tables:
69 - Root System Description Pointer (RSD_PTR)
70 - Root System Description Table (RSDT)
71 - Extended System Description Table (XSDT)
72 Version is updated with a bit map containing all the versions of ACPI of which the table is a
73 member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,
74 the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.
75
76 @param[in] Index The zero-based index of the table to retrieve.
77 @param[out] Table Pointer for returning the table buffer.
78 @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type
79 EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the
80 EFI_ACPI_SDT_PROTOCOL.
81 @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.
82 This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.
83 The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()
84 to uninstall the table.
85
86 @retval EFI_SUCCESS The function completed successfully.
87 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
88 **/
89 typedef
90 EFI_STATUS
91 (EFIAPI *EFI_ACPI_GET_ACPI_TABLE2)(
92 IN UINTN Index,
93 OUT EFI_ACPI_SDT_HEADER **Table,
94 OUT EFI_ACPI_TABLE_VERSION *Version,
95 OUT UINTN *TableKey
96 );
97
98 /**
99 Register or unregister a callback when an ACPI table is installed.
100
101 This function registers or unregisters a function which will be called whenever a new ACPI table is
102 installed.
103
104 @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified
105 function will be unregistered.
106 @param[in] Notification Points to the callback function to be registered or unregistered.
107
108 @retval EFI_SUCCESS Callback successfully registered or unregistered.
109 @retval EFI_INVALID_PARAMETER Notification is NULL
110 @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.
111 **/
112 typedef
113 EFI_STATUS
114 (EFIAPI *EFI_ACPI_REGISTER_NOTIFY)(
115 IN BOOLEAN Register,
116 IN EFI_ACPI_NOTIFICATION_FN Notification
117 );
118
119 /**
120 Create a handle from an ACPI opcode
121
122 @param[in] Buffer Points to the ACPI opcode.
123 @param[out] Handle Upon return, holds the handle.
124
125 @retval EFI_SUCCESS Success
126 @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an
127 invalid opcode.
128
129 **/
130 typedef
131 EFI_STATUS
132 (EFIAPI *EFI_ACPI_OPEN)(
133 IN VOID *Buffer,
134 OUT EFI_ACPI_HANDLE *Handle
135 );
136
137 /**
138 Create a handle for the first ACPI opcode in an ACPI system description table.
139
140 @param[in] TableKey The table key for the ACPI table, as returned by GetTable().
141 @param[out] Handle On return, points to the newly created ACPI handle.
142
143 @retval EFI_SUCCESS Handle created successfully.
144 @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.
145 **/
146 typedef
147 EFI_STATUS
148 (EFIAPI *EFI_ACPI_OPEN_SDT)(
149 IN UINTN TableKey,
150 OUT EFI_ACPI_HANDLE *Handle
151 );
152
153 /**
154 Close an ACPI handle.
155
156 @param[in] Handle Returns the handle.
157
158 @retval EFI_SUCCESS Success
159 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
160 **/
161 typedef
162 EFI_STATUS
163 (EFIAPI *EFI_ACPI_CLOSE)(
164 IN EFI_ACPI_HANDLE Handle
165 );
166
167 /**
168 Return the child ACPI objects.
169
170 @param[in] ParentHandle Parent handle.
171 @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first
172 handle. On return, points to the next returned ACPI handle or NULL if there are no
173 child objects.
174
175 @retval EFI_SUCCESS Success
176 @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.
177 **/
178 typedef
179 EFI_STATUS
180 (EFIAPI *EFI_ACPI_GET_CHILD)(
181 IN EFI_ACPI_HANDLE ParentHandle,
182 IN OUT EFI_ACPI_HANDLE *Handle
183 );
184
185 /**
186 Retrieve information about an ACPI object.
187
188 @param[in] Handle ACPI object handle.
189 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
190 in the ACPI encoding, with index 0 always being the ACPI opcode.
191 @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists
192 for the specified index.
193 @param[out] Data Upon return, points to the pointer to the data.
194 @param[out] DataSize Upon return, points to the size of Data.
195
196 @retval
197 **/
198 typedef
199 EFI_STATUS
200 (EFIAPI *EFI_ACPI_GET_OPTION)(
201 IN EFI_ACPI_HANDLE Handle,
202 IN UINTN Index,
203 OUT EFI_ACPI_DATA_TYPE *DataType,
204 OUT CONST VOID **Data,
205 OUT UINTN *DataSize
206 );
207
208 /**
209 Change information about an ACPI object.
210
211 @param[in] Handle ACPI object handle.
212 @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right
213 in the ACPI encoding, with index 0 always being the ACPI opcode.
214 @param[in] Data Points to the data.
215 @param[in] DataSize The size of the Data.
216
217 @retval EFI_SUCCESS Success
218 @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.
219 @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by
220 the option.
221
222 **/
223 typedef
224 EFI_STATUS
225 (EFIAPI *EFI_ACPI_SET_OPTION)(
226 IN EFI_ACPI_HANDLE Handle,
227 IN UINTN Index,
228 IN CONST VOID *Data,
229 IN UINTN DataSize
230 );
231
232 /**
233 Returns the handle of the ACPI object representing the specified ACPI path
234
235 @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.
236 @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.
237 @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to
238 HandleIn.
239
240 @retval EFI_SUCCESS Success
241 @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.
242 **/
243 typedef
244 EFI_STATUS
245 (EFIAPI *EFI_ACPI_FIND_PATH)(
246 IN EFI_ACPI_HANDLE HandleIn,
247 IN VOID *AcpiPath,
248 OUT EFI_ACPI_HANDLE *HandleOut
249 );
250
251 typedef struct _EFI_ACPI_SDT_PROTOCOL {
252 ///
253 /// A bit map containing all the ACPI versions supported by this protocol.
254 ///
255 EFI_ACPI_TABLE_VERSION AcpiVersion;
256 EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable;
257 EFI_ACPI_REGISTER_NOTIFY RegisterNotify;
258 EFI_ACPI_OPEN Open;
259 EFI_ACPI_OPEN_SDT OpenSdt;
260 EFI_ACPI_CLOSE Close;
261 EFI_ACPI_GET_CHILD GetChild;
262 EFI_ACPI_GET_OPTION GetOption;
263 EFI_ACPI_SET_OPTION SetOption;
264 EFI_ACPI_FIND_PATH FindPath;
265 } EFI_ACPI_SDT_PROTOCOL;
266
267 extern EFI_GUID gEfiAcpiSdtProtocolGuid;
268
269 #endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___