1 /******************************************************************************
3 * Name: acdisasm.h - AML disassembler
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #ifndef __ACDISASM_H__
45 #define __ACDISASM_H__
53 #define BLOCK_COMMA_LIST 4
54 #define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD"
57 * Raw table data header. Used by disassembler and data table compiler.
60 #define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data"
63 typedef const struct acpi_dmtable_info
72 #define DT_LENGTH 0x01 /* Field is a subtable length */
73 #define DT_FLAG 0x02 /* Field is a flag value */
74 #define DT_NON_ZERO 0x04 /* Field must be non-zero */
76 /* TBD: Not used at this time */
78 #define DT_OPTIONAL 0x08
82 * Values for Opcode above.
83 * Note: 0-7 must not change, they are used as a flag shift value. Other
84 * than those, new values can be added wherever appropriate.
88 /* Simple Data Types */
120 /* Types that are decoded to strings and miscellaneous */
129 /* Types used only for the Data Table Compiler */
132 ACPI_DMT_DEVICE_PATH
,
136 /* Types that are specific to particular ACPI tables */
154 /* Special opcodes */
162 void (*ACPI_DMTABLE_HANDLER
) (
163 ACPI_TABLE_HEADER
*Table
);
166 ACPI_STATUS (*ACPI_CMTABLE_HANDLER
) (
169 typedef struct acpi_dmtable_data
172 ACPI_DMTABLE_INFO
*TableInfo
;
173 ACPI_DMTABLE_HANDLER TableHandler
;
174 ACPI_CMTABLE_HANDLER CmTableHandler
;
175 const unsigned char *Template
;
181 typedef struct acpi_op_walk_info
188 ACPI_WALK_STATE
*WalkState
;
193 * TBD - another copy of this is in asltypes.h, fix
195 #ifndef ASL_WALK_CALLBACK_DEFINED
197 ACPI_STATUS (*ASL_WALK_CALLBACK
) (
198 ACPI_PARSE_OBJECT
*Op
,
201 #define ASL_WALK_CALLBACK_DEFINED
205 void (*ACPI_RESOURCE_HANDLER
) (
206 AML_RESOURCE
*Resource
,
210 typedef struct acpi_resource_tag
217 /* Strings used for decoding flags to ASL keywords */
219 extern const char *AcpiGbl_WordDecode
[];
220 extern const char *AcpiGbl_IrqDecode
[];
221 extern const char *AcpiGbl_LockRule
[];
222 extern const char *AcpiGbl_AccessTypes
[];
223 extern const char *AcpiGbl_UpdateRules
[];
224 extern const char *AcpiGbl_MatchOps
[];
226 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0
[];
227 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1
[];
228 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a
[];
229 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2
[];
230 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a
[];
231 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3
[];
232 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4
[];
233 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr
[];
234 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot
[];
235 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert
[];
236 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt
[];
237 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep
[];
238 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0
[];
239 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0
[];
240 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1
[];
241 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2
[];
242 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2
[];
243 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device
[];
244 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr
[];
245 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size
[];
246 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name
[];
247 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp
[];
248 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar
[];
249 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr
[];
250 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope
[];
251 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0
[];
252 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1
[];
253 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2
[];
254 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3
[];
255 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm
[];
256 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt
[];
257 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj
[];
258 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0
[];
259 extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst
[];
260 extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0
[];
261 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs
[];
262 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1
[];
263 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2
[];
264 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3
[];
265 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5
[];
266 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt
[];
267 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr
[];
268 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0
[];
269 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1
[];
270 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas
[];
271 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt
[];
272 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader
[];
273 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest
[];
274 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0
[];
275 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest1
[];
276 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest2
[];
277 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6
[];
278 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7
[];
279 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8
[];
280 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9
[];
281 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify
[];
282 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank
[];
283 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet
[];
284 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs
[];
285 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0
[];
286 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1
[];
287 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4
[];
288 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a
[];
289 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b
[];
290 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c
[];
291 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr
[];
292 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt
[];
293 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0
[];
294 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1
[];
295 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt2
[];
296 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt3
[];
297 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt4
[];
298 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt5
[];
299 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt6
[];
300 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7
[];
301 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8
[];
302 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9
[];
303 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10
[];
304 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11
[];
305 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12
[];
306 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr
[];
307 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg
[];
308 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0
[];
309 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi
[];
310 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst
[];
311 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0
[];
312 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A
[];
313 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B
[];
314 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1
[];
315 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2
[];
316 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct
[];
317 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0
[];
318 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr
[];
319 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0
[];
320 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt
[];
321 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0
[];
322 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1
[];
323 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a
[];
324 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2
[];
325 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr
[];
326 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct
[];
327 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0
[];
328 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1
[];
329 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2
[];
330 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt
[];
331 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr
[];
332 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0
[];
333 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1
[];
334 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst
[];
335 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr
[];
336 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0
[];
337 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1
[];
338 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit
[];
339 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr
[];
340 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi
[];
341 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat
[];
342 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr
[];
343 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0
[];
344 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1
[];
345 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2
[];
346 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa
[];
347 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2
[];
348 extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi
[];
349 extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc
[];
350 extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0
[];
351 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet
[];
352 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat
[];
353 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0
[];
354 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt
[];
355 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt
[];
357 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric
[][2];
363 extern ACPI_DMTABLE_DATA AcpiDmTableData
[];
366 AcpiDmGenerateChecksum (
369 UINT8 OriginalChecksum
);
376 AcpiDmDumpDataTable (
377 ACPI_TABLE_HEADER
*Table
);
384 UINT32 SubTableLength
,
385 ACPI_DMTABLE_INFO
*Info
);
406 ACPI_TABLE_HEADER
*Table
);
410 ACPI_TABLE_HEADER
*Table
);
414 ACPI_TABLE_HEADER
*Table
);
418 ACPI_TABLE_HEADER
*Table
);
422 ACPI_TABLE_HEADER
*Table
);
426 ACPI_TABLE_HEADER
*Table
);
430 ACPI_TABLE_HEADER
*Table
);
434 ACPI_TABLE_HEADER
*Table
);
438 ACPI_TABLE_HEADER
*Table
);
442 ACPI_TABLE_HEADER
*Table
);
446 ACPI_TABLE_HEADER
*Table
);
450 ACPI_TABLE_HEADER
*Table
);
454 ACPI_TABLE_HEADER
*Table
);
458 ACPI_TABLE_HEADER
*Table
);
462 ACPI_TABLE_HEADER
*Table
);
466 ACPI_TABLE_HEADER
*Table
);
470 ACPI_TABLE_HEADER
*Table
);
474 ACPI_TABLE_HEADER
*Table
);
478 ACPI_TABLE_HEADER
*Table
);
482 ACPI_TABLE_HEADER
*Table
);
486 ACPI_TABLE_HEADER
*Table
);
490 ACPI_TABLE_HEADER
*Table
);
494 ACPI_TABLE_HEADER
*Table
);
498 ACPI_TABLE_HEADER
*Table
);
502 ACPI_TABLE_HEADER
*Table
);
506 ACPI_TABLE_HEADER
*Table
);
510 ACPI_TABLE_HEADER
*Table
);
518 ACPI_WALK_STATE
*WalkState
,
519 ACPI_PARSE_OBJECT
*Origin
,
523 AcpiDmWalkParseTree (
524 ACPI_PARSE_OBJECT
*Op
,
525 ASL_WALK_CALLBACK DescendingCallback
,
526 ASL_WALK_CALLBACK AscendingCallback
,
534 AcpiDmDisassembleOneOp (
535 ACPI_WALK_STATE
*WalkState
,
536 ACPI_OP_WALK_INFO
*Info
,
537 ACPI_PARSE_OBJECT
*Op
);
540 AcpiDmDecodeInternalObject (
541 ACPI_OPERAND_OBJECT
*ObjDesc
);
545 ACPI_PARSE_OBJECT
*Op
);
549 ACPI_PARSE_OBJECT
*Op
);
552 AcpiDmPredefinedDescription (
553 ACPI_PARSE_OBJECT
*Op
);
556 AcpiDmFieldPredefinedDescription (
557 ACPI_PARSE_OBJECT
*Op
);
561 ACPI_PARSE_OBJECT
*Op
);
569 ACPI_PARSE_OBJECT
*Op
);
573 ACPI_PARSE_OBJECT
*Op
);
584 AcpiPsDisplayObjectPathname (
585 ACPI_WALK_STATE
*WalkState
,
586 ACPI_PARSE_OBJECT
*Op
);
597 AcpiDmDisplayInternalObject (
598 ACPI_OPERAND_OBJECT
*ObjDesc
,
599 ACPI_WALK_STATE
*WalkState
);
602 AcpiDmDisplayArguments (
603 ACPI_WALK_STATE
*WalkState
);
606 AcpiDmDisplayLocals (
607 ACPI_WALK_STATE
*WalkState
);
610 AcpiDmDumpMethodInfo (
612 ACPI_WALK_STATE
*WalkState
,
613 ACPI_PARSE_OBJECT
*Op
);
620 AcpiDmDisasmByteList (
627 ACPI_OP_WALK_INFO
*Info
,
628 ACPI_PARSE_OBJECT
*Op
);
632 ACPI_PARSE_OBJECT
*Op
);
639 AcpiDmIsUnicodeBuffer (
640 ACPI_PARSE_OBJECT
*Op
);
643 AcpiDmIsStringBuffer (
644 ACPI_PARSE_OBJECT
*Op
);
648 ACPI_PARSE_OBJECT
*Op
);
655 AcpiDmParseDeferredOps (
656 ACPI_PARSE_OBJECT
*Root
);
663 AcpiDmAddToExternalFileList (
667 AcpiDmClearExternalFileList (
671 AcpiDmAddToExternalList (
672 ACPI_PARSE_OBJECT
*Op
,
678 AcpiDmAddExternalsToNamespace (
682 AcpiDmGetExternalMethodCount (
686 AcpiDmClearExternalList (
690 AcpiDmEmitExternals (
694 AcpiDmUnresolvedWarning (
698 AcpiDmGetExternalsFromFile (
710 AcpiDmDumpInteger16 (
715 AcpiDmDumpInteger32 (
720 AcpiDmDumpInteger64 (
725 AcpiDmResourceTemplate (
726 ACPI_OP_WALK_INFO
*Info
,
727 ACPI_PARSE_OBJECT
*Op
,
732 AcpiDmIsResourceTemplate (
733 ACPI_WALK_STATE
*WalkState
,
734 ACPI_PARSE_OBJECT
*Op
);
741 AcpiDmDescriptorName (
749 AcpiDmWordDescriptor (
750 AML_RESOURCE
*Resource
,
755 AcpiDmDwordDescriptor (
756 AML_RESOURCE
*Resource
,
761 AcpiDmExtendedDescriptor (
762 AML_RESOURCE
*Resource
,
767 AcpiDmQwordDescriptor (
768 AML_RESOURCE
*Resource
,
773 AcpiDmMemory24Descriptor (
774 AML_RESOURCE
*Resource
,
779 AcpiDmMemory32Descriptor (
780 AML_RESOURCE
*Resource
,
785 AcpiDmFixedMemory32Descriptor (
786 AML_RESOURCE
*Resource
,
791 AcpiDmGenericRegisterDescriptor (
792 AML_RESOURCE
*Resource
,
797 AcpiDmInterruptDescriptor (
798 AML_RESOURCE
*Resource
,
803 AcpiDmVendorLargeDescriptor (
804 AML_RESOURCE
*Resource
,
809 AcpiDmGpioDescriptor (
810 AML_RESOURCE
*Resource
,
815 AcpiDmSerialBusDescriptor (
816 AML_RESOURCE
*Resource
,
832 AcpiDmIrqDescriptor (
833 AML_RESOURCE
*Resource
,
838 AcpiDmDmaDescriptor (
839 AML_RESOURCE
*Resource
,
844 AcpiDmFixedDmaDescriptor (
845 AML_RESOURCE
*Resource
,
851 AML_RESOURCE
*Resource
,
856 AcpiDmFixedIoDescriptor (
857 AML_RESOURCE
*Resource
,
862 AcpiDmStartDependentDescriptor (
863 AML_RESOURCE
*Resource
,
868 AcpiDmEndDependentDescriptor (
869 AML_RESOURCE
*Resource
,
874 AcpiDmVendorSmallDescriptor (
875 AML_RESOURCE
*Resource
,
884 AcpiDmDecodeAttribute (
892 AcpiDmCommaIfListMember (
893 ACPI_PARSE_OBJECT
*Op
);
896 AcpiDmCommaIfFieldMember (
897 ACPI_PARSE_OBJECT
*Op
);
904 AcpiDmFindResources (
905 ACPI_PARSE_OBJECT
*Root
);
908 AcpiDmCheckResourceReference (
909 ACPI_PARSE_OBJECT
*Op
,
910 ACPI_WALK_STATE
*WalkState
);
917 AdDisassemblerHeader (
921 #endif /* __ACDISASM_H__ */