Home | History | Annotate | Line # | Download | only in compiler
aslhelp.c revision 1.1.1.10.4.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.1.10.4.1   thorpej  * Copyright (C) 2000 - 2021, 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.1.10.4.1   thorpej  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 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.1.5  christos     printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
     69           1.1  christos     printf ("%s\n\n", ASL_COMPLIANCE);
     70           1.1  christos     ACPI_USAGE_HEADER ("iasl [Options] [Files]");
     71           1.1  christos 
     72           1.1  christos     printf ("\nGeneral:\n");
     73       1.1.1.3  christos     ACPI_OPTION ("-@  <file>",      "Specify command file");
     74       1.1.1.3  christos     ACPI_OPTION ("-I  <dir>",       "Specify additional include directory");
     75       1.1.1.3  christos     ACPI_OPTION ("-p  <prefix>",    "Specify path/filename prefix for all output files");
     76           1.1  christos     ACPI_OPTION ("-v",              "Display compiler version");
     77           1.1  christos     ACPI_OPTION ("-vd",             "Display compiler build date and time");
     78           1.1  christos     ACPI_OPTION ("-vo",             "Enable optimization comments");
     79           1.1  christos     ACPI_OPTION ("-vs",             "Disable signon");
     80           1.1  christos 
     81           1.1  christos     printf ("\nHelp:\n");
     82           1.1  christos     ACPI_OPTION ("-h",              "This message");
     83           1.1  christos     ACPI_OPTION ("-hc",             "Display operators allowed in constant expressions");
     84           1.1  christos     ACPI_OPTION ("-hd",             "Info for obtaining and disassembling binary ACPI tables");
     85           1.1  christos     ACPI_OPTION ("-hf",             "Display help for output filename generation");
     86           1.1  christos     ACPI_OPTION ("-hr",             "Display ACPI reserved method names");
     87           1.1  christos     ACPI_OPTION ("-ht",             "Display currently supported ACPI table names");
     88           1.1  christos 
     89           1.1  christos     printf ("\nPreprocessor:\n");
     90           1.1  christos     ACPI_OPTION ("-D <symbol>",     "Define symbol for preprocessor use");
     91           1.1  christos     ACPI_OPTION ("-li",             "Create preprocessed output file (*.i)");
     92           1.1  christos     ACPI_OPTION ("-P",              "Preprocess only and create preprocessor output file (*.i)");
     93           1.1  christos     ACPI_OPTION ("-Pn",             "Disable preprocessor");
     94           1.1  christos 
     95           1.1  christos     printf ("\nErrors, Warnings, and Remarks:\n");
     96           1.1  christos     ACPI_OPTION ("-va",             "Disable all errors/warnings/remarks");
     97           1.1  christos     ACPI_OPTION ("-ve",             "Report only errors (ignore warnings and remarks)");
     98           1.1  christos     ACPI_OPTION ("-vi",             "Less verbose errors and warnings for use with IDEs");
     99           1.1  christos     ACPI_OPTION ("-vr",             "Disable remarks");
    100       1.1.1.4  christos     ACPI_OPTION ("-vw <messageid>", "Ignore specific error, warning or remark");
    101       1.1.1.4  christos     ACPI_OPTION ("-vx <messageid>", "Expect a specific warning, remark, or error");
    102           1.1  christos     ACPI_OPTION ("-w <1|2|3>",      "Set warning reporting level");
    103           1.1  christos     ACPI_OPTION ("-we",             "Report warnings as errors");
    104       1.1.1.7  christos     ACPI_OPTION ("-ww <messageid>", "Report specific warning or remark as error");
    105           1.1  christos 
    106       1.1.1.4  christos     printf ("\nAML Bytecode Generation (*.aml):\n");
    107           1.1  christos     ACPI_OPTION ("-oa",             "Disable all optimizations (compatibility mode)");
    108           1.1  christos     ACPI_OPTION ("-of",             "Disable constant folding");
    109           1.1  christos     ACPI_OPTION ("-oi",             "Disable integer optimization to Zero/One/Ones");
    110           1.1  christos     ACPI_OPTION ("-on",             "Disable named reference string optimization");
    111           1.1  christos     ACPI_OPTION ("-ot",             "Disable typechecking");
    112           1.1  christos     ACPI_OPTION ("-cr",             "Disable Resource Descriptor error checking");
    113           1.1  christos     ACPI_OPTION ("-in",             "Ignore NoOp operators");
    114           1.1  christos     ACPI_OPTION ("-r <revision>",   "Override table header Revision (1-255)");
    115           1.1  christos 
    116           1.1  christos     printf ("\nListings:\n");
    117           1.1  christos     ACPI_OPTION ("-l",              "Create mixed listing file (ASL source and AML) (*.lst)");
    118           1.1  christos     ACPI_OPTION ("-lm",             "Create hardware summary map file (*.map)");
    119           1.1  christos     ACPI_OPTION ("-ln",             "Create namespace file (*.nsp)");
    120           1.1  christos     ACPI_OPTION ("-ls",             "Create combined source file (expanded includes) (*.src)");
    121           1.1  christos     ACPI_OPTION ("-lx",             "Create cross-reference file (*.xrf)");
    122           1.1  christos 
    123       1.1.1.4  christos     printf ("\nFirmware Support - C Text Output:\n");
    124           1.1  christos     ACPI_OPTION ("-tc",             "Create hex AML table in C (*.hex)");
    125           1.1  christos     ACPI_OPTION ("-sc",             "Create named hex AML arrays in C (*.c)");
    126           1.1  christos     ACPI_OPTION ("-ic",             "Create include file in C for -sc symbols (*.h)");
    127           1.1  christos     ACPI_OPTION ("-so",             "Create namespace AML offset table in C (*.offset.h)");
    128           1.1  christos 
    129       1.1.1.4  christos     printf ("\nFirmware Support - Assembler Text Output:\n");
    130           1.1  christos     ACPI_OPTION ("-ta",             "Create hex AML table in assembler (*.hex)");
    131           1.1  christos     ACPI_OPTION ("-sa",             "Create named hex AML arrays in assembler (*.asm)");
    132           1.1  christos     ACPI_OPTION ("-ia",             "Create include file in assembler for -sa symbols (*.inc)");
    133           1.1  christos 
    134       1.1.1.4  christos     printf ("\nFirmware Support - ASL Text Output:\n");
    135           1.1  christos     ACPI_OPTION ("-ts",             "Create hex AML table in ASL (Buffer object) (*.hex)");
    136           1.1  christos 
    137       1.1.1.4  christos     printf ("\nLegacy-ASL to ASL+ Converter:\n");
    138       1.1.1.4  christos     ACPI_OPTION ("-ca <file>",      "Convert legacy-ASL source file to new ASL+ file");
    139       1.1.1.4  christos     ACPI_OPTION ("",                "  (Original comments are passed through to ASL+ file)");
    140       1.1.1.4  christos 
    141           1.1  christos     printf ("\nData Table Compiler:\n");
    142       1.1.1.9  christos     ACPI_OPTION ("-tp",             "Compile tables with flex/bison prototype");
    143           1.1  christos     ACPI_OPTION ("-G",              "Compile custom table that contains generic operators");
    144           1.1  christos     ACPI_OPTION ("-T <sig list>|ALL",   "Create ACPI table template/example files");
    145           1.1  christos     ACPI_OPTION ("-T <count>",      "Emit DSDT and <count> SSDTs to same file");
    146           1.1  christos     ACPI_OPTION ("-vt",             "Create verbose template files (full disassembly)");
    147           1.1  christos 
    148           1.1  christos     printf ("\nAML Disassembler:\n");
    149           1.1  christos     ACPI_OPTION ("-d  <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
    150           1.1  christos     ACPI_OPTION ("",                "  (Optional, file type is automatically detected)");
    151           1.1  christos     ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
    152           1.1  christos     ACPI_OPTION ("-db",             "Do not translate Buffers to Resource Templates");
    153           1.1  christos     ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
    154           1.1  christos     ACPI_OPTION ("",                "  (Obtain DSDT from current system if no input file)");
    155           1.1  christos     ACPI_OPTION ("-df",             "Force disassembler to assume table contains valid AML");
    156           1.1  christos     ACPI_OPTION ("-dl",             "Emit legacy ASL code only (no C-style operators)");
    157           1.1  christos     ACPI_OPTION ("-e  <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
    158           1.1  christos     ACPI_OPTION ("-fe <file>",      "Specify external symbol declaration file");
    159           1.1  christos     ACPI_OPTION ("-in",             "Ignore NoOp opcodes");
    160           1.1  christos     ACPI_OPTION ("-l",              "Disassemble to mixed ASL and AML code");
    161           1.1  christos     ACPI_OPTION ("-vt",             "Dump binary table data in hex format within output file");
    162           1.1  christos 
    163           1.1  christos     printf ("\nDebug Options:\n");
    164       1.1.1.3  christos     ACPI_OPTION ("-bc",             "Create converter debug file (*.cdb)");
    165           1.1  christos     ACPI_OPTION ("-bf",             "Create debug file (full output) (*.txt)");
    166           1.1  christos     ACPI_OPTION ("-bs",             "Create debug file (parse tree only) (*.txt)");
    167           1.1  christos     ACPI_OPTION ("-bp <depth>",     "Prune ASL parse tree");
    168           1.1  christos     ACPI_OPTION ("-bt <type>",      "Object type to be pruned from the parse tree");
    169           1.1  christos     ACPI_OPTION ("-f",              "Ignore errors, force creation of AML output file(s)");
    170           1.1  christos     ACPI_OPTION ("-m <size>",       "Set internal line buffer size (in Kbytes)");
    171           1.1  christos     ACPI_OPTION ("-n",              "Parse only, no output generation");
    172           1.1  christos     ACPI_OPTION ("-oc",             "Display compile times and statistics");
    173           1.1  christos     ACPI_OPTION ("-x <level>",      "Set debug level for trace output");
    174           1.1  christos     ACPI_OPTION ("-z",              "Do not insert new compiler ID for DataTables");
    175           1.1  christos }
    176           1.1  christos 
    177           1.1  christos 
    178           1.1  christos /*******************************************************************************
    179           1.1  christos  *
    180           1.1  christos  * FUNCTION:    FilenameHelp
    181           1.1  christos  *
    182           1.1  christos  * PARAMETERS:  None
    183           1.1  christos  *
    184           1.1  christos  * RETURN:      None
    185           1.1  christos  *
    186           1.1  christos  * DESCRIPTION: Display help message for output filename generation
    187           1.1  christos  *
    188           1.1  christos  ******************************************************************************/
    189           1.1  christos 
    190           1.1  christos void
    191           1.1  christos AslFilenameHelp (
    192           1.1  christos     void)
    193           1.1  christos {
    194           1.1  christos 
    195           1.1  christos     printf ("\nAML output filename generation:\n");
    196           1.1  christos     printf ("  Output filenames are generated by appending an extension to a common\n");
    197           1.1  christos     printf ("  filename prefix. The filename prefix is obtained via one of the\n");
    198           1.1  christos     printf ("  following methods (in priority order):\n");
    199           1.1  christos     printf ("    1) The -p option specifies the prefix\n");
    200           1.1  christos     printf ("    2) The prefix of the AMLFileName in the ASL Definition Block\n");
    201           1.1  christos     printf ("    3) The prefix of the input filename\n");
    202           1.1  christos     printf ("\n");
    203           1.1  christos }
    204           1.1  christos 
    205           1.1  christos /*******************************************************************************
    206           1.1  christos  *
    207           1.1  christos  * FUNCTION:    AslDisassemblyHelp
    208           1.1  christos  *
    209           1.1  christos  * PARAMETERS:  None
    210           1.1  christos  *
    211           1.1  christos  * RETURN:      None
    212           1.1  christos  *
    213           1.1  christos  * DESCRIPTION: Display help message for obtaining and disassembling AML/ASL
    214           1.1  christos  *              files.
    215           1.1  christos  *
    216           1.1  christos  ******************************************************************************/
    217           1.1  christos 
    218           1.1  christos void
    219           1.1  christos AslDisassemblyHelp (
    220           1.1  christos     void)
    221           1.1  christos {
    222           1.1  christos 
    223           1.1  christos     printf ("\nObtaining binary ACPI tables and disassembling to ASL source code.\n\n");
    224           1.1  christos     printf ("Use the following ACPICA toolchain:\n");
    225           1.1  christos     printf ("  AcpiDump: Dump all ACPI tables to a hex ascii file\n");
    226           1.1  christos     printf ("  AcpiXtract: Extract one or more binary ACPI tables from AcpiDump output\n");
    227           1.1  christos     printf ("  iASL -d <file>: Disassemble a binary ACPI table to ASL source code\n");
    228           1.1  christos     printf ("\n");
    229           1.1  christos }
    230