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