1 /****************************************************************************** 2 * 3 * Name: acdisasm.h - AML disassembler 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2016, 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 #ifndef __ACDISASM_H__ 45 #define __ACDISASM_H__ 46 47 #include <contrib/dev/acpica/include/amlresrc.h> 48 49 50 #define BLOCK_NONE 0 51 #define BLOCK_PAREN 1 52 #define BLOCK_BRACE 2 53 #define BLOCK_COMMA_LIST 4 54 #define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD" 55 56 /* 57 * Raw table data header. Used by disassembler and data table compiler. 58 * Do not change. 59 */ 60 #define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data" 61 62 63 typedef struct acpi_dmtable_info 64 { 65 UINT8 Opcode; 66 UINT16 Offset; 67 char *Name; 68 UINT8 Flags; 69 70 } ACPI_DMTABLE_INFO; 71 72 /* Values for Flags field above */ 73 74 #define DT_LENGTH 0x01 /* Field is a subtable length */ 75 #define DT_FLAG 0x02 /* Field is a flag value */ 76 #define DT_NON_ZERO 0x04 /* Field must be non-zero */ 77 #define DT_OPTIONAL 0x08 /* Field is optional */ 78 #define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */ 79 #define DT_COUNT 0x20 /* Currently not used */ 80 81 /* 82 * Values for Opcode above. 83 * Note: 0-7 must not change, they are used as a flag shift value. Other 84 * than those, new values can be added wherever appropriate. 85 */ 86 typedef enum 87 { 88 /* Simple Data Types */ 89 90 ACPI_DMT_FLAG0 = 0, 91 ACPI_DMT_FLAG1 = 1, 92 ACPI_DMT_FLAG2 = 2, 93 ACPI_DMT_FLAG3 = 3, 94 ACPI_DMT_FLAG4 = 4, 95 ACPI_DMT_FLAG5 = 5, 96 ACPI_DMT_FLAG6 = 6, 97 ACPI_DMT_FLAG7 = 7, 98 ACPI_DMT_FLAGS0, 99 ACPI_DMT_FLAGS1, 100 ACPI_DMT_FLAGS2, 101 ACPI_DMT_FLAGS4, 102 ACPI_DMT_UINT8, 103 ACPI_DMT_UINT16, 104 ACPI_DMT_UINT24, 105 ACPI_DMT_UINT32, 106 ACPI_DMT_UINT40, 107 ACPI_DMT_UINT48, 108 ACPI_DMT_UINT56, 109 ACPI_DMT_UINT64, 110 ACPI_DMT_BUF7, 111 ACPI_DMT_BUF10, 112 ACPI_DMT_BUF12, 113 ACPI_DMT_BUF16, 114 ACPI_DMT_BUF128, 115 ACPI_DMT_SIG, 116 ACPI_DMT_STRING, 117 ACPI_DMT_NAME4, 118 ACPI_DMT_NAME6, 119 ACPI_DMT_NAME8, 120 121 /* Types that are decoded to strings and miscellaneous */ 122 123 ACPI_DMT_ACCWIDTH, 124 ACPI_DMT_CHKSUM, 125 ACPI_DMT_GAS, 126 ACPI_DMT_SPACEID, 127 ACPI_DMT_UNICODE, 128 ACPI_DMT_UUID, 129 130 /* Types used only for the Data Table Compiler */ 131 132 ACPI_DMT_BUFFER, 133 ACPI_DMT_RAW_BUFFER, /* Large, multiple line buffer */ 134 ACPI_DMT_DEVICE_PATH, 135 ACPI_DMT_LABEL, 136 ACPI_DMT_PCI_PATH, 137 138 /* Types that are specific to particular ACPI tables */ 139 140 ACPI_DMT_ASF, 141 ACPI_DMT_DMAR, 142 ACPI_DMT_DMAR_SCOPE, 143 ACPI_DMT_EINJACT, 144 ACPI_DMT_EINJINST, 145 ACPI_DMT_ERSTACT, 146 ACPI_DMT_ERSTINST, 147 ACPI_DMT_FADTPM, 148 ACPI_DMT_GTDT, 149 ACPI_DMT_HEST, 150 ACPI_DMT_HESTNTFY, 151 ACPI_DMT_HESTNTYP, 152 ACPI_DMT_IORTMEM, 153 ACPI_DMT_IVRS, 154 ACPI_DMT_LPIT, 155 ACPI_DMT_MADT, 156 ACPI_DMT_NFIT, 157 ACPI_DMT_PCCT, 158 ACPI_DMT_PMTT, 159 ACPI_DMT_SLIC, 160 ACPI_DMT_SRAT, 161 162 /* Special opcodes */ 163 164 ACPI_DMT_EXTRA_TEXT, 165 ACPI_DMT_EXIT 166 167 } ACPI_ENTRY_TYPES; 168 169 typedef 170 void (*ACPI_DMTABLE_HANDLER) ( 171 ACPI_TABLE_HEADER *Table); 172 173 typedef 174 ACPI_STATUS (*ACPI_CMTABLE_HANDLER) ( 175 void **PFieldList); 176 177 typedef struct acpi_dmtable_data 178 { 179 char *Signature; 180 ACPI_DMTABLE_INFO *TableInfo; 181 ACPI_DMTABLE_HANDLER TableHandler; 182 ACPI_CMTABLE_HANDLER CmTableHandler; 183 const unsigned char *Template; 184 185 } ACPI_DMTABLE_DATA; 186 187 188 typedef struct acpi_op_walk_info 189 { 190 ACPI_WALK_STATE *WalkState; 191 ACPI_PARSE_OBJECT *MappingOp; 192 UINT8 *PreviousAml; 193 UINT8 *StartAml; 194 UINT32 Level; 195 UINT32 LastLevel; 196 UINT32 Count; 197 UINT32 BitOffset; 198 UINT32 Flags; 199 UINT32 AmlOffset; 200 201 } ACPI_OP_WALK_INFO; 202 203 /* 204 * TBD - another copy of this is in asltypes.h, fix 205 */ 206 #ifndef ASL_WALK_CALLBACK_DEFINED 207 typedef 208 ACPI_STATUS (*ASL_WALK_CALLBACK) ( 209 ACPI_PARSE_OBJECT *Op, 210 UINT32 Level, 211 void *Context); 212 #define ASL_WALK_CALLBACK_DEFINED 213 #endif 214 215 typedef 216 void (*ACPI_RESOURCE_HANDLER) ( 217 ACPI_OP_WALK_INFO *Info, 218 AML_RESOURCE *Resource, 219 UINT32 Length, 220 UINT32 Level); 221 222 typedef struct acpi_resource_tag 223 { 224 UINT32 BitIndex; 225 char *Tag; 226 227 } ACPI_RESOURCE_TAG; 228 229 /* Strings used for decoding flags to ASL keywords */ 230 231 extern const char *AcpiGbl_WordDecode[]; 232 extern const char *AcpiGbl_IrqDecode[]; 233 extern const char *AcpiGbl_LockRule[]; 234 extern const char *AcpiGbl_AccessTypes[]; 235 extern const char *AcpiGbl_UpdateRules[]; 236 extern const char *AcpiGbl_MatchOps[]; 237 238 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[]; 239 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1[]; 240 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a[]; 241 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2[]; 242 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[]; 243 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3[]; 244 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[]; 245 extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; 246 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; 247 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; 248 extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; 249 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; 250 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; 251 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; 252 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[]; 253 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[]; 254 extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2a[]; 255 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[]; 256 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[]; 257 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[]; 258 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[]; 259 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[]; 260 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[]; 261 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[]; 262 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[]; 263 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[]; 264 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[]; 265 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[]; 266 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; 267 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; 268 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; 269 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[]; 270 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[]; 271 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0[]; 272 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0a[]; 273 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1[]; 274 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1a[]; 275 extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm2[]; 276 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; 277 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; 278 extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; 279 extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[]; 280 extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[]; 281 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[]; 282 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; 283 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[]; 284 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; 285 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; 286 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[]; 287 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; 288 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[]; 289 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[]; 290 extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[]; 291 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[]; 292 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[]; 293 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[]; 294 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[]; 295 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[]; 296 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[]; 297 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[]; 298 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[]; 299 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[]; 300 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[]; 301 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[]; 302 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[]; 303 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[]; 304 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[]; 305 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[]; 306 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[]; 307 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[]; 308 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[]; 309 extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[]; 310 extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[]; 311 extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[]; 312 extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[]; 313 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort[]; 314 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[]; 315 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[]; 316 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1[]; 317 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1a[]; 318 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort2[]; 319 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[]; 320 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[]; 321 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[]; 322 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[]; 323 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[]; 324 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[]; 325 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[]; 326 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[]; 327 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[]; 328 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[]; 329 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[]; 330 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[]; 331 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[]; 332 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[]; 333 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[]; 334 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[]; 335 extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[]; 336 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[]; 337 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[]; 338 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[]; 339 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt2[]; 340 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt3[]; 341 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt4[]; 342 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt5[]; 343 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt6[]; 344 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[]; 345 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[]; 346 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[]; 347 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[]; 348 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[]; 349 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[]; 350 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[]; 351 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[]; 352 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[]; 353 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; 354 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; 355 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; 356 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[]; 357 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[]; 358 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[]; 359 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[]; 360 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[]; 361 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[]; 362 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[]; 363 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; 364 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; 365 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[]; 366 extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[]; 367 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit[]; 368 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfitHdr[]; 369 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[]; 370 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit1[]; 371 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2[]; 372 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2a[]; 373 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3[]; 374 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3a[]; 375 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit4[]; 376 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit5[]; 377 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[]; 378 extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[]; 379 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[]; 380 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; 381 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[]; 382 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[]; 383 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[]; 384 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[]; 385 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[]; 386 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[]; 387 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; 388 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[]; 389 extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[]; 390 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRasf[]; 391 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; 392 extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; 393 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[]; 394 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[]; 395 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[]; 396 extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[]; 397 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[]; 398 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[]; 399 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[]; 400 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[]; 401 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[]; 402 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat[]; 403 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[]; 404 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[]; 405 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; 406 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; 407 extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[]; 408 extern ACPI_DMTABLE_INFO AcpiDmTableInfoStao[]; 409 extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[]; 410 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[]; 411 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[]; 412 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[]; 413 extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; 414 extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; 415 extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[]; 416 extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[]; 417 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[]; 418 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[]; 419 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[]; 420 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[]; 421 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[]; 422 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[]; 423 extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[]; 424 extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[]; 425 426 extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2]; 427 428 /* 429 * dmtable and ahtable 430 */ 431 extern const ACPI_DMTABLE_DATA AcpiDmTableData[]; 432 extern const AH_TABLE AcpiSupportedTables[]; 433 434 UINT8 435 AcpiDmGenerateChecksum ( 436 void *Table, 437 UINT32 Length, 438 UINT8 OriginalChecksum); 439 440 const ACPI_DMTABLE_DATA * 441 AcpiDmGetTableData ( 442 char *Signature); 443 444 void 445 AcpiDmDumpDataTable ( 446 ACPI_TABLE_HEADER *Table); 447 448 ACPI_STATUS 449 AcpiDmDumpTable ( 450 UINT32 TableLength, 451 UINT32 TableOffset, 452 void *Table, 453 UINT32 SubTableLength, 454 ACPI_DMTABLE_INFO *Info); 455 456 void 457 AcpiDmLineHeader ( 458 UINT32 Offset, 459 UINT32 ByteLength, 460 char *Name); 461 462 void 463 AcpiDmLineHeader2 ( 464 UINT32 Offset, 465 UINT32 ByteLength, 466 char *Name, 467 UINT32 Value); 468 469 470 /* 471 * dmtbdump 472 */ 473 void 474 AcpiDmDumpBuffer ( 475 void *Table, 476 UINT32 BufferOffset, 477 UINT32 Length, 478 UINT32 AbsoluteOffset, 479 char *Header); 480 481 void 482 AcpiDmDumpUnicode ( 483 void *Table, 484 UINT32 BufferOffset, 485 UINT32 ByteLength); 486 487 void 488 AcpiDmDumpAsf ( 489 ACPI_TABLE_HEADER *Table); 490 491 void 492 AcpiDmDumpCpep ( 493 ACPI_TABLE_HEADER *Table); 494 495 void 496 AcpiDmDumpCsrt ( 497 ACPI_TABLE_HEADER *Table); 498 499 void 500 AcpiDmDumpDbg2 ( 501 ACPI_TABLE_HEADER *Table); 502 503 void 504 AcpiDmDumpDmar ( 505 ACPI_TABLE_HEADER *Table); 506 507 void 508 AcpiDmDumpDrtm ( 509 ACPI_TABLE_HEADER *Table); 510 511 void 512 AcpiDmDumpEinj ( 513 ACPI_TABLE_HEADER *Table); 514 515 void 516 AcpiDmDumpErst ( 517 ACPI_TABLE_HEADER *Table); 518 519 void 520 AcpiDmDumpFadt ( 521 ACPI_TABLE_HEADER *Table); 522 523 void 524 AcpiDmDumpFpdt ( 525 ACPI_TABLE_HEADER *Table); 526 527 void 528 AcpiDmDumpGtdt ( 529 ACPI_TABLE_HEADER *Table); 530 531 void 532 AcpiDmDumpHest ( 533 ACPI_TABLE_HEADER *Table); 534 535 void 536 AcpiDmDumpIort ( 537 ACPI_TABLE_HEADER *Table); 538 539 void 540 AcpiDmDumpIvrs ( 541 ACPI_TABLE_HEADER *Table); 542 543 void 544 AcpiDmDumpLpit ( 545 ACPI_TABLE_HEADER *Table); 546 547 void 548 AcpiDmDumpMadt ( 549 ACPI_TABLE_HEADER *Table); 550 551 void 552 AcpiDmDumpMcfg ( 553 ACPI_TABLE_HEADER *Table); 554 555 void 556 AcpiDmDumpMpst ( 557 ACPI_TABLE_HEADER *Table); 558 559 void 560 AcpiDmDumpMsct ( 561 ACPI_TABLE_HEADER *Table); 562 563 void 564 AcpiDmDumpMtmr ( 565 ACPI_TABLE_HEADER *Table); 566 567 void 568 AcpiDmDumpNfit ( 569 ACPI_TABLE_HEADER *Table); 570 571 void 572 AcpiDmDumpPcct ( 573 ACPI_TABLE_HEADER *Table); 574 575 void 576 AcpiDmDumpPmtt ( 577 ACPI_TABLE_HEADER *Table); 578 579 UINT32 580 AcpiDmDumpRsdp ( 581 ACPI_TABLE_HEADER *Table); 582 583 void 584 AcpiDmDumpRsdt ( 585 ACPI_TABLE_HEADER *Table); 586 587 UINT32 588 AcpiDmDumpS3pt ( 589 ACPI_TABLE_HEADER *Table); 590 591 void 592 AcpiDmDumpSlic ( 593 ACPI_TABLE_HEADER *Table); 594 595 void 596 AcpiDmDumpSlit ( 597 ACPI_TABLE_HEADER *Table); 598 599 void 600 AcpiDmDumpSrat ( 601 ACPI_TABLE_HEADER *Table); 602 603 void 604 AcpiDmDumpStao ( 605 ACPI_TABLE_HEADER *Table); 606 607 void 608 AcpiDmDumpTcpa ( 609 ACPI_TABLE_HEADER *Table); 610 611 void 612 AcpiDmDumpVrtc ( 613 ACPI_TABLE_HEADER *Table); 614 615 void 616 AcpiDmDumpWdat ( 617 ACPI_TABLE_HEADER *Table); 618 619 void 620 AcpiDmDumpWpbt ( 621 ACPI_TABLE_HEADER *Table); 622 623 void 624 AcpiDmDumpXsdt ( 625 ACPI_TABLE_HEADER *Table); 626 627 628 /* 629 * dmwalk 630 */ 631 void 632 AcpiDmDisassemble ( 633 ACPI_WALK_STATE *WalkState, 634 ACPI_PARSE_OBJECT *Origin, 635 UINT32 NumOpcodes); 636 637 void 638 AcpiDmWalkParseTree ( 639 ACPI_PARSE_OBJECT *Op, 640 ASL_WALK_CALLBACK DescendingCallback, 641 ASL_WALK_CALLBACK AscendingCallback, 642 void *Context); 643 644 645 /* 646 * dmopcode 647 */ 648 void 649 AcpiDmDisassembleOneOp ( 650 ACPI_WALK_STATE *WalkState, 651 ACPI_OP_WALK_INFO *Info, 652 ACPI_PARSE_OBJECT *Op); 653 654 UINT32 655 AcpiDmListType ( 656 ACPI_PARSE_OBJECT *Op); 657 658 void 659 AcpiDmMethodFlags ( 660 ACPI_PARSE_OBJECT *Op); 661 662 void 663 AcpiDmDisplayTargetPathname ( 664 ACPI_PARSE_OBJECT *Op); 665 666 void 667 AcpiDmNotifyDescription ( 668 ACPI_PARSE_OBJECT *Op); 669 670 void 671 AcpiDmPredefinedDescription ( 672 ACPI_PARSE_OBJECT *Op); 673 674 void 675 AcpiDmFieldPredefinedDescription ( 676 ACPI_PARSE_OBJECT *Op); 677 678 void 679 AcpiDmFieldFlags ( 680 ACPI_PARSE_OBJECT *Op); 681 682 void 683 AcpiDmAddressSpace ( 684 UINT8 SpaceId); 685 686 void 687 AcpiDmRegionFlags ( 688 ACPI_PARSE_OBJECT *Op); 689 690 void 691 AcpiDmMatchOp ( 692 ACPI_PARSE_OBJECT *Op); 693 694 695 /* 696 * dmnames 697 */ 698 UINT32 699 AcpiDmDumpName ( 700 UINT32 Name); 701 702 ACPI_STATUS 703 AcpiPsDisplayObjectPathname ( 704 ACPI_WALK_STATE *WalkState, 705 ACPI_PARSE_OBJECT *Op); 706 707 void 708 AcpiDmNamestring ( 709 char *Name); 710 711 712 /* 713 * dmbuffer 714 */ 715 void 716 AcpiDmDisasmByteList ( 717 UINT32 Level, 718 UINT8 *ByteData, 719 UINT32 ByteCount); 720 721 void 722 AcpiDmByteList ( 723 ACPI_OP_WALK_INFO *Info, 724 ACPI_PARSE_OBJECT *Op); 725 726 void 727 AcpiDmCheckForHardwareId ( 728 ACPI_PARSE_OBJECT *Op); 729 730 void 731 AcpiDmDecompressEisaId ( 732 UINT32 EncodedId); 733 734 BOOLEAN 735 AcpiDmIsUuidBuffer ( 736 ACPI_PARSE_OBJECT *Op); 737 738 BOOLEAN 739 AcpiDmIsUnicodeBuffer ( 740 ACPI_PARSE_OBJECT *Op); 741 742 BOOLEAN 743 AcpiDmIsStringBuffer ( 744 ACPI_PARSE_OBJECT *Op); 745 746 BOOLEAN 747 AcpiDmIsPldBuffer ( 748 ACPI_PARSE_OBJECT *Op); 749 750 751 /* 752 * dmdeferred 753 */ 754 ACPI_STATUS 755 AcpiDmParseDeferredOps ( 756 ACPI_PARSE_OBJECT *Root); 757 758 759 /* 760 * dmextern 761 */ 762 ACPI_STATUS 763 AcpiDmAddToExternalFileList ( 764 char *PathList); 765 766 void 767 AcpiDmClearExternalFileList ( 768 void); 769 770 void 771 AcpiDmAddOpToExternalList ( 772 ACPI_PARSE_OBJECT *Op, 773 char *Path, 774 UINT8 Type, 775 UINT32 Value, 776 UINT16 Flags); 777 778 void 779 AcpiDmAddNodeToExternalList ( 780 ACPI_NAMESPACE_NODE *Node, 781 UINT8 Type, 782 UINT32 Value, 783 UINT16 Flags); 784 785 void 786 AcpiDmAddExternalsToNamespace ( 787 void); 788 789 UINT32 790 AcpiDmGetExternalMethodCount ( 791 void); 792 793 void 794 AcpiDmClearExternalList ( 795 void); 796 797 void 798 AcpiDmEmitExternals ( 799 void); 800 801 void 802 AcpiDmUnresolvedWarning ( 803 UINT8 Type); 804 805 void 806 AcpiDmGetExternalsFromFile ( 807 void); 808 809 /* 810 * dmresrc 811 */ 812 void 813 AcpiDmDumpInteger8 ( 814 UINT8 Value, 815 const char *Name); 816 817 void 818 AcpiDmDumpInteger16 ( 819 UINT16 Value, 820 const char *Name); 821 822 void 823 AcpiDmDumpInteger32 ( 824 UINT32 Value, 825 const char *Name); 826 827 void 828 AcpiDmDumpInteger64 ( 829 UINT64 Value, 830 const char *Name); 831 832 void 833 AcpiDmResourceTemplate ( 834 ACPI_OP_WALK_INFO *Info, 835 ACPI_PARSE_OBJECT *Op, 836 UINT8 *ByteData, 837 UINT32 ByteCount); 838 839 ACPI_STATUS 840 AcpiDmIsResourceTemplate ( 841 ACPI_WALK_STATE *WalkState, 842 ACPI_PARSE_OBJECT *Op); 843 844 void 845 AcpiDmBitList ( 846 UINT16 Mask); 847 848 void 849 AcpiDmDescriptorName ( 850 void); 851 852 853 /* 854 * dmresrcl 855 */ 856 void 857 AcpiDmWordDescriptor ( 858 ACPI_OP_WALK_INFO *Info, 859 AML_RESOURCE *Resource, 860 UINT32 Length, 861 UINT32 Level); 862 863 void 864 AcpiDmDwordDescriptor ( 865 ACPI_OP_WALK_INFO *Info, 866 AML_RESOURCE *Resource, 867 UINT32 Length, 868 UINT32 Level); 869 870 void 871 AcpiDmExtendedDescriptor ( 872 ACPI_OP_WALK_INFO *Info, 873 AML_RESOURCE *Resource, 874 UINT32 Length, 875 UINT32 Level); 876 877 void 878 AcpiDmQwordDescriptor ( 879 ACPI_OP_WALK_INFO *Info, 880 AML_RESOURCE *Resource, 881 UINT32 Length, 882 UINT32 Level); 883 884 void 885 AcpiDmMemory24Descriptor ( 886 ACPI_OP_WALK_INFO *Info, 887 AML_RESOURCE *Resource, 888 UINT32 Length, 889 UINT32 Level); 890 891 void 892 AcpiDmMemory32Descriptor ( 893 ACPI_OP_WALK_INFO *Info, 894 AML_RESOURCE *Resource, 895 UINT32 Length, 896 UINT32 Level); 897 898 void 899 AcpiDmFixedMemory32Descriptor ( 900 ACPI_OP_WALK_INFO *Info, 901 AML_RESOURCE *Resource, 902 UINT32 Length, 903 UINT32 Level); 904 905 void 906 AcpiDmGenericRegisterDescriptor ( 907 ACPI_OP_WALK_INFO *Info, 908 AML_RESOURCE *Resource, 909 UINT32 Length, 910 UINT32 Level); 911 912 void 913 AcpiDmInterruptDescriptor ( 914 ACPI_OP_WALK_INFO *Info, 915 AML_RESOURCE *Resource, 916 UINT32 Length, 917 UINT32 Level); 918 919 void 920 AcpiDmVendorLargeDescriptor ( 921 ACPI_OP_WALK_INFO *Info, 922 AML_RESOURCE *Resource, 923 UINT32 Length, 924 UINT32 Level); 925 926 void 927 AcpiDmGpioDescriptor ( 928 ACPI_OP_WALK_INFO *Info, 929 AML_RESOURCE *Resource, 930 UINT32 Length, 931 UINT32 Level); 932 933 void 934 AcpiDmSerialBusDescriptor ( 935 ACPI_OP_WALK_INFO *Info, 936 AML_RESOURCE *Resource, 937 UINT32 Length, 938 UINT32 Level); 939 940 void 941 AcpiDmVendorCommon ( 942 const char *Name, 943 UINT8 *ByteData, 944 UINT32 Length, 945 UINT32 Level); 946 947 948 /* 949 * dmresrcs 950 */ 951 void 952 AcpiDmIrqDescriptor ( 953 ACPI_OP_WALK_INFO *Info, 954 AML_RESOURCE *Resource, 955 UINT32 Length, 956 UINT32 Level); 957 958 void 959 AcpiDmDmaDescriptor ( 960 ACPI_OP_WALK_INFO *Info, 961 AML_RESOURCE *Resource, 962 UINT32 Length, 963 UINT32 Level); 964 965 void 966 AcpiDmFixedDmaDescriptor ( 967 ACPI_OP_WALK_INFO *Info, 968 AML_RESOURCE *Resource, 969 UINT32 Length, 970 UINT32 Level); 971 972 void 973 AcpiDmIoDescriptor ( 974 ACPI_OP_WALK_INFO *Info, 975 AML_RESOURCE *Resource, 976 UINT32 Length, 977 UINT32 Level); 978 979 void 980 AcpiDmFixedIoDescriptor ( 981 ACPI_OP_WALK_INFO *Info, 982 AML_RESOURCE *Resource, 983 UINT32 Length, 984 UINT32 Level); 985 986 void 987 AcpiDmStartDependentDescriptor ( 988 ACPI_OP_WALK_INFO *Info, 989 AML_RESOURCE *Resource, 990 UINT32 Length, 991 UINT32 Level); 992 993 void 994 AcpiDmEndDependentDescriptor ( 995 ACPI_OP_WALK_INFO *Info, 996 AML_RESOURCE *Resource, 997 UINT32 Length, 998 UINT32 Level); 999 1000 void 1001 AcpiDmVendorSmallDescriptor ( 1002 ACPI_OP_WALK_INFO *Info, 1003 AML_RESOURCE *Resource, 1004 UINT32 Length, 1005 UINT32 Level); 1006 1007 1008 /* 1009 * dmutils 1010 */ 1011 void 1012 AcpiDmDecodeAttribute ( 1013 UINT8 Attribute); 1014 1015 void 1016 AcpiDmIndent ( 1017 UINT32 Level); 1018 1019 BOOLEAN 1020 AcpiDmCommaIfListMember ( 1021 ACPI_PARSE_OBJECT *Op); 1022 1023 void 1024 AcpiDmCommaIfFieldMember ( 1025 ACPI_PARSE_OBJECT *Op); 1026 1027 1028 /* 1029 * dmrestag 1030 */ 1031 void 1032 AcpiDmFindResources ( 1033 ACPI_PARSE_OBJECT *Root); 1034 1035 void 1036 AcpiDmCheckResourceReference ( 1037 ACPI_PARSE_OBJECT *Op, 1038 ACPI_WALK_STATE *WalkState); 1039 1040 1041 /* 1042 * dmcstyle 1043 */ 1044 BOOLEAN 1045 AcpiDmCheckForSymbolicOpcode ( 1046 ACPI_PARSE_OBJECT *Op, 1047 ACPI_OP_WALK_INFO *Info); 1048 1049 void 1050 AcpiDmCloseOperator ( 1051 ACPI_PARSE_OBJECT *Op); 1052 1053 1054 /* 1055 * dmtables 1056 */ 1057 void 1058 AdDisassemblerHeader ( 1059 char *Filename, 1060 UINT8 TableType); 1061 1062 #define ACPI_IS_AML_TABLE 0 1063 #define ACPI_IS_DATA_TABLE 1 1064 1065 1066 /* 1067 * adisasm 1068 */ 1069 ACPI_STATUS 1070 AdAmlDisassemble ( 1071 BOOLEAN OutToFile, 1072 char *Filename, 1073 char *Prefix, 1074 char **OutFilename); 1075 1076 ACPI_STATUS 1077 AdGetLocalTables ( 1078 void); 1079 1080 ACPI_STATUS 1081 AdParseTable ( 1082 ACPI_TABLE_HEADER *Table, 1083 ACPI_OWNER_ID *OwnerId, 1084 BOOLEAN LoadTable, 1085 BOOLEAN External); 1086 1087 ACPI_STATUS 1088 AdDisplayTables ( 1089 char *Filename, 1090 ACPI_TABLE_HEADER *Table); 1091 1092 ACPI_STATUS 1093 AdDisplayStatistics ( 1094 void); 1095 1096 #endif /* __ACDISASM_H__ */ 1097