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 Gbl_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 BOOLEAN 655 AcpiDmIsTempName ( 656 ACPI_PARSE_OBJECT *Op); 657 658 UINT32 659 AcpiDmListType ( 660 ACPI_PARSE_OBJECT *Op); 661 662 void 663 AcpiDmMethodFlags ( 664 ACPI_PARSE_OBJECT *Op); 665 666 void 667 AcpiDmDisplayTargetPathname ( 668 ACPI_PARSE_OBJECT *Op); 669 670 void 671 AcpiDmNotifyDescription ( 672 ACPI_PARSE_OBJECT *Op); 673 674 void 675 AcpiDmPredefinedDescription ( 676 ACPI_PARSE_OBJECT *Op); 677 678 void 679 AcpiDmFieldPredefinedDescription ( 680 ACPI_PARSE_OBJECT *Op); 681 682 void 683 AcpiDmFieldFlags ( 684 ACPI_PARSE_OBJECT *Op); 685 686 void 687 AcpiDmAddressSpace ( 688 UINT8 SpaceId); 689 690 void 691 AcpiDmRegionFlags ( 692 ACPI_PARSE_OBJECT *Op); 693 694 void 695 AcpiDmMatchOp ( 696 ACPI_PARSE_OBJECT *Op); 697 698 699 /* 700 * dmnames 701 */ 702 UINT32 703 AcpiDmDumpName ( 704 UINT32 Name); 705 706 ACPI_STATUS 707 AcpiPsDisplayObjectPathname ( 708 ACPI_WALK_STATE *WalkState, 709 ACPI_PARSE_OBJECT *Op); 710 711 void 712 AcpiDmNamestring ( 713 char *Name); 714 715 716 /* 717 * dmbuffer 718 */ 719 void 720 AcpiDmDisasmByteList ( 721 UINT32 Level, 722 UINT8 *ByteData, 723 UINT32 ByteCount); 724 725 void 726 AcpiDmByteList ( 727 ACPI_OP_WALK_INFO *Info, 728 ACPI_PARSE_OBJECT *Op); 729 730 void 731 AcpiDmCheckForHardwareId ( 732 ACPI_PARSE_OBJECT *Op); 733 734 void 735 AcpiDmDecompressEisaId ( 736 UINT32 EncodedId); 737 738 BOOLEAN 739 AcpiDmIsUuidBuffer ( 740 ACPI_PARSE_OBJECT *Op); 741 742 BOOLEAN 743 AcpiDmIsUnicodeBuffer ( 744 ACPI_PARSE_OBJECT *Op); 745 746 BOOLEAN 747 AcpiDmIsStringBuffer ( 748 ACPI_PARSE_OBJECT *Op); 749 750 BOOLEAN 751 AcpiDmIsPldBuffer ( 752 ACPI_PARSE_OBJECT *Op); 753 754 755 /* 756 * dmdeferred 757 */ 758 ACPI_STATUS 759 AcpiDmParseDeferredOps ( 760 ACPI_PARSE_OBJECT *Root); 761 762 763 /* 764 * dmextern 765 */ 766 ACPI_STATUS 767 AcpiDmAddToExternalFileList ( 768 char *PathList); 769 770 void 771 AcpiDmClearExternalFileList ( 772 void); 773 774 void 775 AcpiDmAddOpToExternalList ( 776 ACPI_PARSE_OBJECT *Op, 777 char *Path, 778 UINT8 Type, 779 UINT32 Value, 780 UINT16 Flags); 781 782 void 783 AcpiDmAddNodeToExternalList ( 784 ACPI_NAMESPACE_NODE *Node, 785 UINT8 Type, 786 UINT32 Value, 787 UINT16 Flags); 788 789 void 790 AcpiDmAddExternalsToNamespace ( 791 void); 792 793 UINT32 794 AcpiDmGetExternalMethodCount ( 795 void); 796 797 void 798 AcpiDmClearExternalList ( 799 void); 800 801 void 802 AcpiDmEmitExternals ( 803 void); 804 805 void 806 AcpiDmUnresolvedWarning ( 807 UINT8 Type); 808 809 void 810 AcpiDmGetExternalsFromFile ( 811 void); 812 813 /* 814 * dmresrc 815 */ 816 void 817 AcpiDmDumpInteger8 ( 818 UINT8 Value, 819 const char *Name); 820 821 void 822 AcpiDmDumpInteger16 ( 823 UINT16 Value, 824 const char *Name); 825 826 void 827 AcpiDmDumpInteger32 ( 828 UINT32 Value, 829 const char *Name); 830 831 void 832 AcpiDmDumpInteger64 ( 833 UINT64 Value, 834 const char *Name); 835 836 void 837 AcpiDmResourceTemplate ( 838 ACPI_OP_WALK_INFO *Info, 839 ACPI_PARSE_OBJECT *Op, 840 UINT8 *ByteData, 841 UINT32 ByteCount); 842 843 ACPI_STATUS 844 AcpiDmIsResourceTemplate ( 845 ACPI_WALK_STATE *WalkState, 846 ACPI_PARSE_OBJECT *Op); 847 848 void 849 AcpiDmBitList ( 850 UINT16 Mask); 851 852 void 853 AcpiDmDescriptorName ( 854 void); 855 856 857 /* 858 * dmresrcl 859 */ 860 void 861 AcpiDmWordDescriptor ( 862 ACPI_OP_WALK_INFO *Info, 863 AML_RESOURCE *Resource, 864 UINT32 Length, 865 UINT32 Level); 866 867 void 868 AcpiDmDwordDescriptor ( 869 ACPI_OP_WALK_INFO *Info, 870 AML_RESOURCE *Resource, 871 UINT32 Length, 872 UINT32 Level); 873 874 void 875 AcpiDmExtendedDescriptor ( 876 ACPI_OP_WALK_INFO *Info, 877 AML_RESOURCE *Resource, 878 UINT32 Length, 879 UINT32 Level); 880 881 void 882 AcpiDmQwordDescriptor ( 883 ACPI_OP_WALK_INFO *Info, 884 AML_RESOURCE *Resource, 885 UINT32 Length, 886 UINT32 Level); 887 888 void 889 AcpiDmMemory24Descriptor ( 890 ACPI_OP_WALK_INFO *Info, 891 AML_RESOURCE *Resource, 892 UINT32 Length, 893 UINT32 Level); 894 895 void 896 AcpiDmMemory32Descriptor ( 897 ACPI_OP_WALK_INFO *Info, 898 AML_RESOURCE *Resource, 899 UINT32 Length, 900 UINT32 Level); 901 902 void 903 AcpiDmFixedMemory32Descriptor ( 904 ACPI_OP_WALK_INFO *Info, 905 AML_RESOURCE *Resource, 906 UINT32 Length, 907 UINT32 Level); 908 909 void 910 AcpiDmGenericRegisterDescriptor ( 911 ACPI_OP_WALK_INFO *Info, 912 AML_RESOURCE *Resource, 913 UINT32 Length, 914 UINT32 Level); 915 916 void 917 AcpiDmInterruptDescriptor ( 918 ACPI_OP_WALK_INFO *Info, 919 AML_RESOURCE *Resource, 920 UINT32 Length, 921 UINT32 Level); 922 923 void 924 AcpiDmVendorLargeDescriptor ( 925 ACPI_OP_WALK_INFO *Info, 926 AML_RESOURCE *Resource, 927 UINT32 Length, 928 UINT32 Level); 929 930 void 931 AcpiDmGpioDescriptor ( 932 ACPI_OP_WALK_INFO *Info, 933 AML_RESOURCE *Resource, 934 UINT32 Length, 935 UINT32 Level); 936 937 void 938 AcpiDmSerialBusDescriptor ( 939 ACPI_OP_WALK_INFO *Info, 940 AML_RESOURCE *Resource, 941 UINT32 Length, 942 UINT32 Level); 943 944 void 945 AcpiDmVendorCommon ( 946 const char *Name, 947 UINT8 *ByteData, 948 UINT32 Length, 949 UINT32 Level); 950 951 952 /* 953 * dmresrcs 954 */ 955 void 956 AcpiDmIrqDescriptor ( 957 ACPI_OP_WALK_INFO *Info, 958 AML_RESOURCE *Resource, 959 UINT32 Length, 960 UINT32 Level); 961 962 void 963 AcpiDmDmaDescriptor ( 964 ACPI_OP_WALK_INFO *Info, 965 AML_RESOURCE *Resource, 966 UINT32 Length, 967 UINT32 Level); 968 969 void 970 AcpiDmFixedDmaDescriptor ( 971 ACPI_OP_WALK_INFO *Info, 972 AML_RESOURCE *Resource, 973 UINT32 Length, 974 UINT32 Level); 975 976 void 977 AcpiDmIoDescriptor ( 978 ACPI_OP_WALK_INFO *Info, 979 AML_RESOURCE *Resource, 980 UINT32 Length, 981 UINT32 Level); 982 983 void 984 AcpiDmFixedIoDescriptor ( 985 ACPI_OP_WALK_INFO *Info, 986 AML_RESOURCE *Resource, 987 UINT32 Length, 988 UINT32 Level); 989 990 void 991 AcpiDmStartDependentDescriptor ( 992 ACPI_OP_WALK_INFO *Info, 993 AML_RESOURCE *Resource, 994 UINT32 Length, 995 UINT32 Level); 996 997 void 998 AcpiDmEndDependentDescriptor ( 999 ACPI_OP_WALK_INFO *Info, 1000 AML_RESOURCE *Resource, 1001 UINT32 Length, 1002 UINT32 Level); 1003 1004 void 1005 AcpiDmVendorSmallDescriptor ( 1006 ACPI_OP_WALK_INFO *Info, 1007 AML_RESOURCE *Resource, 1008 UINT32 Length, 1009 UINT32 Level); 1010 1011 1012 /* 1013 * dmutils 1014 */ 1015 void 1016 AcpiDmDecodeAttribute ( 1017 UINT8 Attribute); 1018 1019 void 1020 AcpiDmIndent ( 1021 UINT32 Level); 1022 1023 BOOLEAN 1024 AcpiDmCommaIfListMember ( 1025 ACPI_PARSE_OBJECT *Op); 1026 1027 void 1028 AcpiDmCommaIfFieldMember ( 1029 ACPI_PARSE_OBJECT *Op); 1030 1031 1032 /* 1033 * dmrestag 1034 */ 1035 void 1036 AcpiDmFindResources ( 1037 ACPI_PARSE_OBJECT *Root); 1038 1039 void 1040 AcpiDmCheckResourceReference ( 1041 ACPI_PARSE_OBJECT *Op, 1042 ACPI_WALK_STATE *WalkState); 1043 1044 1045 /* 1046 * dmcstyle 1047 */ 1048 BOOLEAN 1049 AcpiDmCheckForSymbolicOpcode ( 1050 ACPI_PARSE_OBJECT *Op, 1051 ACPI_OP_WALK_INFO *Info); 1052 1053 void 1054 AcpiDmCloseOperator ( 1055 ACPI_PARSE_OBJECT *Op); 1056 1057 1058 /* 1059 * dmtables 1060 */ 1061 void 1062 AdDisassemblerHeader ( 1063 char *Filename, 1064 UINT8 TableType); 1065 1066 #define ACPI_IS_AML_TABLE 0 1067 #define ACPI_IS_DATA_TABLE 1 1068 1069 1070 /* 1071 * adisasm 1072 */ 1073 ACPI_STATUS 1074 AdAmlDisassemble ( 1075 BOOLEAN OutToFile, 1076 char *Filename, 1077 char *Prefix, 1078 char **OutFilename); 1079 1080 ACPI_STATUS 1081 AdGetLocalTables ( 1082 void); 1083 1084 ACPI_STATUS 1085 AdParseTable ( 1086 ACPI_TABLE_HEADER *Table, 1087 ACPI_OWNER_ID *OwnerId, 1088 BOOLEAN LoadTable, 1089 BOOLEAN External); 1090 1091 ACPI_STATUS 1092 AdDisplayTables ( 1093 char *Filename, 1094 ACPI_TABLE_HEADER *Table); 1095 1096 ACPI_STATUS 1097 AdDisplayStatistics ( 1098 void); 1099 1100 #endif /* __ACDISASM_H__ */ 1101