Iasl: ACPI Source Language Optimizing Compiler and Disassembler User Guide
Total Page:16
File Type:pdf, Size:1020Kb
iASL: ACPI Source Language Optimizing Compiler and Disassembler User Guide iASL Overview and Compiler Operation Revision 6.2 May 31, 2017 R iASL: ACPI Source Language Optimizing Compiler and Disassembler User Guide Information in this document is provided in connection with Intel® products. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. Except as provided in Intel’s Terms and Conditions of Sale for such products, Intel assumes no liability whatsoever, and Intel disclaims any express or implied warranty, relating to sale and/or use of Intel products including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other intellectual property right. Intel products are not intended for use in medical, life saving, or life sustaining applications. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The iASL compiler may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Copyright © 2000 - 2017 Intel Corporation *Other brands and names are the property of their respective owners. 2 R iASL: ACPI Source Language Optimizing Compiler and Disassembler User Guide Contents 1 Introduction -------------------------------------------------------------------------------------------------- 6 1.1 Document Structure ............................................................................................... 7 1.2 Reference Documents ........................................................................................... 7 1.3 Document History................................................................................................... 8 1.4 Definition of Terms ................................................................................................. 9 2 Compiler/Disassembler Overview------------------------------------------------------------------- 10 2.1 Supported Execution Environments .................................................................... 10 2.2 ASL Compiler ....................................................................................................... 10 2.2.1 Input Files ................................................................................................ 10 2.2.2 Output File Options ................................................................................. 10 2.3 AML Disassembler ............................................................................................... 11 2.3.1 Input Files ................................................................................................ 11 2.3.2 Output ..................................................................................................... 11 2.4 Data Table Compiler ............................................................................................ 11 2.4.1 Input Files ................................................................................................ 12 2.4.2 Output ..................................................................................................... 12 2.5 Data Table Disassembler ..................................................................................... 12 2.5.1 Input Files ................................................................................................ 12 2.5.2 Output ..................................................................................................... 12 2.6 Template Generator ............................................................................................. 12 3 Preprocessor ---------------------------------------------------------------------------------------------- 13 3.1 Command Line Options ....................................................................................... 13 3.2 Integer Expressions ............................................................................................. 13 3.3 Supported Directives ............................................................................................ 13 3.3.1 Text Substitution and Macros ................................................................. 14 3.3.1.1 #define...................................................................................... 14 3.3.1.2 #undef ...................................................................................... 14 3.3.2 Conditional Compilation .......................................................................... 14 3.3.2.1 #if - ........................................................................................ 14 3.3.2.2 #ifdef......................................................................................... 14 3.3.2.3 #ifndef....................................................................................... 15 3.3.2.4 #else ......................................................................................... 15 3.3.2.5 #elif ........................................................................................... 15 3.3.2.6 #endif........................................................................................ 15 3.3.3 Include Files ............................................................................................ 15 3.3.3.1 #include vs. ASL Include() ....................................................... 15 3.3.3.2 #include .................................................................................... 15 3.3.3.3 #includebuffer ........................................................................... 16 3.3.3.4 #line .......................................................................................... 16 3.3.4 Miscellaneous Directives ........................................................................ 16 3.3.4.1 #error ........................................................................................ 16 3.3.4.2 #pragma ................................................................................... 16 3.3.4.3 #warning ................................................................................... 17 4 ASL-AML Subsystem ------------------------------------------------------------------------------------ 18 4.1 ASL Compiler ....................................................................................................... 18 4.1.1 Support for Symbolic Operators and Expressions (ASL+) ..................... 18 3 R iASL: ACPI Source Language Optimizing Compiler and Disassembler User Guide 4.1.1.1 Binary AML Considerations ..................................................... 20 4.1.1.2 AML Disassembler Notes......................................................... 20 4.1.2 Built-in ASL Macros ................................................................................ 21 4.1.3 Compiler Analysis Phases ...................................................................... 21 4.1.3.1 General ASL Syntax Analysis .................................................. 21 4.1.3.2 General Semantic Analysis ...................................................... 21 4.1.3.3 Control Method Semantic Analysis .......................................... 22 4.1.3.4 Control Method Invocation Analysis ......................................... 22 4.1.3.5 Predefined ACPI Names .......................................................... 22 4.1.3.6 Resource Descriptors ............................................................... 22 4.1.4 Compiler Optimizations ........................................................................... 23 4.1.4.1 Named References .................................................................. 23 4.1.4.2 Integers .................................................................................... 23 4.1.4.3 Constant Folding ...................................................................... 23 4.2 ASL-to-AML Disassembler ................................................................................... 23 4.2.1 Multiple Table Disassembly .................................................................... 23 4.2.2 External Declarations .............................................................................. 24 4.2.2.1 The External AML Opcode ....................................................... 24 4.2.2.2 Generation of ASL External() Statements................................ 25 4.3 ASL to ASL+ Converter........................................................................................ 25 4.3.1 Using the ASL/ASL+ Converter .............................................................. 25 4.3.2 Example: ASL/ASL+ Converter and Disassembler ................................ 25 4.3.3 Items currently not supported ................................................................. 26 5 ACPI Data Table Subsystem -------------------------------------------------------------------------- 27 5.1 Data Table Compiler ............................................................................................ 27 5.1.1 Input Format ............................................................................................ 27 5.1.1.1 Ignored Fields/Comments ........................................................ 28