Iasl: acpi source Language Optimizing Compiler and Disassembler

Download 357.69 Kb.
Date conversion29.04.2016
Size357.69 Kb.
1   2   3   4   5   6   7   8

5.3ACPI Table Template Generator

The Table Template Generator is used to create examples for each of the supported ACPI tables. It emits code in a format similar to the ACPI data table disassembler, and can compiled directly via the ACPI data table compiler.

These templates contain examples of each possible subtable as applicable to the particular table. The template can be used as a starting point for actual ACPI table development.

Use "iasl –T all" to generate a template for every supported table

Example Template file for ECDT:


 * Intel ACPI Component Architecture

 * iASL Compiler/Disassembler version 20100528


 * Template for [ECDT] ACPI Table

 * Format: [ByteLength]  FieldName : HexFieldValue

[004]                          Signature : "ECDT"

[004]                       Table Length : 00000042

[001]                           Revision : 01

[001]                           Checksum : 2D

[006]                             Oem ID : "INTEL "

[008]                       Oem Table ID : "TEMPLATE"

[004]                       Oem Revision : 00000001

[004]                    Asl Compiler ID : "INTL"

[004]              Asl Compiler Revision : 20100528

[012]            Command/Status Register :

[001]                           Space ID : 01 (SystemIO)

[001]                          Bit Width : 08

[001]                         Bit Offset : 00

[001]                       Access Width : 00

[008]                            Address : 0000000000000066

[012]                      Data Register :

[001]                           Space ID : 01 (SystemIO)

[001]                          Bit Width : 08

[001]                         Bit Offset : 00

[001]                       Access Width : 00

[008]                            Address : 0000000000000062

[004]                                UID : 00000000

[001]                         GPE Number : 09

[001]                           Namepath : ""

6Compiler/Disassembler Operation

The iASL compiler is a command line utility that is invoked to translate one or more ASL source files to corresponding AML binary files or the reverse. The syntax of the various command line options is identical across all platforms.

6.1Command Line Invocation

The general command line syntax is as follows:

iasl [options] file1, file2, … fileN

6.2Wildcard Support

Wildcards are supported on all platforms.

On Windows, wildcard support is implemented within the compiler. For other platforms, it is expected that the shell or command line interpreter will automatically expand wildcards into the argv array that is passed to the compiler main().

6.3Command Line Options

All compiler options are specified using the single ‘-‘ (minus) prefix, regardless of the platform of operation. These options are summarized below, and described in detail after.

-@ Specify command file


Specify additional include directory

-T |ALL|* Create table template file for ACPI

Specify path/filename prefix for all output files

-v Display compiler version

-vo Enable optimization comments

-vs Disable signon


-h This message

-hc Display operators allowed in constant expressions

-hf Display help for output filename generation

-hr Display ACPI reserved method names

-ht Display currently supported ACPI table names


-D Define symbol for preprocessor use

-li Create preprocessed output file (*.i)

-P Preprocess only and create preprocessor output file (*.i)

-Pn Disable preprocessor
Errors, Warnings, and Remarks:

-va Disable all errors/warnings/remarks

-ve Report only errors (ignore warnings and remarks)

-vi Less verbose errors and warnings for use with IDEs

-vr Disable remarks

-vw Disable specific warning or remark

-w1 -w2 -w3 Set warning reporting level

-we Report warnings as errors

AML Code Generation (*.aml):

-oa Disable all optimizations (compatibility mode)

-of Disable constant folding

-oi Disable integer optimization to Zero/One/Ones

-on Disable named reference string optimization

-cr Disable Resource Descriptor error checking

-in Ignore NoOp operators

-r Override table header Revision (1-255)

Optional Source Code Output Files:

-sc -sa Create source file in C or assembler (*.c or *.asm)

-ic -ia Create include file in C or assembler (*.h or *.inc)

-tc -ta -ts Create hex AML table in C, assembler, or ASL (*.hex)

-so Create offset table in C (*.offset.h)
Optional Listing Files:

-l Create mixed listing file (ASL source and AML) (*.lst)

-lm Create hardware summary map file (*.map)

-ln Create namespace file (*.nsp)

-ls Create combined source file (expanded includes) (*.src)
Data Table Compiler:

-G Compile custom table that contains generic operators

-vt Create verbose template files (full disassembly)
AML Disassembler:

-d Disassemble or decode binary ACPI tables to file (*.dsl)

