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