Home | History | Annotate | Line # | Download | only in compiler
aslhelp.c revision 1.1
      1  1.1  christos /******************************************************************************
      2  1.1  christos  *
      3  1.1  christos  * Module Name: aslhelp - iASL help screens
      4  1.1  christos  *
      5  1.1  christos  *****************************************************************************/
      6  1.1  christos 
      7  1.1  christos /*
      8  1.1  christos  * Copyright (C) 2000 - 2016, Intel Corp.
      9  1.1  christos  * All rights reserved.
     10  1.1  christos  *
     11  1.1  christos  * Redistribution and use in source and binary forms, with or without
     12  1.1  christos  * modification, are permitted provided that the following conditions
     13  1.1  christos  * are met:
     14  1.1  christos  * 1. Redistributions of source code must retain the above copyright
     15  1.1  christos  *    notice, this list of conditions, and the following disclaimer,
     16  1.1  christos  *    without modification.
     17  1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18  1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     19  1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     20  1.1  christos  *    including a substantially similar Disclaimer requirement for further
     21  1.1  christos  *    binary redistribution.
     22  1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     23  1.1  christos  *    of any contributors may be used to endorse or promote products derived
     24  1.1  christos  *    from this software without specific prior written permission.
     25  1.1  christos  *
     26  1.1  christos  * Alternatively, this software may be distributed under the terms of the
     27  1.1  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     28  1.1  christos  * Software Foundation.
     29  1.1  christos  *
     30  1.1  christos  * NO WARRANTY
     31  1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32  1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  1.1  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34  1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35  1.1  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36  1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37  1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38  1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39  1.1  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40  1.1  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41  1.1  christos  * POSSIBILITY OF SUCH DAMAGES.
     42  1.1  christos  */
     43  1.1  christos 
     44  1.1  christos #include "aslcompiler.h"
     45  1.1  christos #include "acapps.h"
     46  1.1  christos 
     47  1.1  christos #define _COMPONENT          ACPI_COMPILER
     48  1.1  christos         ACPI_MODULE_NAME    ("aslhelp")
     49  1.1  christos 
     50  1.1  christos 
     51  1.1  christos /*******************************************************************************
     52  1.1  christos  *
     53  1.1  christos  * FUNCTION:    Usage
     54  1.1  christos  *
     55  1.1  christos  * PARAMETERS:  None
     56  1.1  christos  *
     57  1.1  christos  * RETURN:      None
     58  1.1  christos  *
     59  1.1  christos  * DESCRIPTION: Display option help message.
     60  1.1  christos  *              Optional items in square brackets.
     61  1.1  christos  *
     62  1.1  christos  ******************************************************************************/
     63  1.1  christos 
     64  1.1  christos void
     65  1.1  christos Usage (
     66  1.1  christos     void)
     67  1.1  christos {
     68  1.1  christos     printf ("%s\n\n", ASL_COMPLIANCE);
     69  1.1  christos     ACPI_USAGE_HEADER ("iasl [Options] [Files]");
     70  1.1  christos 
     71  1.1  christos     printf ("\nGeneral:\n");
     72  1.1  christos     ACPI_OPTION ("-@ <file>",       "Specify command file");
     73  1.1  christos     ACPI_OPTION ("-I <dir>",        "Specify additional include directory");
     74  1.1  christos     ACPI_OPTION ("-p <prefix>",     "Specify path/filename prefix for all output files");
     75  1.1  christos     ACPI_OPTION ("-v",              "Display compiler version");
     76  1.1  christos     ACPI_OPTION ("-vd",             "Display compiler build date and time");
     77  1.1  christos     ACPI_OPTION ("-vo",             "Enable optimization comments");
     78  1.1  christos     ACPI_OPTION ("-vs",             "Disable signon");
     79  1.1  christos 
     80  1.1  christos     printf ("\nHelp:\n");
     81  1.1  christos     ACPI_OPTION ("-h",              "This message");
     82  1.1  christos     ACPI_OPTION ("-hc",             "Display operators allowed in constant expressions");
     83  1.1  christos     ACPI_OPTION ("-hd",             "Info for obtaining and disassembling binary ACPI tables");
     84  1.1  christos     ACPI_OPTION ("-hf",             "Display help for output filename generation");
     85  1.1  christos     ACPI_OPTION ("-hr",             "Display ACPI reserved method names");
     86  1.1  christos     ACPI_OPTION ("-ht",             "Display currently supported ACPI table names");
     87  1.1  christos 
     88  1.1  christos     printf ("\nPreprocessor:\n");
     89  1.1  christos     ACPI_OPTION ("-D <symbol>",     "Define symbol for preprocessor use");
     90  1.1  christos     ACPI_OPTION ("-li",             "Create preprocessed output file (*.i)");
     91  1.1  christos     ACPI_OPTION ("-P",              "Preprocess only and create preprocessor output file (*.i)");
     92  1.1  christos     ACPI_OPTION ("-Pn",             "Disable preprocessor");
     93  1.1  christos 
     94  1.1  christos     printf ("\nErrors, Warnings, and Remarks:\n");
     95  1.1  christos     ACPI_OPTION ("-va",             "Disable all errors/warnings/remarks");
     96  1.1  christos     ACPI_OPTION ("-ve",             "Report only errors (ignore warnings and remarks)");
     97  1.1  christos     ACPI_OPTION ("-vi",             "Less verbose errors and warnings for use with IDEs");
     98  1.1  christos     ACPI_OPTION ("-vr",             "Disable remarks");
     99  1.1  christos     ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
    100  1.1  christos     ACPI_OPTION ("-w <1|2|3>",      "Set warning reporting level");
    101  1.1  christos     ACPI_OPTION ("-we",             "Report warnings as errors");
    102  1.1  christos 
    103  1.1  christos     printf ("\nAML Code Generation (*.aml):\n");
    104  1.1  christos     ACPI_OPTION ("-oa",             "Disable all optimizations (compatibility mode)");
    105  1.1  christos     ACPI_OPTION ("-of",             "Disable constant folding");
    106  1.1  christos     ACPI_OPTION ("-oi",             "Disable integer optimization to Zero/One/Ones");
    107  1.1  christos     ACPI_OPTION ("-on",             "Disable named reference string optimization");
    108  1.1  christos     ACPI_OPTION ("-ot",             "Disable typechecking");
    109  1.1  christos     ACPI_OPTION ("-cr",             "Disable Resource Descriptor error checking");
    110  1.1  christos     ACPI_OPTION ("-in",             "Ignore NoOp operators");
    111  1.1  christos     ACPI_OPTION ("-r <revision>",   "Override table header Revision (1-255)");
    112  1.1  christos 
    113  1.1  christos     printf ("\nListings:\n");
    114  1.1  christos     ACPI_OPTION ("-l",              "Create mixed listing file (ASL source and AML) (*.lst)");
    115  1.1  christos     ACPI_OPTION ("-lm",             "Create hardware summary map file (*.map)");
    116  1.1  christos     ACPI_OPTION ("-ln",             "Create namespace file (*.nsp)");
    117  1.1  christos     ACPI_OPTION ("-ls",             "Create combined source file (expanded includes) (*.src)");
    118  1.1  christos     ACPI_OPTION ("-lx",             "Create cross-reference file (*.xrf)");
    119  1.1  christos 
    120  1.1  christos     printf ("\nFirmware Support - C Output:\n");
    121  1.1  christos     ACPI_OPTION ("-tc",             "Create hex AML table in C (*.hex)");
    122  1.1  christos     ACPI_OPTION ("-sc",             "Create named hex AML arrays in C (*.c)");
    123  1.1  christos     ACPI_OPTION ("-ic",             "Create include file in C for -sc symbols (*.h)");
    124  1.1  christos     ACPI_OPTION ("-so",             "Create namespace AML offset table in C (*.offset.h)");
    125  1.1  christos 
    126  1.1  christos     printf ("\nFirmware Support - Assembler Output:\n");
    127  1.1  christos     ACPI_OPTION ("-ta",             "Create hex AML table in assembler (*.hex)");
    128  1.1  christos     ACPI_OPTION ("-sa",             "Create named hex AML arrays in assembler (*.asm)");
    129  1.1  christos     ACPI_OPTION ("-ia",             "Create include file in assembler for -sa symbols (*.inc)");
    130  1.1  christos 
    131  1.1  christos     printf ("\nFirmware Support - ASL Output:\n");
    132  1.1  christos     ACPI_OPTION ("-ts",             "Create hex AML table in ASL (Buffer object) (*.hex)");
    133  1.1  christos 
    134  1.1  christos     printf ("\nData Table Compiler:\n");
    135  1.1  christos     ACPI_OPTION ("-G",              "Compile custom table that contains generic operators");
    136  1.1  christos     ACPI_OPTION ("-T <sig list>|ALL",   "Create ACPI table template/example files");
    137  1.1  christos     ACPI_OPTION ("-T <count>",      "Emit DSDT and <count> SSDTs to same file");
    138  1.1  christos     ACPI_OPTION ("-vt",             "Create verbose template files (full disassembly)");
    139  1.1  christos 
    140  1.1  christos     printf ("\nAML Disassembler:\n");
    141  1.1  christos     ACPI_OPTION ("-d  <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
    142  1.1  christos     ACPI_OPTION ("",                "  (Optional, file type is automatically detected)");
    143  1.1  christos     ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
    144  1.1  christos     ACPI_OPTION ("-db",             "Do not translate Buffers to Resource Templates");
    145  1.1  christos     ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
    146  1.1  christos     ACPI_OPTION ("",                "  (Obtain DSDT from current system if no input file)");
    147  1.1  christos     ACPI_OPTION ("-df",             "Force disassembler to assume table contains valid AML");
    148  1.1  christos     ACPI_OPTION ("-dl",             "Emit legacy ASL code only (no C-style operators)");
    149  1.1  christos     ACPI_OPTION ("-e  <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
    150  1.1  christos     ACPI_OPTION ("-fe <file>",      "Specify external symbol declaration file");
    151  1.1  christos     ACPI_OPTION ("-in",             "Ignore NoOp opcodes");
    152  1.1  christos     ACPI_OPTION ("-l",              "Disassemble to mixed ASL and AML code");
    153  1.1  christos     ACPI_OPTION ("-vt",             "Dump binary table data in hex format within output file");
    154  1.1  christos 
    155  1.1  christos     printf ("\nDebug Options:\n");
    156  1.1  christos     ACPI_OPTION ("-bf",             "Create debug file (full output) (*.txt)");
    157  1.1  christos     ACPI_OPTION ("-bs",             "Create debug file (parse tree only) (*.txt)");
    158  1.1  christos     ACPI_OPTION ("-bp <depth>",     "Prune ASL parse tree");
    159  1.1  christos     ACPI_OPTION ("-bt <type>",      "Object type to be pruned from the parse tree");
    160  1.1  christos     ACPI_OPTION ("-f",              "Ignore errors, force creation of AML output file(s)");
    161  1.1  christos     ACPI_OPTION ("-m <size>",       "Set internal line buffer size (in Kbytes)");
    162  1.1  christos     ACPI_OPTION ("-n",              "Parse only, no output generation");
    163  1.1  christos     ACPI_OPTION ("-oc",             "Display compile times and statistics");
    164  1.1  christos     ACPI_OPTION ("-x <level>",      "Set debug level for trace output");
    165  1.1  christos     ACPI_OPTION ("-z",              "Do not insert new compiler ID for DataTables");
    166  1.1  christos }
    167  1.1  christos 
    168  1.1  christos 
    169  1.1  christos /*******************************************************************************
    170  1.1  christos  *
    171  1.1  christos  * FUNCTION:    FilenameHelp
    172  1.1  christos  *
    173  1.1  christos  * PARAMETERS:  None
    174  1.1  christos  *
    175  1.1  christos  * RETURN:      None
    176  1.1  christos  *
    177  1.1  christos  * DESCRIPTION: Display help message for output filename generation
    178  1.1  christos  *
    179  1.1  christos  ******************************************************************************/
    180  1.1  christos 
    181  1.1  christos void
    182  1.1  christos AslFilenameHelp (
    183  1.1  christos     void)
    184  1.1  christos {
    185  1.1  christos 
    186  1.1  christos     printf ("\nAML output filename generation:\n");
    187  1.1  christos     printf ("  Output filenames are generated by appending an extension to a common\n");
    188  1.1  christos     printf ("  filename prefix. The filename prefix is obtained via one of the\n");
    189  1.1  christos     printf ("  following methods (in priority order):\n");
    190  1.1  christos     printf ("    1) The -p option specifies the prefix\n");
    191  1.1  christos     printf ("    2) The prefix of the AMLFileName in the ASL Definition Block\n");
    192  1.1  christos     printf ("    3) The prefix of the input filename\n");
    193  1.1  christos     printf ("\n");
    194  1.1  christos }
    195  1.1  christos 
    196  1.1  christos /*******************************************************************************
    197  1.1  christos  *
    198  1.1  christos  * FUNCTION:    AslDisassemblyHelp
    199  1.1  christos  *
    200  1.1  christos  * PARAMETERS:  None
    201  1.1  christos  *
    202  1.1  christos  * RETURN:      None
    203  1.1  christos  *
    204  1.1  christos  * DESCRIPTION: Display help message for obtaining and disassembling AML/ASL
    205  1.1  christos  *              files.
    206  1.1  christos  *
    207  1.1  christos  ******************************************************************************/
    208  1.1  christos 
    209  1.1  christos void
    210  1.1  christos AslDisassemblyHelp (
    211  1.1  christos     void)
    212  1.1  christos {
    213  1.1  christos 
    214  1.1  christos     printf ("\nObtaining binary ACPI tables and disassembling to ASL source code.\n\n");
    215  1.1  christos     printf ("Use the following ACPICA toolchain:\n");
    216  1.1  christos     printf ("  AcpiDump: Dump all ACPI tables to a hex ascii file\n");
    217  1.1  christos     printf ("  AcpiXtract: Extract one or more binary ACPI tables from AcpiDump output\n");
    218  1.1  christos     printf ("  iASL -d <file>: Disassemble a binary ACPI table to ASL source code\n");
    219  1.1  christos     printf ("\n");
    220  1.1  christos }
    221