(Optional, file type is automatically detected)

-da Disassemble multiple tables from single namespace

-db Do not translate Buffers to Resource Templates

-dc Disassemble AML and immediately compile it

(Obtain DSDT from current system if no input file)

-dl Emit legacy ASL code only (no symbolic operators)

-e Include ACPI table(s) for external symbol resolution

-fe Specify external symbol declaration file

-in Ignore NoOp opcodes

-vt Dump binary table data in hex format within output file

Debug Options:

-bf Create debug file (full output) (*.txt)

-bs Create debug file (parse tree only) (*.txt)

-bp Prune ASL parse tree

-bt Object type to be pruned from the parse tree

-f Ignore errors, force creation of AML output file(s)

-m Set internal line buffer size (in Kbytes)

-n Parse only, no output generation

-ot Display compile times and statistics

-x Set debug level for trace output

-z Do not insert new compiler ID for DataTables

6.3.1General Options

These options affect the compiler globally.

-@ Read additional command line options from a command file. The format of this text file is one complete option per line.


Specify an additional directory for include files. The directory that contains the source ASL file is searched first. Then, any additional directories specified via this option are searched. This option may be invoked an unlimited number of times. Directories are searched in the order they appear on the command line.

-T Create an ACPI Data Table template file. Use “ALL” for the signature to create templates for all ACPI tables known by iASL.

Specify the filename prefix used for all output files, including the .AML file. (This option overrides the output filename specified in the DefinitionBlock of the ASL.)

-v Display compiler version in the format -


Version_number is in the format YYYYMMDD

Build_bit_width is either 32 or 64 and represents the bit width used to generate the compiler.

-vo Enable optimization comments in the listing file. A remark/comment is made wherever an optimization has been performed.

-vs Disable the compiler signon.


-h Help screen

-hc Display a complete list of all ASL operators that are allowed in constant expressions that can be evaluated at compile time. (This is a list of the Type 3, 4, and 5 operators.)

-hf Display help for AML output file name generation.

-hr Display a list of the ACPI predefined names (reserved names.)

-ht Display a list of all supported ACPI tables, both AML and data table.


These options affect the integrated preprocessor.

-D Define symbol for use by the preprocessor.

-li Save the preprocessor output file (*.i) This file contains the output of the preprocessor and is used as input to the main compiler.

-P Preprocess only. Create the preprocessor output file (*.i), but do not invoke the main compiler.

-Pn Disable the preprocessor completely. The input source file is passed directly to the main compiler.

6.3.4Errors, Warnings, and Remarks

These options affect the output of errors and warnings.

-va Disable all errors/warnings/remarks. The compiler signon and compilation summary information are the only messages.

-ve Report errors only. This option ignores warnings and remarks, and is useful for recompiling disassembled ASL code to quickly determine the actual errors in the code.

-vi Provide less verbose errors and warnings in the format required by the MS VC++ environment. This allows the automatic mapping of errors and warnings to the line of ASL source code that caused the message.

-vr Disable all remark messages.

-vw Disable a specific warning or remark. The is emitted with the message.

-w<1|2|3> Set the warning reporting level.

-we Report all warnings as errors.

6.3.5AML Bytecode Generation

These options affect the actual AML code that is generated by the compiler.

-oa Disable all optimizations.

-of Disable the constant folding feature.

-oi Disable integer optimizations to the Zero/One/Ones AML opcodes.

-on Disable named reference string optimizations.

-cr Disable Resource Descriptor error checking.

-in Ignore ASL NoOp operators during compilation. –in. Ignorethe NoOp operator within the ASL source code. Often, the NoOp operator is used as padding for packages that are changed dynamically by the BIOS. When disassembled and recompiled, these NoOps will cause syntax errors. This option causes the compiler to ignore all NoOp statements.

-r Set the revision number of the table header, overriding the existing revision.

6.3.6AML Text Output Files

The compiler always emits a binary AML table. These options allow the compiler to create various text versions of the AML code to simplify the inclusion of the code into a BIOS project. Code Files (-s)

These options create files that contain the AML in hex format, with a unique label for each line of the original ASL code. This allows the BIOS to easily dynamically access/modify the ACPI table.

-sa Create AML in an x86 assembly source code file with the extension .ASM. This option creates a file with a unique label on the AML code for each line of ASL code.

