]>
Commit | Line | Data |
---|---|---|
3dc8585e JY |
1 | /** @file\r |
2 | ACPI Sdt Protocol Driver\r | |
3 | \r | |
d1102dba | 4 | Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
3dc8585e JY |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _ACPI_SDT_H_\r | |
10 | #define _ACPI_SDT_H_\r | |
11 | \r | |
3dc8585e JY |
12 | //\r |
13 | // Privacy data structure\r | |
14 | //\r | |
15 | \r | |
16 | //\r | |
17 | // ACPI Notify Linked List Signature.\r | |
18 | //\r | |
1436aea4 | 19 | #define EFI_ACPI_NOTIFY_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'N', 'L')\r |
3dc8585e JY |
20 | \r |
21 | //\r | |
22 | // ACPI Notify List Entry definition.\r | |
23 | //\r | |
24 | // Signature must be set to EFI_ACPI_NOTIFY_LIST_SIGNATURE\r | |
25 | // Link is the linked list data.\r | |
26 | // Notification is the callback function.\r | |
27 | //\r | |
28 | typedef struct {\r | |
1436aea4 MK |
29 | UINT32 Signature;\r |
30 | LIST_ENTRY Link;\r | |
31 | EFI_ACPI_NOTIFICATION_FN Notification;\r | |
3dc8585e JY |
32 | } EFI_ACPI_NOTIFY_LIST;\r |
33 | \r | |
34 | //\r | |
35 | // Containment record for ACPI Notify linked list.\r | |
36 | //\r | |
37 | #define EFI_ACPI_NOTIFY_LIST_FROM_LINK(_link) CR (_link, EFI_ACPI_NOTIFY_LIST, Link, EFI_ACPI_NOTIFY_LIST_SIGNATURE)\r | |
38 | \r | |
1436aea4 MK |
39 | typedef struct _AML_BYTE_ENCODING AML_BYTE_ENCODING;\r |
40 | typedef struct _EFI_AML_NODE_LIST EFI_AML_NODE_LIST;\r | |
3dc8585e JY |
41 | \r |
42 | //\r | |
43 | // AML Node Linked List Signature.\r | |
44 | //\r | |
1436aea4 | 45 | #define EFI_AML_NODE_LIST_SIGNATURE SIGNATURE_32 ('E', 'A', 'M', 'L')\r |
3dc8585e JY |
46 | \r |
47 | //\r | |
48 | // AML Node Linked List Entry definition.\r | |
49 | //\r | |
50 | // Signature must be set to EFI_AML_NODE_LIST_SIGNATURE\r | |
51 | // Link is the linked list data.\r | |
52 | // Name is the ACPI node name.\r | |
53 | // This is listed for PATH finding.\r | |
54 | // Buffer is the ACPI node buffer pointer, the first/second bytes are opcode.\r | |
55 | // This buffer should not be freed.\r | |
56 | // Size is the total size of this ACPI node buffer.\r | |
57 | // Children is the children linked list of this node.\r | |
58 | //\r | |
3dc8585e JY |
59 | \r |
60 | struct _EFI_AML_NODE_LIST {\r | |
1436aea4 MK |
61 | UINT32 Signature;\r |
62 | UINT8 Name[AML_NAME_SEG_SIZE];\r | |
63 | UINT8 *Buffer;\r | |
64 | UINTN Size;\r | |
65 | LIST_ENTRY Link;\r | |
66 | LIST_ENTRY Children;\r | |
67 | EFI_AML_NODE_LIST *Parent;\r | |
68 | AML_BYTE_ENCODING *AmlByteEncoding;\r | |
3dc8585e JY |
69 | };\r |
70 | \r | |
71 | //\r | |
72 | // Containment record for AML Node linked list.\r | |
73 | //\r | |
74 | #define EFI_AML_NODE_LIST_FROM_LINK(_link) CR (_link, EFI_AML_NODE_LIST, Link, EFI_AML_NODE_LIST_SIGNATURE)\r | |
75 | \r | |
76 | //\r | |
77 | // AML Handle Signature.\r | |
78 | //\r | |
1436aea4 MK |
79 | #define EFI_AML_HANDLE_SIGNATURE SIGNATURE_32 ('E', 'A', 'H', 'S')\r |
80 | #define EFI_AML_ROOT_HANDLE_SIGNATURE SIGNATURE_32 ('E', 'A', 'R', 'H')\r | |
3dc8585e JY |
81 | \r |
82 | //\r | |
83 | // AML Handle Entry definition.\r | |
84 | //\r | |
85 | // Signature must be set to EFI_AML_HANDLE_SIGNATURE or EFI_AML_ROOT_HANDLE_SIGNATURE\r | |
86 | // Buffer is the ACPI node buffer pointer, the first/second bytes are opcode.\r | |
87 | // This buffer should not be freed.\r | |
88 | // Size is the total size of this ACPI node buffer.\r | |
89 | //\r | |
90 | typedef struct {\r | |
1436aea4 MK |
91 | UINT32 Signature;\r |
92 | UINT8 *Buffer;\r | |
93 | UINTN Size;\r | |
94 | AML_BYTE_ENCODING *AmlByteEncoding;\r | |
95 | BOOLEAN Modified;\r | |
3dc8585e JY |
96 | } EFI_AML_HANDLE;\r |
97 | \r | |
98 | typedef UINT32 AML_OP_PARSE_INDEX;\r | |
99 | \r | |
1436aea4 MK |
100 | #define AML_OP_PARSE_INDEX_GET_OPCODE 0\r |
101 | #define AML_OP_PARSE_INDEX_GET_TERM1 1\r | |
102 | #define AML_OP_PARSE_INDEX_GET_TERM2 2\r | |
103 | #define AML_OP_PARSE_INDEX_GET_TERM3 3\r | |
104 | #define AML_OP_PARSE_INDEX_GET_TERM4 4\r | |
105 | #define AML_OP_PARSE_INDEX_GET_TERM5 5\r | |
106 | #define AML_OP_PARSE_INDEX_GET_TERM6 6\r | |
107 | #define AML_OP_PARSE_INDEX_GET_SIZE (AML_OP_PARSE_INDEX)-1\r | |
3dc8585e JY |
108 | \r |
109 | typedef UINT32 AML_OP_PARSE_FORMAT;\r | |
1436aea4 MK |
110 | #define AML_NONE 0\r |
111 | #define AML_OPCODE 1\r | |
112 | #define AML_UINT8 2\r | |
113 | #define AML_UINT16 3\r | |
114 | #define AML_UINT32 4\r | |
115 | #define AML_UINT64 5\r | |
116 | #define AML_NAME 6\r | |
117 | #define AML_STRING 7\r | |
118 | #define AML_OBJECT 8\r | |
3dc8585e JY |
119 | \r |
120 | typedef UINT32 AML_OP_ATTRIBUTE;\r | |
1436aea4 MK |
121 | #define AML_HAS_PKG_LENGTH 0x1 // It is ACPI attribute - if OpCode has PkgLength\r |
122 | #define AML_IS_NAME_CHAR 0x2 // It is ACPI attribute - if this is NameChar\r | |
123 | #define AML_HAS_CHILD_OBJ 0x4 // it is ACPI attribute - if OpCode has Child Object.\r | |
124 | #define AML_IN_NAMESPACE 0x10000 // It is UEFI SDT attribute - if OpCode will be in NameSpace\r | |
3dc8585e | 125 | // NOTE; Not all OBJECT will be in NameSpace\r |
d1102dba | 126 | // For example, BankField | CreateBitField | CreateByteField | CreateDWordField |\r |
3dc8585e JY |
127 | // CreateField | CreateQWordField | CreateWordField | Field | IndexField.\r |
128 | \r | |
129 | struct _AML_BYTE_ENCODING {\r | |
1436aea4 MK |
130 | UINT8 OpCode;\r |
131 | UINT8 SubOpCode;\r | |
132 | AML_OP_PARSE_INDEX MaxIndex;\r | |
133 | AML_OP_PARSE_FORMAT Format[6];\r | |
134 | AML_OP_ATTRIBUTE Attribute;\r | |
3dc8585e JY |
135 | };\r |
136 | \r | |
137 | //\r | |
138 | // AcpiSdt protocol declaration\r | |
139 | //\r | |
140 | \r | |
141 | /**\r | |
142 | Returns a requested ACPI table.\r | |
d1102dba | 143 | \r |
3dc8585e JY |
144 | The GetAcpiTable() function returns a pointer to a buffer containing the ACPI table associated\r |
145 | with the Index that was input. The following structures are not considered elements in the list of\r | |
146 | ACPI tables:\r | |
147 | - Root System Description Pointer (RSD_PTR)\r | |
148 | - Root System Description Table (RSDT)\r | |
149 | - Extended System Description Table (XSDT)\r | |
150 | Version is updated with a bit map containing all the versions of ACPI of which the table is a\r | |
f0071740 SZ |
151 | member. For tables installed via the EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable() interface,\r |
152 | the function returns the value of EFI_ACPI_STD_PROTOCOL.AcpiVersion.\r | |
d1102dba | 153 | \r |
3dc8585e JY |
154 | @param[in] Index The zero-based index of the table to retrieve.\r |
155 | @param[out] Table Pointer for returning the table buffer.\r | |
156 | @param[out] Version On return, updated with the ACPI versions to which this table belongs. Type\r | |
157 | EFI_ACPI_TABLE_VERSION is defined in "Related Definitions" in the\r | |
d1102dba | 158 | EFI_ACPI_SDT_PROTOCOL.\r |
f0071740 SZ |
159 | @param[out] TableKey On return, points to the table key for the specified ACPI system definition table.\r |
160 | This is identical to the table key used in the EFI_ACPI_TABLE_PROTOCOL.\r | |
161 | The TableKey can be passed to EFI_ACPI_TABLE_PROTOCOL.UninstallAcpiTable()\r | |
162 | to uninstall the table.\r | |
d1102dba | 163 | \r |
3dc8585e | 164 | @retval EFI_SUCCESS The function completed successfully.\r |
d1102dba LG |
165 | @retval EFI_NOT_FOUND The requested index is too large and a table was not found.\r |
166 | **/\r | |
3dc8585e JY |
167 | EFI_STATUS\r |
168 | EFIAPI\r | |
169 | GetAcpiTable2 (\r | |
1436aea4 MK |
170 | IN UINTN Index,\r |
171 | OUT EFI_ACPI_SDT_HEADER **Table,\r | |
172 | OUT EFI_ACPI_TABLE_VERSION *Version,\r | |
173 | OUT UINTN *TableKey\r | |
3dc8585e JY |
174 | );\r |
175 | \r | |
176 | /**\r | |
177 | Register or unregister a callback when an ACPI table is installed.\r | |
d1102dba | 178 | \r |
3dc8585e JY |
179 | This function registers or unregisters a function which will be called whenever a new ACPI table is\r |
180 | installed.\r | |
d1102dba | 181 | \r |
3dc8585e JY |
182 | @param[in] Register If TRUE, then the specified function will be registered. If FALSE, then the specified\r |
183 | function will be unregistered.\r | |
184 | @param[in] Notification Points to the callback function to be registered or unregistered.\r | |
d1102dba | 185 | \r |
3dc8585e JY |
186 | @retval EFI_SUCCESS Callback successfully registered or unregistered.\r |
187 | @retval EFI_INVALID_PARAMETER Notification is NULL\r | |
d1102dba | 188 | @retval EFI_INVALID_PARAMETER Register is FALSE and Notification does not match a known registration function.\r |
3dc8585e JY |
189 | **/\r |
190 | EFI_STATUS\r | |
191 | EFIAPI\r | |
192 | RegisterNotify (\r | |
1436aea4 MK |
193 | IN BOOLEAN Register,\r |
194 | IN EFI_ACPI_NOTIFICATION_FN Notification\r | |
3dc8585e JY |
195 | );\r |
196 | \r | |
197 | /**\r | |
198 | Create a handle for the first ACPI opcode in an ACPI system description table.\r | |
d1102dba | 199 | \r |
3dc8585e JY |
200 | @param[in] TableKey The table key for the ACPI table, as returned by GetTable().\r |
201 | @param[out] Handle On return, points to the newly created ACPI handle.\r | |
202 | \r | |
203 | @retval EFI_SUCCESS Handle created successfully.\r | |
d1102dba | 204 | @retval EFI_NOT_FOUND TableKey does not refer to a valid ACPI table.\r |
3dc8585e JY |
205 | **/\r |
206 | EFI_STATUS\r | |
207 | EFIAPI\r | |
208 | OpenSdt (\r | |
1436aea4 MK |
209 | IN UINTN TableKey,\r |
210 | OUT EFI_ACPI_HANDLE *Handle\r | |
3dc8585e JY |
211 | );\r |
212 | \r | |
213 | /**\r | |
214 | Create a handle from an ACPI opcode\r | |
d1102dba | 215 | \r |
3dc8585e JY |
216 | @param[in] Buffer Points to the ACPI opcode.\r |
217 | @param[out] Handle Upon return, holds the handle.\r | |
d1102dba | 218 | \r |
3dc8585e JY |
219 | @retval EFI_SUCCESS Success\r |
220 | @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an\r | |
221 | invalid opcode.\r | |
d1102dba | 222 | \r |
3dc8585e JY |
223 | **/\r |
224 | EFI_STATUS\r | |
225 | EFIAPI\r | |
226 | Open (\r | |
1436aea4 MK |
227 | IN VOID *Buffer,\r |
228 | OUT EFI_ACPI_HANDLE *Handle\r | |
3dc8585e JY |
229 | );\r |
230 | \r | |
231 | /**\r | |
232 | Close an ACPI handle.\r | |
d1102dba | 233 | \r |
3dc8585e | 234 | @param[in] Handle Returns the handle.\r |
d1102dba | 235 | \r |
3dc8585e | 236 | @retval EFI_SUCCESS Success\r |
d1102dba | 237 | @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.\r |
3dc8585e JY |
238 | **/\r |
239 | EFI_STATUS\r | |
240 | EFIAPI\r | |
241 | Close (\r | |
1436aea4 | 242 | IN EFI_ACPI_HANDLE Handle\r |
3dc8585e JY |
243 | );\r |
244 | \r | |
245 | /**\r | |
246 | Retrieve information about an ACPI object.\r | |
d1102dba | 247 | \r |
3dc8585e JY |
248 | @param[in] Handle ACPI object handle.\r |
249 | @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r | |
250 | in the ACPI encoding, with index 0 always being the ACPI opcode.\r | |
251 | @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists\r | |
252 | for the specified index.\r | |
253 | @param[out] Data Upon return, points to the pointer to the data.\r | |
254 | @param[out] DataSize Upon return, points to the size of Data.\r | |
d1102dba | 255 | \r |
3dc8585e JY |
256 | @retval EFI_SUCCESS Success.\r |
257 | @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.\r | |
258 | **/\r | |
259 | EFI_STATUS\r | |
260 | EFIAPI\r | |
261 | GetOption (\r | |
262 | IN EFI_ACPI_HANDLE Handle,\r | |
263 | IN UINTN Index,\r | |
264 | OUT EFI_ACPI_DATA_TYPE *DataType,\r | |
265 | OUT CONST VOID **Data,\r | |
266 | OUT UINTN *DataSize\r | |
267 | );\r | |
268 | \r | |
269 | /**\r | |
270 | Change information about an ACPI object.\r | |
d1102dba | 271 | \r |
3dc8585e JY |
272 | @param[in] Handle ACPI object handle.\r |
273 | @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r | |
274 | in the ACPI encoding, with index 0 always being the ACPI opcode.\r | |
275 | @param[in] Data Points to the data.\r | |
276 | @param[in] DataSize The size of the Data.\r | |
277 | \r | |
278 | @retval EFI_SUCCESS Success\r | |
279 | @retval EFI_INVALID_PARAMETER Handle is NULL or does not refer to a valid ACPI object.\r | |
280 | @retval EFI_BAD_BUFFER_SIZE Data cannot be accommodated in the space occupied by\r | |
281 | the option.\r | |
282 | \r | |
283 | **/\r | |
284 | EFI_STATUS\r | |
285 | EFIAPI\r | |
286 | SetOption (\r | |
1436aea4 MK |
287 | IN EFI_ACPI_HANDLE Handle,\r |
288 | IN UINTN Index,\r | |
289 | IN CONST VOID *Data,\r | |
290 | IN UINTN DataSize\r | |
3dc8585e JY |
291 | );\r |
292 | \r | |
293 | /**\r | |
294 | Return the child ACPI objects.\r | |
d1102dba | 295 | \r |
3dc8585e JY |
296 | @param[in] ParentHandle Parent handle.\r |
297 | @param[in, out] Handle On entry, points to the previously returned handle or NULL to start with the first\r | |
298 | handle. On return, points to the next returned ACPI handle or NULL if there are no\r | |
299 | child objects.\r | |
300 | \r | |
301 | @retval EFI_SUCCESS Success\r | |
d1102dba | 302 | @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.\r |
3dc8585e JY |
303 | **/\r |
304 | EFI_STATUS\r | |
305 | EFIAPI\r | |
306 | GetChild (\r | |
1436aea4 MK |
307 | IN EFI_ACPI_HANDLE ParentHandle,\r |
308 | IN OUT EFI_ACPI_HANDLE *Handle\r | |
3dc8585e JY |
309 | );\r |
310 | \r | |
311 | /**\r | |
312 | Returns the handle of the ACPI object representing the specified ACPI path\r | |
d1102dba | 313 | \r |
3dc8585e JY |
314 | @param[in] HandleIn Points to the handle of the object representing the starting point for the path search.\r |
315 | @param[in] AcpiPath Points to the ACPI path, which conforms to the ACPI encoded path format.\r | |
316 | @param[out] HandleOut On return, points to the ACPI object which represents AcpiPath, relative to\r | |
317 | HandleIn.\r | |
d1102dba | 318 | \r |
3dc8585e | 319 | @retval EFI_SUCCESS Success\r |
d1102dba | 320 | @retval EFI_INVALID_PARAMETER HandleIn is NULL or does not refer to a valid ACPI object.\r |
3dc8585e JY |
321 | **/\r |
322 | EFI_STATUS\r | |
323 | EFIAPI\r | |
324 | FindPath (\r | |
1436aea4 MK |
325 | IN EFI_ACPI_HANDLE HandleIn,\r |
326 | IN VOID *AcpiPath,\r | |
327 | OUT EFI_ACPI_HANDLE *HandleOut\r | |
3dc8585e JY |
328 | );\r |
329 | \r | |
330 | //\r | |
331 | // ACPI SDT function\r | |
332 | //\r | |
333 | \r | |
334 | /**\r | |
335 | Create a handle from an ACPI opcode\r | |
d1102dba | 336 | \r |
3dc8585e JY |
337 | @param[in] Buffer Points to the ACPI opcode.\r |
338 | @param[in] BufferSize Max buffer size.\r | |
339 | @param[out] Handle Upon return, holds the handle.\r | |
d1102dba | 340 | \r |
3dc8585e JY |
341 | @retval EFI_SUCCESS Success\r |
342 | @retval EFI_INVALID_PARAMETER Buffer is NULL or Handle is NULL or Buffer points to an\r | |
343 | invalid opcode.\r | |
d1102dba | 344 | \r |
3dc8585e JY |
345 | **/\r |
346 | EFI_STATUS\r | |
347 | SdtOpenEx (\r | |
1436aea4 MK |
348 | IN VOID *Buffer,\r |
349 | IN UINTN BufferSize,\r | |
350 | OUT EFI_ACPI_HANDLE *Handle\r | |
3dc8585e JY |
351 | );\r |
352 | \r | |
353 | //\r | |
354 | // AML support function\r | |
355 | //\r | |
356 | \r | |
357 | /**\r | |
358 | Get AML NameString size.\r | |
359 | \r | |
360 | @param[in] Buffer AML NameString.\r | |
d1102dba LG |
361 | @param[out] BufferSize AML NameString size\r |
362 | \r | |
3dc8585e JY |
363 | @retval EFI_SUCCESS Success.\r |
364 | @retval EFI_INVALID_PARAMETER Buffer does not refer to a valid AML NameString.\r | |
365 | **/\r | |
366 | EFI_STATUS\r | |
367 | AmlGetNameStringSize (\r | |
1436aea4 MK |
368 | IN UINT8 *Buffer,\r |
369 | OUT UINTN *BufferSize\r | |
3dc8585e JY |
370 | );\r |
371 | \r | |
372 | /**\r | |
373 | This function retuns package length from the buffer.\r | |
374 | \r | |
375 | @param[in] Buffer AML buffer\r | |
376 | @param[out] PkgLength The total length of package.\r | |
377 | \r | |
378 | @return The byte data count to present the package length.\r | |
379 | **/\r | |
380 | UINTN\r | |
381 | AmlGetPkgLength (\r | |
1436aea4 MK |
382 | IN UINT8 *Buffer,\r |
383 | OUT UINTN *PkgLength\r | |
3dc8585e JY |
384 | );\r |
385 | \r | |
386 | /**\r | |
387 | This function returns AcpiDataType according to AmlType.\r | |
388 | \r | |
389 | @param[in] AmlType AML Type.\r | |
390 | \r | |
391 | @return AcpiDataType\r | |
392 | **/\r | |
393 | EFI_ACPI_DATA_TYPE\r | |
394 | AmlTypeToAcpiType (\r | |
395 | IN AML_OP_PARSE_FORMAT AmlType\r | |
396 | );\r | |
397 | \r | |
398 | /**\r | |
399 | This function returns AmlByteEncoding according to OpCode Byte.\r | |
400 | \r | |
401 | @param[in] OpByteBuffer OpCode byte buffer.\r | |
402 | \r | |
403 | @return AmlByteEncoding\r | |
404 | **/\r | |
405 | AML_BYTE_ENCODING *\r | |
406 | AmlSearchByOpByte (\r | |
1436aea4 | 407 | IN UINT8 *OpByteBuffer\r |
3dc8585e JY |
408 | );\r |
409 | \r | |
410 | /**\r | |
411 | Return object size.\r | |
d1102dba | 412 | \r |
3dc8585e JY |
413 | @param[in] AmlByteEncoding AML Byte Encoding.\r |
414 | @param[in] Buffer AML object buffer.\r | |
415 | @param[in] MaxBufferSize AML object buffer MAX size. The parser can not parse any data exceed this region.\r | |
d1102dba | 416 | \r |
3dc8585e JY |
417 | @return Size of the object.\r |
418 | **/\r | |
419 | UINTN\r | |
420 | AmlGetObjectSize (\r | |
1436aea4 MK |
421 | IN AML_BYTE_ENCODING *AmlByteEncoding,\r |
422 | IN UINT8 *Buffer,\r | |
423 | IN UINTN MaxBufferSize\r | |
3dc8585e JY |
424 | );\r |
425 | \r | |
426 | /**\r | |
427 | Return object name.\r | |
d1102dba | 428 | \r |
3dc8585e | 429 | @param[in] AmlHandle AML handle.\r |
d1102dba | 430 | \r |
3dc8585e JY |
431 | @return Name of the object.\r |
432 | **/\r | |
433 | CHAR8 *\r | |
434 | AmlGetObjectName (\r | |
1436aea4 | 435 | IN EFI_AML_HANDLE *AmlHandle\r |
3dc8585e JY |
436 | );\r |
437 | \r | |
438 | /**\r | |
439 | Retrieve information according to AmlHandle\r | |
d1102dba | 440 | \r |
3dc8585e JY |
441 | @param[in] AmlHandle AML handle.\r |
442 | @param[in] Index Index of the data to retrieve from the object. In general, indexes read from left-to-right\r | |
443 | in the ACPI encoding, with index 0 always being the ACPI opcode.\r | |
444 | @param[out] DataType Points to the returned data type or EFI_ACPI_DATA_TYPE_NONE if no data exists\r | |
445 | for the specified index.\r | |
446 | @param[out] Data Upon return, points to the pointer to the data.\r | |
447 | @param[out] DataSize Upon return, points to the size of Data.\r | |
d1102dba | 448 | \r |
3dc8585e JY |
449 | @retval EFI_SUCCESS Success.\r |
450 | @retval EFI_INVALID_PARAMETER AmlHandle does not refer to a valid ACPI object.\r | |
451 | **/\r | |
452 | EFI_STATUS\r | |
453 | AmlParseOptionHandleCommon (\r | |
1436aea4 MK |
454 | IN EFI_AML_HANDLE *AmlHandle,\r |
455 | IN AML_OP_PARSE_INDEX Index,\r | |
456 | OUT EFI_ACPI_DATA_TYPE *DataType,\r | |
457 | OUT VOID **Data,\r | |
458 | OUT UINTN *DataSize\r | |
3dc8585e JY |
459 | );\r |
460 | \r | |
461 | /**\r | |
462 | Return offset of last option.\r | |
d1102dba | 463 | \r |
3dc8585e JY |
464 | @param[in] AmlHandle AML Handle.\r |
465 | @param[out] Buffer Upon return, points to the offset after last option.\r | |
d1102dba | 466 | \r |
3dc8585e JY |
467 | @retval EFI_SUCCESS Success.\r |
468 | @retval EFI_INVALID_PARAMETER AmlHandle does not refer to a valid ACPI object.\r | |
469 | **/\r | |
470 | EFI_STATUS\r | |
471 | AmlGetOffsetAfterLastOption (\r | |
1436aea4 MK |
472 | IN EFI_AML_HANDLE *AmlHandle,\r |
473 | OUT UINT8 **Buffer\r | |
3dc8585e JY |
474 | );\r |
475 | \r | |
476 | /**\r | |
477 | Return the child ACPI objects from Root Handle.\r | |
d1102dba | 478 | \r |
3dc8585e JY |
479 | @param[in] AmlParentHandle Parent handle. It is Root Handle.\r |
480 | @param[in] AmlHandle The previously returned handle or NULL to start with the first handle.\r | |
481 | @param[out] Buffer On return, points to the next returned ACPI handle or NULL if there are no\r | |
482 | child objects.\r | |
483 | \r | |
484 | @retval EFI_SUCCESS Success\r | |
d1102dba | 485 | @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.\r |
3dc8585e JY |
486 | **/\r |
487 | EFI_STATUS\r | |
488 | AmlGetChildFromRoot (\r | |
1436aea4 MK |
489 | IN EFI_AML_HANDLE *AmlParentHandle,\r |
490 | IN EFI_AML_HANDLE *AmlHandle,\r | |
491 | OUT VOID **Buffer\r | |
3dc8585e JY |
492 | );\r |
493 | \r | |
494 | /**\r | |
495 | Return the child ACPI objects from Non-Root Handle.\r | |
d1102dba | 496 | \r |
3dc8585e JY |
497 | @param[in] AmlParentHandle Parent handle. It is Non-Root Handle.\r |
498 | @param[in] AmlHandle The previously returned handle or NULL to start with the first handle.\r | |
499 | @param[out] Buffer On return, points to the next returned ACPI handle or NULL if there are no\r | |
500 | child objects.\r | |
501 | \r | |
502 | @retval EFI_SUCCESS Success\r | |
d1102dba | 503 | @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.\r |
3dc8585e JY |
504 | **/\r |
505 | EFI_STATUS\r | |
506 | AmlGetChildFromNonRoot (\r | |
1436aea4 MK |
507 | IN EFI_AML_HANDLE *AmlParentHandle,\r |
508 | IN EFI_AML_HANDLE *AmlHandle,\r | |
509 | OUT VOID **Buffer\r | |
3dc8585e JY |
510 | );\r |
511 | \r | |
512 | /**\r | |
513 | Return AML name according to ASL name.\r | |
514 | The caller need free the AmlName returned.\r | |
515 | \r | |
516 | @param[in] AslPath ASL name.\r | |
517 | \r | |
518 | @return AmlName\r | |
519 | **/\r | |
520 | UINT8 *\r | |
521 | AmlNameFromAslName (\r | |
1436aea4 | 522 | IN UINT8 *AslPath\r |
3dc8585e JY |
523 | );\r |
524 | \r | |
525 | /**\r | |
526 | Returns the handle of the ACPI object representing the specified ACPI AML path\r | |
d1102dba | 527 | \r |
3dc8585e JY |
528 | @param[in] AmlHandle Points to the handle of the object representing the starting point for the path search.\r |
529 | @param[in] AmlPath Points to the ACPI AML path.\r | |
530 | @param[out] Buffer On return, points to the ACPI object which represents AcpiPath, relative to\r | |
531 | HandleIn.\r | |
532 | @param[in] FromRoot TRUE means to find AML path from \ (Root) Node.\r | |
533 | FALSE means to find AML path from this Node (The HandleIn).\r | |
d1102dba | 534 | \r |
3dc8585e | 535 | @retval EFI_SUCCESS Success\r |
d1102dba | 536 | @retval EFI_INVALID_PARAMETER HandleIn does not refer to a valid ACPI object.\r |
3dc8585e JY |
537 | **/\r |
538 | EFI_STATUS\r | |
539 | AmlFindPath (\r | |
540 | IN EFI_AML_HANDLE *AmlHandle,\r | |
541 | IN UINT8 *AmlPath,\r | |
542 | OUT VOID **Buffer,\r | |
543 | IN BOOLEAN FromRoot\r | |
544 | );\r | |
545 | \r | |
546 | /**\r | |
547 | Print AML NameString.\r | |
548 | \r | |
549 | @param[in] Buffer AML NameString.\r | |
550 | **/\r | |
551 | VOID\r | |
552 | AmlPrintNameString (\r | |
1436aea4 | 553 | IN UINT8 *Buffer\r |
3dc8585e JY |
554 | );\r |
555 | \r | |
556 | /**\r | |
557 | Print AML NameSeg.\r | |
558 | \r | |
559 | @param[in] Buffer AML NameSeg.\r | |
560 | **/\r | |
561 | VOID\r | |
562 | AmlPrintNameSeg (\r | |
1436aea4 | 563 | IN UINT8 *Buffer\r |
3dc8585e JY |
564 | );\r |
565 | \r | |
566 | /**\r | |
567 | Check if it is AML Root name\r | |
568 | \r | |
569 | @param[in] Buffer AML path.\r | |
d1102dba | 570 | \r |
3dc8585e JY |
571 | @retval TRUE AML path is root.\r |
572 | @retval FALSE AML path is not root.\r | |
573 | **/\r | |
574 | BOOLEAN\r | |
575 | AmlIsRootPath (\r | |
1436aea4 | 576 | IN UINT8 *Buffer\r |
3dc8585e JY |
577 | );\r |
578 | \r | |
579 | #endif\r |