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