-sc Create AML in a C source code file with the extension .C. This option creates a file with a unique label on the AML code for each line of ASL code. External Declaration Files (-i)

These options create files that contain external declarations for the symbols created by the options in the previous section.

-ia Create an ASM include file (.INC) that contains external declarations for the symbols produced by the –sa option above.

-ic Create a C header file (.H) that contains external declarations for the symbols produced by the –sc option above. Source Code Files (-t)

These options create files that contain the AML code in hex format, in a single array.

-ta Create a hex table file with the extension .HEX. This file contains raw AML byte data in hex table format suitable for inclusion into an ASM file.

-tc Create a hex table file with the extension .HEX. This file contains raw AML byte data in hex table format suitable for inclusion into a C file.

-ts Create a hex table file with the extension .HEX. This file contains raw AML byte data in an ASL Buffer object format suitable for inclusion into a ASL file. Offset Table (-so)

This option creates a table of offsets within the output AML table/file for use by the BIOS in order to implement run-time table modification.


These options control the listings that are produced by the compiler (as the result of the compilation of an ASL file)

-l Create a listing file with the extension .LST. This file contains intermixed ASL source code and AML byte code so that the AML corresponding to each ASL statement can be examined.

-lm Create a mapping file with a map of the GPIO/I2C/SPI/UART hardware connections and the extension .MAP

-ln Create a namespace file with a dump of the ACPI namespace and the extension .NSP

-ls Create a combined source file with the extension .SRC. This file combines all include files into a single, large source file.

6.3.8ACPI Data Tables

-G Compile a custom table containing “generic” operators. The table is assumed to contain a standard ACPI table header at the start.

-vt Create verbose template file(s). This option creates the template file(s) with the full output of the disassembler, include file offsets and summary raw data.

6.3.9AML Disassembler

These options are used to invoke and control the behavior of the AML disassembler.

-d Disassemble or decode a binary ACPI to a file (.DSL). Tables that contain AML code are disassembled back to ASL code. Tables that do not contain AML code are decoded and displayed with a description of each field within the table. Wildcards are supported.

-da Disassemble All. Load all files into a single common namespace, then disassemble each. Similar to –e option, but disassembles all of the input files. Convenient for disassembling all AML files for a given machine (DSDT plus all SSDTs.)

-db During disassembly, do not disassemble ResourceTemplates. Instead, leave them as disassembled Buffer objects (hex output).

-dc Disassemble a binary AML file and immediately compile it.

-dl Emit legacy AML code only. No ASL+ symbolic operators and expressions will be emitted.

-e Include these extra binary AML tables to assist with external symbol resolution. This option is very useful when attempting to disassemble a table that contains cross-table control method invocations. In these cases, it is difficult or impossible to properly disassemble the method invocation without having the definition of the method present (the important missing data is the number of arguments). Wildcards are supported.

-fe Import an external declaration file that defines the external control methods and their required argument counts. This assists the disassembler in producing correct ASL code. This is a workaround for a limitation of AML code where the disassembler often cannot determine the number of arguments required for an external control method and generates incorrect ASL code. Can be used in conjunction with the –e option.

-in Ignore NoOp opcodes (0xA3) within the AML code being disassembled. Often, the NoOp opcode is used as padding for packages that are changed dynamically by the BIOS. When disassembled and recompiled, these NoOps will cause syntax errors. This option causes the disassembler to ignore all NoOp opcodes.

-vt Dump the full binary table data in hex format within the output file.

6.3.10Compiler Debug Options

These options are typically only used to debug the compiler/disassembler itself.

-bf Generate a full debug output file with parser state tracing and parse tree dump. This option can create large amounts of data.

-bs Generate a debug output file that includes only a parse tree dump

-bp Prune levels from the ASL parse tree. Serious ASL debugging only, used to remove ASL code block in order to locate problem code.

-bt Object types to be removed from the ASL parse tree. Default is Device.

-f Ignore errors, force creation of AML output file(s). Use this option with caution.

-m Set the initial internal line buffer size (in Kbytes). The buffer is automatically expanded as necessary, however.

-n Only parse the ASL file, do not generate an AML output file.

-ot Display compile times and miscellaneous statistics.

-x Set the ACPICA debug level for trace output.

-z For Data Table compilation, do not insert the compiler ID, simply pass through the ID in the original Data Table source code.

1   2   3   4   5   6   7   8

The database is protected by copyright ©essaydocs.org 2016
send message

    Main page