1 /****************************************************************************** 2 * 3 * Name: acdisasm.h - AML disassembler 4 * 5 *****************************************************************************/ 6 7 /****************************************************************************** 8 * 9 * 1. Copyright Notice 10 * 11 * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp. 12 * All rights reserved. 13 * 14 * 2. License 15 * 16 * 2.1. This is your license from Intel Corp. under its intellectual property 17 * rights. You may have additional license terms from the party that provided 18 * you this software, covering your right to use that party's intellectual 19 * property rights. 20 * 21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 22 * copy of the source code appearing in this file ("Covered Code") an 23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 24 * base code distributed originally by Intel ("Original Intel Code") to copy, 25 * make derivatives, distribute, use and display any portion of the Covered 26 * Code in any form, with the right to sublicense such rights; and 27 * 28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 29 * license (with the right to sublicense), under only those claims of Intel 30 * patents that are infringed by the Original Intel Code, to make, use, sell, 31 * offer to sell, and import the Covered Code and derivative works thereof 32 * solely to the minimum extent necessary to exercise the above copyright 33 * license, and in no event shall the patent license extend to any additions 34 * to or modifications of the Original Intel Code. No other license or right 35 * is granted directly or by implication, estoppel or otherwise; 36 * 37 * The above copyright and patent license is granted only if the following 38 * conditions are met: 39 * 40 * 3. Conditions 41 * 42 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 43 * Redistribution of source code of any substantial portion of the Covered 44 * Code or modification with rights to further distribute source must include 45 * the above Copyright Notice, the above License, this list of Conditions, 46 * and the following Disclaimer and Export Compliance provision. In addition, 47 * Licensee must cause all Covered Code to which Licensee contributes to 48 * contain a file documenting the changes Licensee made to create that Covered 49 * Code and the date of any change. Licensee must include in that file the 50 * documentation of any changes made by any predecessor Licensee. Licensee 51 * must include a prominent statement that the modification is derived, 52 * directly or indirectly, from Original Intel Code. 53 * 54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 55 * Redistribution of source code of any substantial portion of the Covered 56 * Code or modification without rights to further distribute source must 57 * include the following Disclaimer and Export Compliance provision in the 58 * documentation and/or other materials provided with distribution. In 59 * addition, Licensee may not authorize further sublicense of source of any 60 * portion of the Covered Code, and must include terms to the effect that the 61 * license from Licensee to its licensee is limited to the intellectual 62 * property embodied in the software Licensee provides to its licensee, and 63 * not to intellectual property embodied in modifications its licensee may 64 * make. 65 * 66 * 3.3. Redistribution of Executable. Redistribution in executable form of any 67 * substantial portion of the Covered Code or modification must reproduce the 68 * above Copyright Notice, and the following Disclaimer and Export Compliance 69 * provision in the documentation and/or other materials provided with the 70 * distribution. 71 * 72 * 3.4. Intel retains all right, title, and interest in and to the Original 73 * Intel Code. 74 * 75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 76 * Intel shall be used in advertising or otherwise to promote the sale, use or 77 * other dealings in products derived from or relating to the Covered Code 78 * without prior written authorization from Intel. 79 * 80 * 4. Disclaimer and Export Compliance 81 * 82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 88 * PARTICULAR PURPOSE. 89 * 90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 97 * LIMITED REMEDY. 98 * 99 * 4.3. Licensee shall not export, either directly or indirectly, any of this 100 * software or system incorporating such software without first obtaining any 101 * required license or other approval from the U. S. Department of Commerce or 102 * any other agency or department of the United States Government. In the 103 * event Licensee exports any such software from the United States or 104 * re-exports any such software from a foreign destination, Licensee shall 105 * ensure that the distribution and export/re-export of the software is in 106 * compliance with all laws, regulations, orders, or other restrictions of the 107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 108 * any of its subsidiaries will export/re-export any technical data, process, 109 * software, or service, directly or indirectly, to any country for which the 110 * United States government or any agency thereof requires an export license, 111 * other governmental approval, or letter of assurance, without first obtaining 112 * such license, approval or letter. 113 * 114 *****************************************************************************/ 115 116 #ifndef __ACDISASM_H__ 117 #define __ACDISASM_H__ 118 119 #include "amlresrc.h" 120 121 122 #define BLOCK_NONE 0 123 #define BLOCK_PAREN 1 124 #define BLOCK_BRACE 2 125 #define BLOCK_COMMA_LIST 4 126 #define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD" 127 128 /* 129 * Raw table data header. Used by disassembler and data table compiler. 130 * Do not change. 131 */ 132 #define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data" 133 134 135 typedef struct acpi_dmtable_info 136 { 137 UINT8 Opcode; 138 UINT16 Offset; 139 char *Name; 140 UINT8 Flags; 141 142 } ACPI_DMTABLE_INFO; 143 144 /* Values for Flags field above */ 145 146 #define DT_LENGTH 0x01 /* Field is a subtable length */ 147 #define DT_FLAG 0x02 /* Field is a flag value */ 148 #define DT_NON_ZERO 0x04 /* Field must be non-zero */ 149 #define DT_OPTIONAL 0x08 /* Field is optional */ 150 #define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */ 151 #define DT_COUNT 0x20 /* Currently not used */ 152 153 /* 154 * Values for Opcode above. 155 * Note: 0-7 must not change, they are used as a flag shift value. Other 156 * than those, new values can be added wherever appropriate. 157 */ 158 typedef enum 159 { 160 /* Simple Data Types */ 161 162 ACPI_DMT_FLAG0 = 0, 163 ACPI_DMT_FLAG1 = 1, 164 ACPI_DMT_FLAG2 = 2, 165 ACPI_DMT_FLAG3 = 3, 166 ACPI_DMT_FLAG4 = 4, 167 ACPI_DMT_FLAG5 = 5, 168 ACPI_DMT_FLAG6 = 6, 169 ACPI_DMT_FLAG7 = 7, 170 ACPI_DMT_FLAGS0, 171 ACPI_DMT_FLAGS1, 172 ACPI_DMT_FLAGS2, 173 ACPI_DMT_FLAGS4, 174 ACPI_DMT_UINT8, 175 ACPI_DMT_UINT16, 176 ACPI_DMT_UINT24, 177 ACPI_DMT_UINT32, 178 ACPI_DMT_UINT40, 179 ACPI_DMT_UINT48, 180 ACPI_DMT_UINT56, 181 ACPI_DMT_UINT64, 182 ACPI_DMT_BUF7, 183 ACPI_DMT_BUF10, 184 ACPI_DMT_BUF12, 185 ACPI_DMT_BUF16, 186 ACPI_DMT_BUF128, 187 ACPI_DMT_SIG, 188 ACPI_DMT_STRING, 189 ACPI_DMT_NAME4, 190 ACPI_DMT_NAME6, 191 ACPI_DMT_NAME8, 192 193 /* Types that are decoded to strings and miscellaneous */ 194 195 ACPI_DMT_ACCWIDTH, 196 ACPI_DMT_CHKSUM, 197 ACPI_DMT_GAS, 198 ACPI_DMT_SPACEID, 199 ACPI_DMT_UNICODE, 200 ACPI_DMT_UUID, 201 202 /* Types used only for the Data Table Compiler */ 203 204 ACPI_DMT_BUFFER, 205 ACPI_DMT_RAW_BUFFER, /* Large, multiple line buffer */ 206 ACPI_DMT_DEVICE_PATH, 207 ACPI_DMT_LABEL, 208 ACPI_DMT_PCI_PATH, 209 210 /* Types that are specific to particular ACPI tables */ 211 212 ACPI_DMT_ASF, 213 ACPI_DMT_DMAR, 214 ACPI_DMT_DMAR_SCOPE, 215 ACPI_DMT_EINJACT, 216 ACPI_DMT_EINJINST, 217 ACPI_DMT_ERSTACT, 218 ACPI_DMT_ERSTINST, 219 ACPI_DMT_FADTPM, 220 ACPI_DMT_GTDT, 221 ACPI_DMT_HEST, 222 ACPI_DMT_HESTNTFY, 223 ACPI_DMT_HESTNTYP, 224 ACPI_DMT_IORTMEM, 225 ACPI_DMT_IVRS, 226 ACPI_DMT_LPIT, 227 ACPI_DMT_MADT, 228 ACPI_DMT_NFIT, 229 ACPI_DMT_PCCT, 230 ACPI_DMT_PMTT, 231 ACPI_DMT_SLIC, 232 ACPI_DMT_SRAT, 233 234 /* Special opcodes */ 235 236 ACPI_DMT_EXTRA_TEXT, 237 ACPI_DMT_EXIT 238 239 } ACPI_ENTRY_TYPES; 240 241 typedef 242 void (*ACPI_DMTABLE_HANDLER) ( 243 ACPI_TABLE_HEADER *Table); 244 245 typedef 246 ACPI_STATUS (*ACPI_CMTABLE_HANDLER) ( 247 void **PFieldList); 248 249 typedef struct acpi_dmtable_data 250 { 251 char *Signature; 252 ACPI_DMTABLE_INFO *TableInfo; 253 ACPI_DMTABLE_HANDLER TableHandler; 254 ACPI_CMTABLE_HANDLER CmTableHandler; 255 const unsigned char *Template; 256 257 } ACPI_DMTABLE_DATA; 258 259 260 typedef struct acpi_op_walk_info 261 { 262 ACPI_WALK_STATE *WalkState; 263 ACPI_PARSE_OBJECT *MappingOp; 264 UINT8 *PreviousAml; 265 UINT8 *StartAml; 266 UINT32 Level; 267 UINT32 LastLevel; 268 UINT32 Count; 269 UINT32 BitOffset; 270 UINT32 Flags; 271 UINT32 AmlOffset; 272 273 } ACPI_OP_WALK_INFO; 274 275 /* 276 * TBD - another copy of this is in asltypes.h, fix 277 */ 278 #ifndef ASL_WALK_CALLBACK_DEFINED 279 typedef 280 ACPI_STATUS (*ASL_WALK_CALLBACK) ( 281 ACPI_PARSE_OBJECT *Op, 282 UINT32 Level, 283 void *Context); 284 #define ASL_WALK_CALLBACK_DEFINED 285 #endif 286 287 typedef 288 void (*ACPI_RESOURCE_HANDLER) ( 289 ACPI_OP_WALK_INFO *Info, 290 AML_RESOURCE *Resource, 291 UINT32 Length, 292 UINT32 Level); 293 294 typedef struct acpi_resource_tag 295 { 296 UINT32 BitIndex; 297 char *Tag; 298 299 } ACPI_RESOURCE_TAG; 300 301 /* Strings used for decoding flags to ASL keywords */ 302 303 extern const char *AcpiGbl_WordDecode[]; 304 extern const char *AcpiGbl_IrqDecode[]; 305 extern const char *AcpiGbl_LockRule[]; 306 extern const char *AcpiGbl_AccessTypes[]; 307 extern const char *AcpiGbl_UpdateRules[]; 308 extern const char *AcpiGbl_MatchOps[]; 309 310 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[]; 311 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1[]; 312 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a[]; 313 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2[]; 314 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[]; 315 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3[]; 316 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[]; 317 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; 318 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; 319 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; 320 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; 321 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; 322 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; 323 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; 324 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[]; 325 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[]; 326 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2a[]; 327 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[]; 328 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[]; 329 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[]; 330 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[]; 331 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[]; 332 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[]; 333 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[]; 334 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[]; 335 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[]; 336 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[]; 337 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[]; 338 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; 339 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; 340 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; 341 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[]; 342 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[]; 343 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0[]; 344 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0a[]; 345 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1[]; 346 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1a[]; 347 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm2[]; 348 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; 349 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; 350 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; 351 extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[]; 352 extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[]; 353 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[]; 354 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; 355 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; 356 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt4[]; 357 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; 358 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[]; 359 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; 360 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[]; 361 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[]; 362 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[]; 363 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[]; 364 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[]; 365 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[]; 366 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[]; 367 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[]; 368 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[]; 369 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[]; 370 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[]; 371 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[]; 372 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[]; 373 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[]; 374 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[]; 375 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[]; 376 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[]; 377 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[]; 378 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[]; 379 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[]; 380 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[]; 381 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[]; 382 extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[]; 383 extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[]; 384 extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[]; 385 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort[]; 386 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[]; 387 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[]; 388 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1[]; 389 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1a[]; 390 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort2[]; 391 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[]; 392 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[]; 393 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[]; 394 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[]; 395 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[]; 396 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[]; 397 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[]; 398 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[]; 399 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[]; 400 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[]; 401 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[]; 402 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[]; 403 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[]; 404 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[]; 405 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[]; 406 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[]; 407 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[]; 408 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[]; 409 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[]; 410 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[]; 411 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt2[]; 412 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt3[]; 413 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt4[]; 414 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt5[]; 415 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt6[]; 416 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[]; 417 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[]; 418 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[]; 419 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[]; 420 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[]; 421 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[]; 422 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[]; 423 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[]; 424 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[]; 425 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; 426 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; 427 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; 428 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[]; 429 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[]; 430 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[]; 431 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[]; 432 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[]; 433 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[]; 434 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[]; 435 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; 436 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; 437 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[]; 438 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[]; 439 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit[]; 440 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfitHdr[]; 441 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[]; 442 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit1[]; 443 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2[]; 444 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2a[]; 445 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3[]; 446 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3a[]; 447 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit4[]; 448 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit5[]; 449 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[]; 450 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[]; 451 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[]; 452 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; 453 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[]; 454 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[]; 455 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[]; 456 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[]; 457 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[]; 458 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[]; 459 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; 460 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[]; 461 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[]; 462 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRasf[]; 463 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; 464 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; 465 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[]; 466 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[]; 467 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[]; 468 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[]; 469 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[]; 470 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[]; 471 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[]; 472 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[]; 473 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[]; 474 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat[]; 475 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[]; 476 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[]; 477 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; 478 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; 479 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[]; 480 extern ACPI_DMTABLE_INFO AcpiDmTableInfoStao[]; 481 extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[]; 482 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[]; 483 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[]; 484 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[]; 485 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; 486 extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; 487 extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[]; 488 extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[]; 489 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[]; 490 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[]; 491 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[]; 492 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[]; 493 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[]; 494 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[]; 495 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[]; 496 extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[]; 497 498 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; 499 500 extern ACPI_DMTABLE_INFO *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1]; 501 502 503 /* 504 * dmtable and ahtable 505 */ 506 extern const ACPI_DMTABLE_DATA AcpiDmTableData[]; 507 extern const AH_TABLE AcpiSupportedTables[]; 508 509 UINT8 510 AcpiDmGenerateChecksum ( 511 void *Table, 512 UINT32 Length, 513 UINT8 OriginalChecksum); 514 515 const ACPI_DMTABLE_DATA * 516 AcpiDmGetTableData ( 517 char *Signature); 518 519 void 520 AcpiDmDumpDataTable ( 521 ACPI_TABLE_HEADER *Table); 522 523 ACPI_STATUS 524 AcpiDmDumpTable ( 525 UINT32 TableLength, 526 UINT32 TableOffset, 527 void *Table, 528 UINT32 SubTableLength, 529 ACPI_DMTABLE_INFO *Info); 530 531 void 532 AcpiDmLineHeader ( 533 UINT32 Offset, 534 UINT32 ByteLength, 535 char *Name); 536 537 void 538 AcpiDmLineHeader2 ( 539 UINT32 Offset, 540 UINT32 ByteLength, 541 char *Name, 542 UINT32 Value); 543 544 545 /* 546 * dmtbdump 547 */ 548 void 549 AcpiDmDumpBuffer ( 550 void *Table, 551 UINT32 BufferOffset, 552 UINT32 Length, 553 UINT32 AbsoluteOffset, 554 char *Header); 555 556 void 557 AcpiDmDumpUnicode ( 558 void *Table, 559 UINT32 BufferOffset, 560 UINT32 ByteLength); 561 562 void 563 AcpiDmDumpAsf ( 564 ACPI_TABLE_HEADER *Table); 565 566 void 567 AcpiDmDumpCpep ( 568 ACPI_TABLE_HEADER *Table); 569 570 void 571 AcpiDmDumpCsrt ( 572 ACPI_TABLE_HEADER *Table); 573 574 void 575 AcpiDmDumpDbg2 ( 576 ACPI_TABLE_HEADER *Table); 577 578 void 579 AcpiDmDumpDmar ( 580 ACPI_TABLE_HEADER *Table); 581 582 void 583 AcpiDmDumpDrtm ( 584 ACPI_TABLE_HEADER *Table); 585 586 void 587 AcpiDmDumpEinj ( 588 ACPI_TABLE_HEADER *Table); 589 590 void 591 AcpiDmDumpErst ( 592 ACPI_TABLE_HEADER *Table); 593 594 void 595 AcpiDmDumpFadt ( 596 ACPI_TABLE_HEADER *Table); 597 598 void 599 AcpiDmDumpFpdt ( 600 ACPI_TABLE_HEADER *Table); 601 602 void 603 AcpiDmDumpGtdt ( 604 ACPI_TABLE_HEADER *Table); 605 606 void 607 AcpiDmDumpHest ( 608 ACPI_TABLE_HEADER *Table); 609 610 void 611 AcpiDmDumpIort ( 612 ACPI_TABLE_HEADER *Table); 613 614 void 615 AcpiDmDumpIvrs ( 616 ACPI_TABLE_HEADER *Table); 617 618 void 619 AcpiDmDumpLpit ( 620 ACPI_TABLE_HEADER *Table); 621 622 void 623 AcpiDmDumpMadt ( 624 ACPI_TABLE_HEADER *Table); 625 626 void 627 AcpiDmDumpMcfg ( 628 ACPI_TABLE_HEADER *Table); 629 630 void 631 AcpiDmDumpMpst ( 632 ACPI_TABLE_HEADER *Table); 633 634 void 635 AcpiDmDumpMsct ( 636 ACPI_TABLE_HEADER *Table); 637 638 void 639 AcpiDmDumpMtmr ( 640 ACPI_TABLE_HEADER *Table); 641 642 void 643 AcpiDmDumpNfit ( 644 ACPI_TABLE_HEADER *Table); 645 646 void 647 AcpiDmDumpPcct ( 648 ACPI_TABLE_HEADER *Table); 649 650 void 651 AcpiDmDumpPmtt ( 652 ACPI_TABLE_HEADER *Table); 653 654 UINT32 655 AcpiDmDumpRsdp ( 656 ACPI_TABLE_HEADER *Table); 657 658 void 659 AcpiDmDumpRsdt ( 660 ACPI_TABLE_HEADER *Table); 661 662 UINT32 663 AcpiDmDumpS3pt ( 664 ACPI_TABLE_HEADER *Table); 665 666 void 667 AcpiDmDumpSlic ( 668 ACPI_TABLE_HEADER *Table); 669 670 void 671 AcpiDmDumpSlit ( 672 ACPI_TABLE_HEADER *Table); 673 674 void 675 AcpiDmDumpSrat ( 676 ACPI_TABLE_HEADER *Table); 677 678 void 679 AcpiDmDumpStao ( 680 ACPI_TABLE_HEADER *Table); 681 682 void 683 AcpiDmDumpTcpa ( 684 ACPI_TABLE_HEADER *Table); 685 686 void 687 AcpiDmDumpVrtc ( 688 ACPI_TABLE_HEADER *Table); 689 690 void 691 AcpiDmDumpWdat ( 692 ACPI_TABLE_HEADER *Table); 693 694 void 695 AcpiDmDumpWpbt ( 696 ACPI_TABLE_HEADER *Table); 697 698 void 699 AcpiDmDumpXsdt ( 700 ACPI_TABLE_HEADER *Table); 701 702 703 /* 704 * dmwalk 705 */ 706 void 707 AcpiDmDisassemble ( 708 ACPI_WALK_STATE *WalkState, 709 ACPI_PARSE_OBJECT *Origin, 710 UINT32 NumOpcodes); 711 712 void 713 AcpiDmWalkParseTree ( 714 ACPI_PARSE_OBJECT *Op, 715 ASL_WALK_CALLBACK DescendingCallback, 716 ASL_WALK_CALLBACK AscendingCallback, 717 void *Context); 718 719 720 /* 721 * dmopcode 722 */ 723 void 724 AcpiDmDisassembleOneOp ( 725 ACPI_WALK_STATE *WalkState, 726 ACPI_OP_WALK_INFO *Info, 727 ACPI_PARSE_OBJECT *Op); 728 729 UINT32 730 AcpiDmListType ( 731 ACPI_PARSE_OBJECT *Op); 732 733 void 734 AcpiDmMethodFlags ( 735 ACPI_PARSE_OBJECT *Op); 736 737 void 738 AcpiDmDisplayTargetPathname ( 739 ACPI_PARSE_OBJECT *Op); 740 741 void 742 AcpiDmNotifyDescription ( 743 ACPI_PARSE_OBJECT *Op); 744 745 void 746 AcpiDmPredefinedDescription ( 747 ACPI_PARSE_OBJECT *Op); 748 749 void 750 AcpiDmFieldPredefinedDescription ( 751 ACPI_PARSE_OBJECT *Op); 752 753 void 754 AcpiDmFieldFlags ( 755 ACPI_PARSE_OBJECT *Op); 756 757 void 758 AcpiDmAddressSpace ( 759 UINT8 SpaceId); 760 761 void 762 AcpiDmRegionFlags ( 763 ACPI_PARSE_OBJECT *Op); 764 765 void 766 AcpiDmMatchOp ( 767 ACPI_PARSE_OBJECT *Op); 768 769 770 /* 771 * dmnames 772 */ 773 UINT32 774 AcpiDmDumpName ( 775 UINT32 Name); 776 777 ACPI_STATUS 778 AcpiPsDisplayObjectPathname ( 779 ACPI_WALK_STATE *WalkState, 780 ACPI_PARSE_OBJECT *Op); 781 782 void 783 AcpiDmNamestring ( 784 char *Name); 785 786 787 /* 788 * dmbuffer 789 */ 790 void 791 AcpiDmDisasmByteList ( 792 UINT32 Level, 793 UINT8 *ByteData, 794 UINT32 ByteCount); 795 796 void 797 AcpiDmByteList ( 798 ACPI_OP_WALK_INFO *Info, 799 ACPI_PARSE_OBJECT *Op); 800 801 void 802 AcpiDmCheckForHardwareId ( 803 ACPI_PARSE_OBJECT *Op); 804 805 void 806 AcpiDmDecompressEisaId ( 807 UINT32 EncodedId); 808 809 BOOLEAN 810 AcpiDmIsUuidBuffer ( 811 ACPI_PARSE_OBJECT *Op); 812 813 BOOLEAN 814 AcpiDmIsUnicodeBuffer ( 815 ACPI_PARSE_OBJECT *Op); 816 817 BOOLEAN 818 AcpiDmIsStringBuffer ( 819 ACPI_PARSE_OBJECT *Op); 820 821 BOOLEAN 822 AcpiDmIsPldBuffer ( 823 ACPI_PARSE_OBJECT *Op); 824 825 826 /* 827 * dmdeferred 828 */ 829 ACPI_STATUS 830 AcpiDmParseDeferredOps ( 831 ACPI_PARSE_OBJECT *Root); 832 833 834 /* 835 * dmextern 836 */ 837 ACPI_STATUS 838 AcpiDmAddToExternalFileList ( 839 char *PathList); 840 841 void 842 AcpiDmClearExternalFileList ( 843 void); 844 845 void 846 AcpiDmAddOpToExternalList ( 847 ACPI_PARSE_OBJECT *Op, 848 char *Path, 849 UINT8 Type, 850 UINT32 Value, 851 UINT16 Flags); 852 853 void 854 AcpiDmAddNodeToExternalList ( 855 ACPI_NAMESPACE_NODE *Node, 856 UINT8 Type, 857 UINT32 Value, 858 UINT16 Flags); 859 860 void 861 AcpiDmAddExternalsToNamespace ( 862 void); 863 864 UINT32 865 AcpiDmGetExternalMethodCount ( 866 void); 867 868 void 869 AcpiDmClearExternalList ( 870 void); 871 872 void 873 AcpiDmEmitExternals ( 874 void); 875 876 void 877 AcpiDmUnresolvedWarning ( 878 UINT8 Type); 879 880 void 881 AcpiDmGetExternalsFromFile ( 882 void); 883 884 /* 885 * dmresrc 886 */ 887 void 888 AcpiDmDumpInteger8 ( 889 UINT8 Value, 890 const char *Name); 891 892 void 893 AcpiDmDumpInteger16 ( 894 UINT16 Value, 895 const char *Name); 896 897 void 898 AcpiDmDumpInteger32 ( 899 UINT32 Value, 900 const char *Name); 901 902 void 903 AcpiDmDumpInteger64 ( 904 UINT64 Value, 905 const char *Name); 906 907 void 908 AcpiDmResourceTemplate ( 909 ACPI_OP_WALK_INFO *Info, 910 ACPI_PARSE_OBJECT *Op, 911 UINT8 *ByteData, 912 UINT32 ByteCount); 913 914 ACPI_STATUS 915 AcpiDmIsResourceTemplate ( 916 ACPI_WALK_STATE *WalkState, 917 ACPI_PARSE_OBJECT *Op); 918 919 void 920 AcpiDmBitList ( 921 UINT16 Mask); 922 923 void 924 AcpiDmDescriptorName ( 925 void); 926 927 928 /* 929 * dmresrcl 930 */ 931 void 932 AcpiDmWordDescriptor ( 933 ACPI_OP_WALK_INFO *Info, 934 AML_RESOURCE *Resource, 935 UINT32 Length, 936 UINT32 Level); 937 938 void 939 AcpiDmDwordDescriptor ( 940 ACPI_OP_WALK_INFO *Info, 941 AML_RESOURCE *Resource, 942 UINT32 Length, 943 UINT32 Level); 944 945 void 946 AcpiDmExtendedDescriptor ( 947 ACPI_OP_WALK_INFO *Info, 948 AML_RESOURCE *Resource, 949 UINT32 Length, 950 UINT32 Level); 951 952 void 953 AcpiDmQwordDescriptor ( 954 ACPI_OP_WALK_INFO *Info, 955 AML_RESOURCE *Resource, 956 UINT32 Length, 957 UINT32 Level); 958 959 void 960 AcpiDmMemory24Descriptor ( 961 ACPI_OP_WALK_INFO *Info, 962 AML_RESOURCE *Resource, 963 UINT32 Length, 964 UINT32 Level); 965 966 void 967 AcpiDmMemory32Descriptor ( 968 ACPI_OP_WALK_INFO *Info, 969 AML_RESOURCE *Resource, 970 UINT32 Length, 971 UINT32 Level); 972 973 void 974 AcpiDmFixedMemory32Descriptor ( 975 ACPI_OP_WALK_INFO *Info, 976 AML_RESOURCE *Resource, 977 UINT32 Length, 978 UINT32 Level); 979 980 void 981 AcpiDmGenericRegisterDescriptor ( 982 ACPI_OP_WALK_INFO *Info, 983 AML_RESOURCE *Resource, 984 UINT32 Length, 985 UINT32 Level); 986 987 void 988 AcpiDmInterruptDescriptor ( 989 ACPI_OP_WALK_INFO *Info, 990 AML_RESOURCE *Resource, 991 UINT32 Length, 992 UINT32 Level); 993 994 void 995 AcpiDmVendorLargeDescriptor ( 996 ACPI_OP_WALK_INFO *Info, 997 AML_RESOURCE *Resource, 998 UINT32 Length, 999 UINT32 Level); 1000 1001 void 1002 AcpiDmGpioDescriptor ( 1003 ACPI_OP_WALK_INFO *Info, 1004 AML_RESOURCE *Resource, 1005 UINT32 Length, 1006 UINT32 Level); 1007 1008 void 1009 AcpiDmSerialBusDescriptor ( 1010 ACPI_OP_WALK_INFO *Info, 1011 AML_RESOURCE *Resource, 1012 UINT32 Length, 1013 UINT32 Level); 1014 1015 void 1016 AcpiDmVendorCommon ( 1017 const char *Name, 1018 UINT8 *ByteData, 1019 UINT32 Length, 1020 UINT32 Level); 1021 1022 1023 /* 1024 * dmresrcs 1025 */ 1026 void 1027 AcpiDmIrqDescriptor ( 1028 ACPI_OP_WALK_INFO *Info, 1029 AML_RESOURCE *Resource, 1030 UINT32 Length, 1031 UINT32 Level); 1032 1033 void 1034 AcpiDmDmaDescriptor ( 1035 ACPI_OP_WALK_INFO *Info, 1036 AML_RESOURCE *Resource, 1037 UINT32 Length, 1038 UINT32 Level); 1039 1040 void 1041 AcpiDmFixedDmaDescriptor ( 1042 ACPI_OP_WALK_INFO *Info, 1043 AML_RESOURCE *Resource, 1044 UINT32 Length, 1045 UINT32 Level); 1046 1047 void 1048 AcpiDmIoDescriptor ( 1049 ACPI_OP_WALK_INFO *Info, 1050 AML_RESOURCE *Resource, 1051 UINT32 Length, 1052 UINT32 Level); 1053 1054 void 1055 AcpiDmFixedIoDescriptor ( 1056 ACPI_OP_WALK_INFO *Info, 1057 AML_RESOURCE *Resource, 1058 UINT32 Length, 1059 UINT32 Level); 1060 1061 void 1062 AcpiDmStartDependentDescriptor ( 1063 ACPI_OP_WALK_INFO *Info, 1064 AML_RESOURCE *Resource, 1065 UINT32 Length, 1066 UINT32 Level); 1067 1068 void 1069 AcpiDmEndDependentDescriptor ( 1070 ACPI_OP_WALK_INFO *Info, 1071 AML_RESOURCE *Resource, 1072 UINT32 Length, 1073 UINT32 Level); 1074 1075 void 1076 AcpiDmVendorSmallDescriptor ( 1077 ACPI_OP_WALK_INFO *Info, 1078 AML_RESOURCE *Resource, 1079 UINT32 Length, 1080 UINT32 Level); 1081 1082 1083 /* 1084 * dmutils 1085 */ 1086 void 1087 AcpiDmDecodeAttribute ( 1088 UINT8 Attribute); 1089 1090 void 1091 AcpiDmIndent ( 1092 UINT32 Level); 1093 1094 BOOLEAN 1095 AcpiDmCommaIfListMember ( 1096 ACPI_PARSE_OBJECT *Op); 1097 1098 void 1099 AcpiDmCommaIfFieldMember ( 1100 ACPI_PARSE_OBJECT *Op); 1101 1102 1103 /* 1104 * dmrestag 1105 */ 1106 void 1107 AcpiDmFindResources ( 1108 ACPI_PARSE_OBJECT *Root); 1109 1110 void 1111 AcpiDmCheckResourceReference ( 1112 ACPI_PARSE_OBJECT *Op, 1113 ACPI_WALK_STATE *WalkState); 1114 1115 1116 /* 1117 * dmcstyle 1118 */ 1119 BOOLEAN 1120 AcpiDmCheckForSymbolicOpcode ( 1121 ACPI_PARSE_OBJECT *Op, 1122 ACPI_OP_WALK_INFO *Info); 1123 1124 void 1125 AcpiDmCloseOperator ( 1126 ACPI_PARSE_OBJECT *Op); 1127 1128 1129 /* 1130 * dmtables 1131 */ 1132 void 1133 AdDisassemblerHeader ( 1134 char *Filename, 1135 UINT8 TableType); 1136 1137 #define ACPI_IS_AML_TABLE 0 1138 #define ACPI_IS_DATA_TABLE 1 1139 1140 1141 /* 1142 * adisasm 1143 */ 1144 ACPI_STATUS 1145 AdAmlDisassemble ( 1146 BOOLEAN OutToFile, 1147 char *Filename, 1148 char *Prefix, 1149 char **OutFilename); 1150 1151 ACPI_STATUS 1152 AdGetLocalTables ( 1153 void); 1154 1155 ACPI_STATUS 1156 AdParseTable ( 1157 ACPI_TABLE_HEADER *Table, 1158 ACPI_OWNER_ID *OwnerId, 1159 BOOLEAN LoadTable, 1160 BOOLEAN External); 1161 1162 ACPI_STATUS 1163 AdDisplayTables ( 1164 char *Filename, 1165 ACPI_TABLE_HEADER *Table); 1166 1167 ACPI_STATUS 1168 AdDisplayStatistics ( 1169 void); 1170 1171 #endif /* __ACDISASM_H__ */ 1172