aslhelp.c revision 1.1.1.4 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.2 christos * Copyright (C) 2000 - 2017, 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.1.3 christos ACPI_OPTION ("-@ <file>", "Specify command file");
73 1.1.1.3 christos ACPI_OPTION ("-I <dir>", "Specify additional include directory");
74 1.1.1.3 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.1.4 christos ACPI_OPTION ("-vw <messageid>", "Ignore specific error, warning or remark");
100 1.1.1.4 christos ACPI_OPTION ("-vx <messageid>", "Expect a specific warning, remark, or error");
101 1.1 christos ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level");
102 1.1 christos ACPI_OPTION ("-we", "Report warnings as errors");
103 1.1 christos
104 1.1.1.4 christos printf ("\nAML Bytecode Generation (*.aml):\n");
105 1.1 christos ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)");
106 1.1 christos ACPI_OPTION ("-of", "Disable constant folding");
107 1.1 christos ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones");
108 1.1 christos ACPI_OPTION ("-on", "Disable named reference string optimization");
109 1.1 christos ACPI_OPTION ("-ot", "Disable typechecking");
110 1.1 christos ACPI_OPTION ("-cr", "Disable Resource Descriptor error checking");
111 1.1 christos ACPI_OPTION ("-in", "Ignore NoOp operators");
112 1.1 christos ACPI_OPTION ("-r <revision>", "Override table header Revision (1-255)");
113 1.1 christos
114 1.1 christos printf ("\nListings:\n");
115 1.1 christos ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)");
116 1.1 christos ACPI_OPTION ("-lm", "Create hardware summary map file (*.map)");
117 1.1 christos ACPI_OPTION ("-ln", "Create namespace file (*.nsp)");
118 1.1 christos ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
119 1.1 christos ACPI_OPTION ("-lx", "Create cross-reference file (*.xrf)");
120 1.1 christos
121 1.1.1.4 christos printf ("\nFirmware Support - C Text Output:\n");
122 1.1 christos ACPI_OPTION ("-tc", "Create hex AML table in C (*.hex)");
123 1.1 christos ACPI_OPTION ("-sc", "Create named hex AML arrays in C (*.c)");
124 1.1 christos ACPI_OPTION ("-ic", "Create include file in C for -sc symbols (*.h)");
125 1.1 christos ACPI_OPTION ("-so", "Create namespace AML offset table in C (*.offset.h)");
126 1.1 christos
127 1.1.1.4 christos printf ("\nFirmware Support - Assembler Text Output:\n");
128 1.1 christos ACPI_OPTION ("-ta", "Create hex AML table in assembler (*.hex)");
129 1.1 christos ACPI_OPTION ("-sa", "Create named hex AML arrays in assembler (*.asm)");
130 1.1 christos ACPI_OPTION ("-ia", "Create include file in assembler for -sa symbols (*.inc)");
131 1.1 christos
132 1.1.1.4 christos printf ("\nFirmware Support - ASL Text Output:\n");
133 1.1 christos ACPI_OPTION ("-ts", "Create hex AML table in ASL (Buffer object) (*.hex)");
134 1.1 christos
135 1.1.1.4 christos printf ("\nLegacy-ASL to ASL+ Converter:\n");
136 1.1.1.4 christos ACPI_OPTION ("-ca <file>", "Convert legacy-ASL source file to new ASL+ file");
137 1.1.1.4 christos ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)");
138 1.1.1.4 christos
139 1.1 christos printf ("\nData Table Compiler:\n");
140 1.1 christos ACPI_OPTION ("-G", "Compile custom table that contains generic operators");
141 1.1 christos ACPI_OPTION ("-T <sig list>|ALL", "Create ACPI table template/example files");
142 1.1 christos ACPI_OPTION ("-T <count>", "Emit DSDT and <count> SSDTs to same file");
143 1.1 christos ACPI_OPTION ("-vt", "Create verbose template files (full disassembly)");
144 1.1 christos
145 1.1 christos printf ("\nAML Disassembler:\n");
146 1.1 christos ACPI_OPTION ("-d <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
147 1.1 christos ACPI_OPTION ("", " (Optional, file type is automatically detected)");
148 1.1 christos ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
149 1.1 christos ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
150 1.1 christos ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
151 1.1 christos ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
152 1.1 christos ACPI_OPTION ("-df", "Force disassembler to assume table contains valid AML");
153 1.1 christos ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
154 1.1 christos ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
155 1.1 christos ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
156 1.1 christos ACPI_OPTION ("-in", "Ignore NoOp opcodes");
157 1.1 christos ACPI_OPTION ("-l", "Disassemble to mixed ASL and AML code");
158 1.1 christos ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
159 1.1 christos
160 1.1 christos printf ("\nDebug Options:\n");
161 1.1.1.3 christos ACPI_OPTION ("-bc", "Create converter debug file (*.cdb)");
162 1.1 christos ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)");
163 1.1 christos ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)");
164 1.1 christos ACPI_OPTION ("-bp <depth>", "Prune ASL parse tree");
165 1.1 christos ACPI_OPTION ("-bt <type>", "Object type to be pruned from the parse tree");
166 1.1 christos ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
167 1.1 christos ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)");
168 1.1 christos ACPI_OPTION ("-n", "Parse only, no output generation");
169 1.1 christos ACPI_OPTION ("-oc", "Display compile times and statistics");
170 1.1 christos ACPI_OPTION ("-x <level>", "Set debug level for trace output");
171 1.1 christos ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables");
172 1.1 christos }
173 1.1 christos
174 1.1 christos
175 1.1 christos /*******************************************************************************
176 1.1 christos *
177 1.1 christos * FUNCTION: FilenameHelp
178 1.1 christos *
179 1.1 christos * PARAMETERS: None
180 1.1 christos *
181 1.1 christos * RETURN: None
182 1.1 christos *
183 1.1 christos * DESCRIPTION: Display help message for output filename generation
184 1.1 christos *
185 1.1 christos ******************************************************************************/
186 1.1 christos
187 1.1 christos void
188 1.1 christos AslFilenameHelp (
189 1.1 christos void)
190 1.1 christos {
191 1.1 christos
192 1.1 christos printf ("\nAML output filename generation:\n");
193 1.1 christos printf (" Output filenames are generated by appending an extension to a common\n");
194 1.1 christos printf (" filename prefix. The filename prefix is obtained via one of the\n");
195 1.1 christos printf (" following methods (in priority order):\n");
196 1.1 christos printf (" 1) The -p option specifies the prefix\n");
197 1.1 christos printf (" 2) The prefix of the AMLFileName in the ASL Definition Block\n");
198 1.1 christos printf (" 3) The prefix of the input filename\n");
199 1.1 christos printf ("\n");
200 1.1 christos }
201 1.1 christos
202 1.1 christos /*******************************************************************************
203 1.1 christos *
204 1.1 christos * FUNCTION: AslDisassemblyHelp
205 1.1 christos *
206 1.1 christos * PARAMETERS: None
207 1.1 christos *
208 1.1 christos * RETURN: None
209 1.1 christos *
210 1.1 christos * DESCRIPTION: Display help message for obtaining and disassembling AML/ASL
211 1.1 christos * files.
212 1.1 christos *
213 1.1 christos ******************************************************************************/
214 1.1 christos
215 1.1 christos void
216 1.1 christos AslDisassemblyHelp (
217 1.1 christos void)
218 1.1 christos {
219 1.1 christos
220 1.1 christos printf ("\nObtaining binary ACPI tables and disassembling to ASL source code.\n\n");
221 1.1 christos printf ("Use the following ACPICA toolchain:\n");
222 1.1 christos printf (" AcpiDump: Dump all ACPI tables to a hex ascii file\n");
223 1.1 christos printf (" AcpiXtract: Extract one or more binary ACPI tables from AcpiDump output\n");
224 1.1 christos printf (" iASL -d <file>: Disassemble a binary ACPI table to ASL source code\n");
225 1.1 christos printf ("\n");
226 1.1 christos }
227