1 /****************************************************************************** 2 * 3 * Module Name: dmtable - Support for ACPI tables that contain no AML code 4 * $Revision: 1.12 $ 5 * 6 *****************************************************************************/ 7 8 /****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117 #include <contrib/dev/acpica/acpi.h> 118 #include <contrib/dev/acpica/acdisasm.h> 119 #include <contrib/dev/acpica/actables.h> 120 121 /* This module used for application-level code only */ 122 123 #define _COMPONENT ACPI_CA_DISASSEMBLER 124 ACPI_MODULE_NAME ("dmtable") 125 126 /* Local Prototypes */ 127 128 static ACPI_DMTABLE_DATA * 129 AcpiDmGetTableData ( 130 char *Signature); 131 132 static void 133 AcpiDmCheckAscii ( 134 UINT8 *Target, 135 UINT32 Count); 136 137 138 /* These tables map a subtable type to a description string */ 139 140 static const char *AcpiDmDmarSubnames[] = 141 { 142 "Hardware Unit Definition", 143 "Reserved Memory Region", 144 "Unknown SubTable Type" /* Reserved */ 145 }; 146 147 static const char *AcpiDmMadtSubnames[] = 148 { 149 "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */ 150 "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */ 151 "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */ 152 "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */ 153 "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */ 154 "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */ 155 "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */ 156 "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */ 157 "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */ 158 "Unknown SubTable Type" /* Reserved */ 159 }; 160 161 static const char *AcpiDmSratSubnames[] = 162 { 163 "Processor Local APIC/SAPIC Affinity", 164 "Memory Affinity", 165 "Unknown SubTable Type" /* Reserved */ 166 }; 167 168 169 /******************************************************************************* 170 * 171 * ACPI Table Data, indexed by signature. 172 * 173 * Simple tables have only a TableInfo structure, complex tables have a handler. 174 * This table must be NULL terminated. RSDP and FACS are special-cased 175 * elsewhere. 176 * 177 ******************************************************************************/ 178 179 static ACPI_DMTABLE_DATA AcpiDmTableData[] = 180 { 181 {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, "Alert Standard Format table"}, 182 {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, "Simple Boot Flag Table"}, 183 {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, "Corrected Platform Error Polling table"}, 184 {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, "Debug Port table"}, 185 {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, "DMA Remapping table"}, 186 {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, "Embedded Controller Boot Resources Table"}, 187 {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"}, 188 {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"}, 189 {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, 190 {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, 191 {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, 192 {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, 193 {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, "System Locality Information Table"}, 194 {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, "Serial Port Console Redirection table"}, 195 {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"}, 196 {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"}, 197 {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"}, 198 {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"}, 199 {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"}, 200 {NULL, NULL, NULL, NULL} 201 }; 202 203 204 /******************************************************************************* 205 * 206 * FUNCTION: AcpiTbGenerateChecksum 207 * 208 * PARAMETERS: Table - Pointer to a valid ACPI table (with a 209 * standard ACPI header) 210 * 211 * RETURN: 8 bit checksum of buffer 212 * 213 * DESCRIPTION: Computes an 8 bit checksum of the table. 214 * 215 ******************************************************************************/ 216 217 UINT8 218 AcpiTbGenerateChecksum ( 219 ACPI_TABLE_HEADER *Table) 220 { 221 UINT8 Checksum; 222 223 224 /* Sum the entire table as-is */ 225 226 Checksum = AcpiTbChecksum ((UINT8 *) Table, Table->Length); 227 228 /* Subtract off the existing checksum value in the table */ 229 230 Checksum = (UINT8) (Checksum - Table->Checksum); 231 232 /* Compute the final checksum */ 233 234 Checksum = (UINT8) (0 - Checksum); 235 return (Checksum); 236 } 237 238 239 /******************************************************************************* 240 * 241 * FUNCTION: AcpiDmGetTableData 242 * 243 * PARAMETERS: Signature - ACPI signature (4 chars) to match 244 * 245 * RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found. 246 * 247 * DESCRIPTION: Find a match in the global table of supported ACPI tables 248 * 249 ******************************************************************************/ 250 251 static ACPI_DMTABLE_DATA * 252 AcpiDmGetTableData ( 253 char *Signature) 254 { 255 ACPI_DMTABLE_DATA *TableData; 256 257 258 for (TableData = AcpiDmTableData; TableData->Signature; TableData++) 259 { 260 if (ACPI_COMPARE_NAME (Signature, TableData->Signature)) 261 { 262 return (TableData); 263 } 264 } 265 266 return (NULL); 267 } 268 269 270 /******************************************************************************* 271 * 272 * FUNCTION: AcpiDmDumpDataTable 273 * 274 * PARAMETERS: Table - An ACPI table 275 * 276 * RETURN: None. 277 * 278 * DESCRIPTION: Format the contents of an ACPI data table (any table other 279 * than an SSDT or DSDT that does not contain executable AML code) 280 * 281 ******************************************************************************/ 282 283 void 284 AcpiDmDumpDataTable ( 285 ACPI_TABLE_HEADER *Table) 286 { 287 ACPI_DMTABLE_DATA *TableData; 288 UINT32 Length; 289 290 291 /* Ignore tables that contain AML */ 292 293 if (AcpiUtIsAmlTable (Table)) 294 { 295 return; 296 } 297 298 /* 299 * Handle tables that don't use the common ACPI table header structure. 300 * Currently, these are the FACS and RSDP. 301 */ 302 if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) 303 { 304 Length = Table->Length; 305 AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); 306 } 307 else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_RSDP)) 308 { 309 Length = AcpiDmDumpRsdp (Table); 310 } 311 else 312 { 313 /* 314 * All other tables must use the common ACPI table header, dump it now 315 */ 316 Length = Table->Length; 317 AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader); 318 AcpiOsPrintf ("\n"); 319 320 /* Match signature and dispatch appropriately */ 321 322 TableData = AcpiDmGetTableData (Table->Signature); 323 if (!TableData) 324 { 325 if (!ACPI_STRNCMP (Table->Signature, "OEM", 3)) 326 { 327 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n", 328 Table->Signature); 329 } 330 else 331 { 332 AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n", 333 Table->Signature); 334 } 335 } 336 else if (TableData->TableHandler) 337 { 338 /* Complex table, has a handler */ 339 340 TableData->TableHandler (Table); 341 } 342 else if (TableData->TableInfo) 343 { 344 /* Simple table, just walk the info table */ 345 346 AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo); 347 } 348 } 349 350 /* Always dump the raw table data */ 351 352 AcpiOsPrintf ("\nRaw Table Data\n\n"); 353 AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); 354 } 355 356 357 /******************************************************************************* 358 * 359 * FUNCTION: AcpiDmLineHeader 360 * 361 * PARAMETERS: Offset - Current byte offset, from table start 362 * ByteLength - Length of the field in bytes, 0 for flags 363 * Name - Name of this field 364 * Value - Optional value, displayed on left of ':' 365 * 366 * RETURN: None 367 * 368 * DESCRIPTION: Utility routines for formatting output lines. Displays the 369 * current table offset in hex and decimal, the field length, 370 * and the field name. 371 * 372 ******************************************************************************/ 373 374 void 375 AcpiDmLineHeader ( 376 UINT32 Offset, 377 UINT32 ByteLength, 378 char *Name) 379 { 380 381 if (ByteLength) 382 { 383 AcpiOsPrintf ("[%3.3Xh %3.3d% 3d] %28s : ", 384 Offset, Offset, ByteLength, Name); 385 } 386 else 387 { 388 AcpiOsPrintf ("%42s : ", 389 Name); 390 } 391 } 392 393 void 394 AcpiDmLineHeader2 ( 395 UINT32 Offset, 396 UINT32 ByteLength, 397 char *Name, 398 UINT32 Value) 399 { 400 401 if (ByteLength) 402 { 403 AcpiOsPrintf ("[%3.3Xh %3.3d% 3d] %24s % 3d : ", 404 Offset, Offset, ByteLength, Name, Value); 405 } 406 else 407 { 408 AcpiOsPrintf ("[%3.3Xh %3.3d ] %24s % 3d : ", 409 Offset, Offset, Name, Value); 410 } 411 } 412 413 414 /******************************************************************************* 415 * 416 * FUNCTION: AcpiDmDumpTable 417 * 418 * PARAMETERS: TableLength - Length of the entire ACPI table 419 * TableOffset - Starting offset within the table for this 420 * sub-descriptor (0 if main table) 421 * Table - The ACPI table 422 * SubtableLength - Lenghth of this sub-descriptor 423 * Info - Info table for this ACPI table 424 * 425 * RETURN: None 426 * 427 * DESCRIPTION: Display ACPI table contents by walking the Info table. 428 * 429 ******************************************************************************/ 430 431 void 432 AcpiDmDumpTable ( 433 UINT32 TableLength, 434 UINT32 TableOffset, 435 void *Table, 436 UINT32 SubtableLength, 437 ACPI_DMTABLE_INFO *Info) 438 { 439 UINT8 *Target; 440 UINT32 CurrentOffset; 441 UINT32 ByteLength; 442 UINT8 Temp8; 443 UINT16 Temp16; 444 ACPI_DMTABLE_DATA *TableData; 445 446 447 if (!Info) 448 { 449 AcpiOsPrintf ("Display not implemented\n"); 450 return; 451 } 452 453 /* Walk entire Info table; Null name terminates */ 454 455 for (; Info->Name; Info++) 456 { 457 /* 458 * Target points to the field within the ACPI Table. CurrentOffset is 459 * the offset of the field from the start of the main table. 460 */ 461 Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset); 462 CurrentOffset = TableOffset + Info->Offset; 463 464 /* Check for beyond EOT or beyond subtable end */ 465 466 if ((CurrentOffset >= TableLength) || 467 (SubtableLength && (Info->Offset >= SubtableLength))) 468 { 469 return; 470 } 471 472 /* Generate the byte length for this field */ 473 474 switch (Info->Opcode) 475 { 476 case ACPI_DMT_UINT8: 477 case ACPI_DMT_CHKSUM: 478 case ACPI_DMT_SPACEID: 479 case ACPI_DMT_MADT: 480 case ACPI_DMT_SRAT: 481 ByteLength = 1; 482 break; 483 case ACPI_DMT_UINT16: 484 case ACPI_DMT_DMAR: 485 ByteLength = 2; 486 break; 487 case ACPI_DMT_UINT24: 488 ByteLength = 3; 489 break; 490 case ACPI_DMT_UINT32: 491 case ACPI_DMT_NAME4: 492 case ACPI_DMT_SIG: 493 ByteLength = 4; 494 break; 495 case ACPI_DMT_NAME6: 496 ByteLength = 6; 497 break; 498 case ACPI_DMT_UINT56: 499 ByteLength = 7; 500 break; 501 case ACPI_DMT_UINT64: 502 case ACPI_DMT_NAME8: 503 ByteLength = 8; 504 break; 505 case ACPI_DMT_STRING: 506 ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; 507 break; 508 case ACPI_DMT_GAS: 509 AcpiOsPrintf ("\n"); 510 ByteLength = sizeof (ACPI_GENERIC_ADDRESS); 511 break; 512 default: 513 ByteLength = 0; 514 break; 515 } 516 517 /* Start a new line and decode the opcode */ 518 519 AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name); 520 521 switch (Info->Opcode) 522 { 523 /* Single-bit Flag fields. Note: Opcode is the bit position */ 524 525 case ACPI_DMT_FLAG0: 526 case ACPI_DMT_FLAG1: 527 case ACPI_DMT_FLAG2: 528 case ACPI_DMT_FLAG3: 529 case ACPI_DMT_FLAG4: 530 case ACPI_DMT_FLAG5: 531 case ACPI_DMT_FLAG6: 532 case ACPI_DMT_FLAG7: 533 534 AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01); 535 break; 536 537 /* 2-bit Flag fields */ 538 539 case ACPI_DMT_FLAGS0: 540 541 AcpiOsPrintf ("%1.1X\n", *Target & 0x03); 542 break; 543 544 case ACPI_DMT_FLAGS2: 545 546 AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03); 547 break; 548 549 /* Standard Data Types */ 550 551 case ACPI_DMT_UINT8: 552 553 AcpiOsPrintf ("%2.2X\n", *Target); 554 break; 555 556 case ACPI_DMT_UINT16: 557 558 AcpiOsPrintf ("%4.4X\n", ACPI_GET16 (Target)); 559 break; 560 561 case ACPI_DMT_UINT24: 562 563 AcpiOsPrintf ("%2.2X%2.2X%2.2X\n", 564 *Target, *(Target + 1), *(Target + 2)); 565 break; 566 567 case ACPI_DMT_UINT32: 568 569 AcpiOsPrintf ("%8.8X\n", ACPI_GET32 (Target)); 570 break; 571 572 case ACPI_DMT_UINT56: 573 574 AcpiOsPrintf ("%6.6X%8.8X\n", 575 ACPI_HIDWORD (ACPI_GET64 (Target)) & 0x00FFFFFF, 576 ACPI_LODWORD (ACPI_GET64 (Target))); 577 break; 578 579 case ACPI_DMT_UINT64: 580 581 AcpiOsPrintf ("%8.8X%8.8X\n", 582 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target))); 583 break; 584 585 case ACPI_DMT_STRING: 586 587 AcpiOsPrintf ("%s\n", ACPI_CAST_PTR (char, Target)); 588 break; 589 590 /* Fixed length ASCII name fields */ 591 592 case ACPI_DMT_SIG: 593 594 AcpiDmCheckAscii (Target, 4); 595 AcpiOsPrintf ("\"%4.4s\" ", Target); 596 TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target)); 597 if (TableData) 598 { 599 AcpiOsPrintf ("/* %s */", TableData->Name); 600 } 601 AcpiOsPrintf ("\n"); 602 break; 603 604 case ACPI_DMT_NAME4: 605 606 AcpiDmCheckAscii (Target, 4); 607 AcpiOsPrintf ("\"%4.4s\"\n", Target); 608 break; 609 610 case ACPI_DMT_NAME6: 611 612 AcpiDmCheckAscii (Target, 6); 613 AcpiOsPrintf ("\"%6.6s\"\n", Target); 614 break; 615 616 case ACPI_DMT_NAME8: 617 618 AcpiDmCheckAscii (Target, 8); 619 AcpiOsPrintf ("\"%8.8s\"\n", Target); 620 break; 621 622 /* Special Data Types */ 623 624 case ACPI_DMT_CHKSUM: 625 626 /* Checksum, display and validate */ 627 628 AcpiOsPrintf ("%2.2X", *Target); 629 Temp8 = AcpiTbGenerateChecksum (Table); 630 if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum) 631 { 632 AcpiOsPrintf ( 633 " /* Incorrect checksum, should be %2.2X */", Temp8); 634 } 635 AcpiOsPrintf ("\n"); 636 break; 637 638 case ACPI_DMT_SPACEID: 639 640 /* Address Space ID */ 641 642 AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiUtGetRegionName (*Target)); 643 break; 644 645 case ACPI_DMT_GAS: 646 647 /* Generic Address Structure */ 648 649 AcpiOsPrintf ("<Generic Address Structure>\n"); 650 AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, 651 CurrentOffset, Target, 0, AcpiDmTableInfoGas); 652 break; 653 654 case ACPI_DMT_DMAR: 655 656 /* DMAR subtable types */ 657 658 Temp16 = *Target; 659 if (Temp16 > ACPI_DMAR_TYPE_RESERVED) 660 { 661 Temp16 = ACPI_DMAR_TYPE_RESERVED; 662 } 663 664 AcpiOsPrintf ("%4.4X <%s>\n", *Target, AcpiDmDmarSubnames[Temp16]); 665 break; 666 667 case ACPI_DMT_MADT: 668 669 /* MADT subtable types */ 670 671 Temp8 = *Target; 672 if (Temp8 > ACPI_MADT_TYPE_RESERVED) 673 { 674 Temp8 = ACPI_MADT_TYPE_RESERVED; 675 } 676 677 AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]); 678 break; 679 680 case ACPI_DMT_SRAT: 681 682 /* SRAT subtable types */ 683 684 Temp8 = *Target; 685 if (Temp8 > ACPI_SRAT_TYPE_RESERVED) 686 { 687 Temp8 = ACPI_SRAT_TYPE_RESERVED; 688 } 689 690 AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmSratSubnames[Temp8]); 691 break; 692 693 case ACPI_DMT_EXIT: 694 return; 695 696 default: 697 ACPI_ERROR ((AE_INFO, 698 "**** Invalid table opcode [%X] ****\n", Info->Opcode)); 699 return; 700 } 701 } 702 } 703 704 705 /******************************************************************************* 706 * 707 * FUNCTION: AcpiDmCheckAscii 708 * 709 * PARAMETERS: Name - Ascii string 710 * Count - Number of characters to check 711 * 712 * RETURN: None 713 * 714 * DESCRIPTION: Ensure that the requested number of characters are printable 715 * Ascii characters. Sets non-printable and null chars to <space>. 716 * 717 ******************************************************************************/ 718 719 static void 720 AcpiDmCheckAscii ( 721 UINT8 *Name, 722 UINT32 Count) 723 { 724 UINT32 i; 725 726 727 for (i = 0; i < Count; i++) 728 { 729 if (!Name[i] || !isprint (Name[i])) 730 { 731 Name[i] = ' '; 732 } 733 } 734 } 735