1 /****************************************************************************** 2 * 3 * Module Name: dmtbdump - Dump ACPI data tables that contain no AML code 4 * 5 *****************************************************************************/ 6 7 /****************************************************************************** 8 * 9 * 1. Copyright Notice 10 * 11 * Some or all of this work - Copyright (c) 1999 - 2017, 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 * Alternatively, you may choose to be licensed under the terms of the 117 * following license: 118 * 119 * Redistribution and use in source and binary forms, with or without 120 * modification, are permitted provided that the following conditions 121 * are met: 122 * 1. Redistributions of source code must retain the above copyright 123 * notice, this list of conditions, and the following disclaimer, 124 * without modification. 125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 126 * substantially similar to the "NO WARRANTY" disclaimer below 127 * ("Disclaimer") and any redistribution must be conditioned upon 128 * including a substantially similar Disclaimer requirement for further 129 * binary redistribution. 130 * 3. Neither the names of the above-listed copyright holders nor the names 131 * of any contributors may be used to endorse or promote products derived 132 * from this software without specific prior written permission. 133 * 134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 145 * 146 * Alternatively, you may choose to be licensed under the terms of the 147 * GNU General Public License ("GPL") version 2 as published by the Free 148 * Software Foundation. 149 * 150 *****************************************************************************/ 151 152 #include <contrib/dev/acpica/include/acpi.h> 153 #include <contrib/dev/acpica/include/accommon.h> 154 #include <contrib/dev/acpica/include/acdisasm.h> 155 #include <contrib/dev/acpica/include/actables.h> 156 157 /* This module used for application-level code only */ 158 159 #define _COMPONENT ACPI_CA_DISASSEMBLER 160 ACPI_MODULE_NAME ("dmtbdump") 161 162 163 /* Local prototypes */ 164 165 static void 166 AcpiDmValidateFadtLength ( 167 UINT32 Revision, 168 UINT32 Length); 169 170 171 /******************************************************************************* 172 * 173 * FUNCTION: AcpiDmDumpBuffer 174 * 175 * PARAMETERS: Table - ACPI Table or subtable 176 * BufferOffset - Offset of buffer from Table above 177 * Length - Length of the buffer 178 * AbsoluteOffset - Offset of buffer in the main ACPI table 179 * Header - Name of the buffer field (printed on the 180 * first line only.) 181 * 182 * RETURN: None 183 * 184 * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the 185 * disassembler output format.) 186 * 187 ******************************************************************************/ 188 189 void 190 AcpiDmDumpBuffer ( 191 void *Table, 192 UINT32 BufferOffset, 193 UINT32 Length, 194 UINT32 AbsoluteOffset, 195 char *Header) 196 { 197 UINT8 *Buffer; 198 UINT32 i; 199 200 201 if (!Length) 202 { 203 return; 204 } 205 206 Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset; 207 i = 0; 208 209 while (i < Length) 210 { 211 if (!(i % 16)) 212 { 213 /* Insert a backslash - line continuation character */ 214 215 if (Length > 16) 216 { 217 AcpiOsPrintf ("\\\n "); 218 } 219 } 220 221 AcpiOsPrintf ("%.02X ", *Buffer); 222 i++; 223 Buffer++; 224 AbsoluteOffset++; 225 } 226 227 AcpiOsPrintf ("\n"); 228 } 229 230 231 /******************************************************************************* 232 * 233 * FUNCTION: AcpiDmDumpUnicode 234 * 235 * PARAMETERS: Table - ACPI Table or subtable 236 * BufferOffset - Offset of buffer from Table above 237 * ByteLength - Length of the buffer 238 * 239 * RETURN: None 240 * 241 * DESCRIPTION: Validate and dump the contents of a buffer that contains 242 * unicode data. The output is a standard ASCII string. If it 243 * appears that the data is not unicode, the buffer is dumped 244 * as hex characters. 245 * 246 ******************************************************************************/ 247 248 void 249 AcpiDmDumpUnicode ( 250 void *Table, 251 UINT32 BufferOffset, 252 UINT32 ByteLength) 253 { 254 UINT8 *Buffer; 255 UINT32 Length; 256 UINT32 i; 257 258 259 Buffer = ((UINT8 *) Table) + BufferOffset; 260 Length = ByteLength - 2; /* Last two bytes are the null terminator */ 261 262 /* Ensure all low bytes are entirely printable ASCII */ 263 264 for (i = 0; i < Length; i += 2) 265 { 266 if (!isprint (Buffer[i])) 267 { 268 goto DumpRawBuffer; 269 } 270 } 271 272 /* Ensure all high bytes are zero */ 273 274 for (i = 1; i < Length; i += 2) 275 { 276 if (Buffer[i]) 277 { 278 goto DumpRawBuffer; 279 } 280 } 281 282 /* Dump the buffer as a normal string */ 283 284 AcpiOsPrintf ("\""); 285 for (i = 0; i < Length; i += 2) 286 { 287 AcpiOsPrintf ("%c", Buffer[i]); 288 } 289 290 AcpiOsPrintf ("\"\n"); 291 return; 292 293 DumpRawBuffer: 294 AcpiDmDumpBuffer (Table, BufferOffset, ByteLength, 295 BufferOffset, NULL); 296 AcpiOsPrintf ("\n"); 297 } 298 299 300 /******************************************************************************* 301 * 302 * FUNCTION: AcpiDmDumpRsdp 303 * 304 * PARAMETERS: Table - A RSDP 305 * 306 * RETURN: Length of the table (there is not always a length field, 307 * use revision or length if available (ACPI 2.0+)) 308 * 309 * DESCRIPTION: Format the contents of a RSDP 310 * 311 ******************************************************************************/ 312 313 UINT32 314 AcpiDmDumpRsdp ( 315 ACPI_TABLE_HEADER *Table) 316 { 317 ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); 318 UINT32 Length = sizeof (ACPI_RSDP_COMMON); 319 UINT8 Checksum; 320 ACPI_STATUS Status; 321 322 323 /* Dump the common ACPI 1.0 portion */ 324 325 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1); 326 if (ACPI_FAILURE (Status)) 327 { 328 return (Length); 329 } 330 331 /* Validate the first checksum */ 332 333 Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON), 334 Rsdp->Checksum); 335 if (Checksum != Rsdp->Checksum) 336 { 337 AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n", 338 Checksum); 339 } 340 341 /* The RSDP for ACPI 2.0+ contains more data and has a Length field */ 342 343 if (Rsdp->Revision > 0) 344 { 345 Length = Rsdp->Length; 346 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2); 347 if (ACPI_FAILURE (Status)) 348 { 349 return (Length); 350 } 351 352 /* Validate the extended checksum over entire RSDP */ 353 354 Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP), 355 Rsdp->ExtendedChecksum); 356 if (Checksum != Rsdp->ExtendedChecksum) 357 { 358 AcpiOsPrintf ( 359 "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n", 360 Checksum); 361 } 362 } 363 364 return (Length); 365 } 366 367 368 /******************************************************************************* 369 * 370 * FUNCTION: AcpiDmDumpRsdt 371 * 372 * PARAMETERS: Table - A RSDT 373 * 374 * RETURN: None 375 * 376 * DESCRIPTION: Format the contents of a RSDT 377 * 378 ******************************************************************************/ 379 380 void 381 AcpiDmDumpRsdt ( 382 ACPI_TABLE_HEADER *Table) 383 { 384 UINT32 *Array; 385 UINT32 Entries; 386 UINT32 Offset; 387 UINT32 i; 388 389 390 /* Point to start of table pointer array */ 391 392 Array = ACPI_CAST_PTR (ACPI_TABLE_RSDT, Table)->TableOffsetEntry; 393 Offset = sizeof (ACPI_TABLE_HEADER); 394 395 /* RSDT uses 32-bit pointers */ 396 397 Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32); 398 399 for (i = 0; i < Entries; i++) 400 { 401 AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i); 402 AcpiOsPrintf ("%8.8X\n", Array[i]); 403 Offset += sizeof (UINT32); 404 } 405 } 406 407 408 /******************************************************************************* 409 * 410 * FUNCTION: AcpiDmDumpXsdt 411 * 412 * PARAMETERS: Table - A XSDT 413 * 414 * RETURN: None 415 * 416 * DESCRIPTION: Format the contents of a XSDT 417 * 418 ******************************************************************************/ 419 420 void 421 AcpiDmDumpXsdt ( 422 ACPI_TABLE_HEADER *Table) 423 { 424 UINT64 *Array; 425 UINT32 Entries; 426 UINT32 Offset; 427 UINT32 i; 428 429 430 /* Point to start of table pointer array */ 431 432 Array = ACPI_CAST_PTR (ACPI_TABLE_XSDT, Table)->TableOffsetEntry; 433 Offset = sizeof (ACPI_TABLE_HEADER); 434 435 /* XSDT uses 64-bit pointers */ 436 437 Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64); 438 439 for (i = 0; i < Entries; i++) 440 { 441 AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i); 442 AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i])); 443 Offset += sizeof (UINT64); 444 } 445 } 446 447 448 /******************************************************************************* 449 * 450 * FUNCTION: AcpiDmDumpFadt 451 * 452 * PARAMETERS: Table - A FADT 453 * 454 * RETURN: None 455 * 456 * DESCRIPTION: Format the contents of a FADT 457 * 458 * NOTE: We cannot depend on the FADT version to indicate the actual 459 * contents of the FADT because of BIOS bugs. The table length 460 * is the only reliable indicator. 461 * 462 ******************************************************************************/ 463 464 void 465 AcpiDmDumpFadt ( 466 ACPI_TABLE_HEADER *Table) 467 { 468 ACPI_STATUS Status; 469 470 471 /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */ 472 473 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, 474 AcpiDmTableInfoFadt1); 475 if (ACPI_FAILURE (Status)) 476 { 477 return; 478 } 479 480 /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */ 481 482 if ((Table->Length > ACPI_FADT_V1_SIZE) && 483 (Table->Length <= ACPI_FADT_V2_SIZE)) 484 { 485 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, 486 AcpiDmTableInfoFadt2); 487 if (ACPI_FAILURE (Status)) 488 { 489 return; 490 } 491 } 492 493 /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ 494 495 else if (Table->Length > ACPI_FADT_V2_SIZE) 496 { 497 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, 498 AcpiDmTableInfoFadt3); 499 if (ACPI_FAILURE (Status)) 500 { 501 return; 502 } 503 504 /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ 505 506 if (Table->Length > ACPI_FADT_V3_SIZE) 507 { 508 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, 509 AcpiDmTableInfoFadt5); 510 if (ACPI_FAILURE (Status)) 511 { 512 return; 513 } 514 } 515 516 /* Check for FADT revision 6 fields and up (ACPI 6.0+) */ 517 518 if (Table->Length > ACPI_FADT_V3_SIZE) 519 { 520 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, 521 AcpiDmTableInfoFadt6); 522 if (ACPI_FAILURE (Status)) 523 { 524 return; 525 } 526 } 527 } 528 529 /* Validate various fields in the FADT, including length */ 530 531 AcpiTbCreateLocalFadt (Table, Table->Length); 532 533 /* Validate FADT length against the revision */ 534 535 AcpiDmValidateFadtLength (Table->Revision, Table->Length); 536 } 537 538 539 /******************************************************************************* 540 * 541 * FUNCTION: AcpiDmValidateFadtLength 542 * 543 * PARAMETERS: Revision - FADT revision (Header->Revision) 544 * Length - FADT length (Header->Length 545 * 546 * RETURN: None 547 * 548 * DESCRIPTION: Check the FADT revision against the expected table length for 549 * that revision. Issue a warning if the length is not what was 550 * expected. This seems to be such a common BIOS bug that the 551 * FADT revision has been rendered virtually meaningless. 552 * 553 ******************************************************************************/ 554 555 static void 556 AcpiDmValidateFadtLength ( 557 UINT32 Revision, 558 UINT32 Length) 559 { 560 UINT32 ExpectedLength; 561 562 563 switch (Revision) 564 { 565 case 0: 566 567 AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n"); 568 return; 569 570 case 1: 571 572 ExpectedLength = ACPI_FADT_V1_SIZE; 573 break; 574 575 case 2: 576 577 ExpectedLength = ACPI_FADT_V2_SIZE; 578 break; 579 580 case 3: 581 case 4: 582 583 ExpectedLength = ACPI_FADT_V3_SIZE; 584 break; 585 586 case 5: 587 588 ExpectedLength = ACPI_FADT_V5_SIZE; 589 break; 590 591 default: 592 593 return; 594 } 595 596 if (Length == ExpectedLength) 597 { 598 return; 599 } 600 601 AcpiOsPrintf ( 602 "\n// ACPI Warning: FADT revision %X does not match length: " 603 "found %X expected %X\n", 604 Revision, Length, ExpectedLength); 605 } 606 607 608 /******************************************************************************* 609 * 610 * FUNCTION: AcpiDmDumpAsf 611 * 612 * PARAMETERS: Table - A ASF table 613 * 614 * RETURN: None 615 * 616 * DESCRIPTION: Format the contents of a ASF table 617 * 618 ******************************************************************************/ 619 620 void 621 AcpiDmDumpAsf ( 622 ACPI_TABLE_HEADER *Table) 623 { 624 ACPI_STATUS Status; 625 UINT32 Offset = sizeof (ACPI_TABLE_HEADER); 626 ACPI_ASF_INFO *SubTable; 627 ACPI_DMTABLE_INFO *InfoTable; 628 ACPI_DMTABLE_INFO *DataInfoTable = NULL; 629 UINT8 *DataTable = NULL; 630 UINT32 DataCount = 0; 631 UINT32 DataLength = 0; 632 UINT32 DataOffset = 0; 633 UINT32 i; 634 UINT8 Type; 635 636 637 /* No main table, only subtables */ 638 639 SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); 640 while (Offset < Table->Length) 641 { 642 /* Common subtable header */ 643 644 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 645 SubTable->Header.Length, AcpiDmTableInfoAsfHdr); 646 if (ACPI_FAILURE (Status)) 647 { 648 return; 649 } 650 651 /* The actual type is the lower 7 bits of Type */ 652 653 Type = (UINT8) (SubTable->Header.Type & 0x7F); 654 655 switch (Type) 656 { 657 case ACPI_ASF_TYPE_INFO: 658 659 InfoTable = AcpiDmTableInfoAsf0; 660 break; 661 662 case ACPI_ASF_TYPE_ALERT: 663 664 InfoTable = AcpiDmTableInfoAsf1; 665 DataInfoTable = AcpiDmTableInfoAsf1a; 666 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); 667 DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; 668 DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; 669 DataOffset = Offset + sizeof (ACPI_ASF_ALERT); 670 break; 671 672 case ACPI_ASF_TYPE_CONTROL: 673 674 InfoTable = AcpiDmTableInfoAsf2; 675 DataInfoTable = AcpiDmTableInfoAsf2a; 676 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); 677 DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; 678 DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; 679 DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); 680 break; 681 682 case ACPI_ASF_TYPE_BOOT: 683 684 InfoTable = AcpiDmTableInfoAsf3; 685 break; 686 687 case ACPI_ASF_TYPE_ADDRESS: 688 689 InfoTable = AcpiDmTableInfoAsf4; 690 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); 691 DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; 692 DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); 693 break; 694 695 default: 696 697 AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", 698 SubTable->Header.Type); 699 return; 700 } 701 702 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 703 SubTable->Header.Length, InfoTable); 704 if (ACPI_FAILURE (Status)) 705 { 706 return; 707 } 708 709 /* Dump variable-length extra data */ 710 711 switch (Type) 712 { 713 case ACPI_ASF_TYPE_ALERT: 714 case ACPI_ASF_TYPE_CONTROL: 715 716 for (i = 0; i < DataCount; i++) 717 { 718 AcpiOsPrintf ("\n"); 719 Status = AcpiDmDumpTable (Table->Length, DataOffset, 720 DataTable, DataLength, DataInfoTable); 721 if (ACPI_FAILURE (Status)) 722 { 723 return; 724 } 725 726 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength); 727 DataOffset += DataLength; 728 } 729 break; 730 731 case ACPI_ASF_TYPE_ADDRESS: 732 733 for (i = 0; i < DataLength; i++) 734 { 735 if (!(i % 16)) 736 { 737 AcpiDmLineHeader (DataOffset, 1, "Addresses"); 738 } 739 740 AcpiOsPrintf ("%2.2X ", *DataTable); 741 DataTable++; 742 DataOffset++; 743 744 if (DataOffset > Table->Length) 745 { 746 AcpiOsPrintf ( 747 "**** ACPI table terminates in the middle of a " 748 "data structure! (ASF! table)\n"); 749 return; 750 } 751 } 752 753 AcpiOsPrintf ("\n"); 754 break; 755 756 default: 757 758 break; 759 } 760 761 AcpiOsPrintf ("\n"); 762 763 /* Point to next subtable */ 764 765 if (!SubTable->Header.Length) 766 { 767 AcpiOsPrintf ("Invalid zero subtable header length\n"); 768 return; 769 } 770 771 Offset += SubTable->Header.Length; 772 SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, 773 SubTable->Header.Length); 774 } 775 } 776 777 778 /******************************************************************************* 779 * 780 * FUNCTION: AcpiDmDumpCpep 781 * 782 * PARAMETERS: Table - A CPEP table 783 * 784 * RETURN: None 785 * 786 * DESCRIPTION: Format the contents of a CPEP. This table type consists 787 * of an open-ended number of subtables. 788 * 789 ******************************************************************************/ 790 791 void 792 AcpiDmDumpCpep ( 793 ACPI_TABLE_HEADER *Table) 794 { 795 ACPI_STATUS Status; 796 ACPI_CPEP_POLLING *SubTable; 797 UINT32 Length = Table->Length; 798 UINT32 Offset = sizeof (ACPI_TABLE_CPEP); 799 800 801 /* Main table */ 802 803 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep); 804 if (ACPI_FAILURE (Status)) 805 { 806 return; 807 } 808 809 /* Subtables */ 810 811 SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); 812 while (Offset < Table->Length) 813 { 814 AcpiOsPrintf ("\n"); 815 Status = AcpiDmDumpTable (Length, Offset, SubTable, 816 SubTable->Header.Length, AcpiDmTableInfoCpep0); 817 if (ACPI_FAILURE (Status)) 818 { 819 return; 820 } 821 822 /* Point to next subtable */ 823 824 Offset += SubTable->Header.Length; 825 SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, 826 SubTable->Header.Length); 827 } 828 } 829 830 831 /******************************************************************************* 832 * 833 * FUNCTION: AcpiDmDumpCsrt 834 * 835 * PARAMETERS: Table - A CSRT table 836 * 837 * RETURN: None 838 * 839 * DESCRIPTION: Format the contents of a CSRT. This table type consists 840 * of an open-ended number of subtables. 841 * 842 ******************************************************************************/ 843 844 void 845 AcpiDmDumpCsrt ( 846 ACPI_TABLE_HEADER *Table) 847 { 848 ACPI_STATUS Status; 849 ACPI_CSRT_GROUP *SubTable; 850 ACPI_CSRT_SHARED_INFO *SharedInfoTable; 851 ACPI_CSRT_DESCRIPTOR *SubSubTable; 852 UINT32 Length = Table->Length; 853 UINT32 Offset = sizeof (ACPI_TABLE_CSRT); 854 UINT32 SubOffset; 855 UINT32 SubSubOffset; 856 UINT32 InfoLength; 857 858 859 /* The main table only contains the ACPI header, thus already handled */ 860 861 /* Subtables (Resource Groups) */ 862 863 SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); 864 while (Offset < Table->Length) 865 { 866 /* Resource group subtable */ 867 868 AcpiOsPrintf ("\n"); 869 Status = AcpiDmDumpTable (Length, Offset, SubTable, 870 SubTable->Length, AcpiDmTableInfoCsrt0); 871 if (ACPI_FAILURE (Status)) 872 { 873 return; 874 } 875 876 /* Shared info subtable (One per resource group) */ 877 878 SubOffset = sizeof (ACPI_CSRT_GROUP); 879 SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table, 880 Offset + SubOffset); 881 882 AcpiOsPrintf ("\n"); 883 Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable, 884 sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1); 885 if (ACPI_FAILURE (Status)) 886 { 887 return; 888 } 889 890 SubOffset += SubTable->SharedInfoLength; 891 892 /* Sub-Subtables (Resource Descriptors) */ 893 894 SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, 895 Offset + SubOffset); 896 897 while ((SubOffset < SubTable->Length) && 898 ((Offset + SubOffset) < Table->Length)) 899 { 900 AcpiOsPrintf ("\n"); 901 Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable, 902 SubSubTable->Length, AcpiDmTableInfoCsrt2); 903 if (ACPI_FAILURE (Status)) 904 { 905 return; 906 } 907 908 SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR); 909 910 /* Resource-specific info buffer */ 911 912 InfoLength = SubSubTable->Length - SubSubOffset; 913 if (InfoLength) 914 { 915 Status = AcpiDmDumpTable (Length, 916 Offset + SubOffset + SubSubOffset, Table, 917 InfoLength, AcpiDmTableInfoCsrt2a); 918 if (ACPI_FAILURE (Status)) 919 { 920 return; 921 } 922 SubSubOffset += InfoLength; 923 } 924 925 /* Point to next sub-subtable */ 926 927 SubOffset += SubSubTable->Length; 928 SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable, 929 SubSubTable->Length); 930 } 931 932 /* Point to next subtable */ 933 934 Offset += SubTable->Length; 935 SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable, 936 SubTable->Length); 937 } 938 } 939 940 941 /******************************************************************************* 942 * 943 * FUNCTION: AcpiDmDumpDbg2 944 * 945 * PARAMETERS: Table - A DBG2 table 946 * 947 * RETURN: None 948 * 949 * DESCRIPTION: Format the contents of a DBG2. This table type consists 950 * of an open-ended number of subtables. 951 * 952 ******************************************************************************/ 953 954 void 955 AcpiDmDumpDbg2 ( 956 ACPI_TABLE_HEADER *Table) 957 { 958 ACPI_STATUS Status; 959 ACPI_DBG2_DEVICE *SubTable; 960 UINT32 Length = Table->Length; 961 UINT32 Offset = sizeof (ACPI_TABLE_DBG2); 962 UINT32 i; 963 UINT32 ArrayOffset; 964 UINT32 AbsoluteOffset; 965 UINT8 *Array; 966 967 968 /* Main table */ 969 970 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2); 971 if (ACPI_FAILURE (Status)) 972 { 973 return; 974 } 975 976 /* Subtables */ 977 978 SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); 979 while (Offset < Table->Length) 980 { 981 AcpiOsPrintf ("\n"); 982 Status = AcpiDmDumpTable (Length, Offset, SubTable, 983 SubTable->Length, AcpiDmTableInfoDbg2Device); 984 if (ACPI_FAILURE (Status)) 985 { 986 return; 987 } 988 989 /* Dump the BaseAddress array */ 990 991 for (i = 0; i < SubTable->RegisterCount; i++) 992 { 993 ArrayOffset = SubTable->BaseAddressOffset + 994 (sizeof (ACPI_GENERIC_ADDRESS) * i); 995 AbsoluteOffset = Offset + ArrayOffset; 996 Array = (UINT8 *) SubTable + ArrayOffset; 997 998 Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, 999 SubTable->Length, AcpiDmTableInfoDbg2Addr); 1000 if (ACPI_FAILURE (Status)) 1001 { 1002 return; 1003 } 1004 } 1005 1006 /* Dump the AddressSize array */ 1007 1008 for (i = 0; i < SubTable->RegisterCount; i++) 1009 { 1010 ArrayOffset = SubTable->AddressSizeOffset + 1011 (sizeof (UINT32) * i); 1012 AbsoluteOffset = Offset + ArrayOffset; 1013 Array = (UINT8 *) SubTable + ArrayOffset; 1014 1015 Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, 1016 SubTable->Length, AcpiDmTableInfoDbg2Size); 1017 if (ACPI_FAILURE (Status)) 1018 { 1019 return; 1020 } 1021 } 1022 1023 /* Dump the Namestring (required) */ 1024 1025 AcpiOsPrintf ("\n"); 1026 ArrayOffset = SubTable->NamepathOffset; 1027 AbsoluteOffset = Offset + ArrayOffset; 1028 Array = (UINT8 *) SubTable + ArrayOffset; 1029 1030 Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, 1031 SubTable->Length, AcpiDmTableInfoDbg2Name); 1032 if (ACPI_FAILURE (Status)) 1033 { 1034 return; 1035 } 1036 1037 /* Dump the OemData (optional) */ 1038 1039 if (SubTable->OemDataOffset) 1040 { 1041 Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset, 1042 Table, SubTable->OemDataLength, 1043 AcpiDmTableInfoDbg2OemData); 1044 if (ACPI_FAILURE (Status)) 1045 { 1046 return; 1047 } 1048 } 1049 1050 /* Point to next subtable */ 1051 1052 Offset += SubTable->Length; 1053 SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable, 1054 SubTable->Length); 1055 } 1056 } 1057 1058 1059 /******************************************************************************* 1060 * 1061 * FUNCTION: AcpiDmDumpDmar 1062 * 1063 * PARAMETERS: Table - A DMAR table 1064 * 1065 * RETURN: None 1066 * 1067 * DESCRIPTION: Format the contents of a DMAR. This table type consists 1068 * of an open-ended number of subtables. 1069 * 1070 ******************************************************************************/ 1071 1072 void 1073 AcpiDmDumpDmar ( 1074 ACPI_TABLE_HEADER *Table) 1075 { 1076 ACPI_STATUS Status; 1077 ACPI_DMAR_HEADER *SubTable; 1078 UINT32 Length = Table->Length; 1079 UINT32 Offset = sizeof (ACPI_TABLE_DMAR); 1080 ACPI_DMTABLE_INFO *InfoTable; 1081 ACPI_DMAR_DEVICE_SCOPE *ScopeTable; 1082 UINT32 ScopeOffset; 1083 UINT8 *PciPath; 1084 UINT32 PathOffset; 1085 1086 1087 /* Main table */ 1088 1089 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar); 1090 if (ACPI_FAILURE (Status)) 1091 { 1092 return; 1093 } 1094 1095 /* Subtables */ 1096 1097 SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); 1098 while (Offset < Table->Length) 1099 { 1100 /* Common subtable header */ 1101 1102 AcpiOsPrintf ("\n"); 1103 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1104 SubTable->Length, AcpiDmTableInfoDmarHdr); 1105 if (ACPI_FAILURE (Status)) 1106 { 1107 return; 1108 } 1109 1110 AcpiOsPrintf ("\n"); 1111 1112 switch (SubTable->Type) 1113 { 1114 case ACPI_DMAR_TYPE_HARDWARE_UNIT: 1115 1116 InfoTable = AcpiDmTableInfoDmar0; 1117 ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT); 1118 break; 1119 1120 case ACPI_DMAR_TYPE_RESERVED_MEMORY: 1121 1122 InfoTable = AcpiDmTableInfoDmar1; 1123 ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); 1124 break; 1125 1126 case ACPI_DMAR_TYPE_ROOT_ATS: 1127 1128 InfoTable = AcpiDmTableInfoDmar2; 1129 ScopeOffset = sizeof (ACPI_DMAR_ATSR); 1130 break; 1131 1132 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: 1133 1134 InfoTable = AcpiDmTableInfoDmar3; 1135 ScopeOffset = sizeof (ACPI_DMAR_RHSA); 1136 break; 1137 1138 case ACPI_DMAR_TYPE_NAMESPACE: 1139 1140 InfoTable = AcpiDmTableInfoDmar4; 1141 ScopeOffset = sizeof (ACPI_DMAR_ANDD); 1142 break; 1143 1144 default: 1145 1146 AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", 1147 SubTable->Type); 1148 return; 1149 } 1150 1151 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1152 SubTable->Length, InfoTable); 1153 if (ACPI_FAILURE (Status)) 1154 { 1155 return; 1156 } 1157 1158 /* 1159 * Dump the optional device scope entries 1160 */ 1161 if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || 1162 (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE)) 1163 { 1164 /* These types do not support device scopes */ 1165 1166 goto NextSubtable; 1167 } 1168 1169 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); 1170 while (ScopeOffset < SubTable->Length) 1171 { 1172 AcpiOsPrintf ("\n"); 1173 Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, 1174 ScopeTable->Length, AcpiDmTableInfoDmarScope); 1175 if (ACPI_FAILURE (Status)) 1176 { 1177 return; 1178 } 1179 AcpiOsPrintf ("\n"); 1180 1181 /* Dump the PCI Path entries for this device scope */ 1182 1183 PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ 1184 1185 PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, 1186 sizeof (ACPI_DMAR_DEVICE_SCOPE)); 1187 1188 while (PathOffset < ScopeTable->Length) 1189 { 1190 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, 1191 "PCI Path"); 1192 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); 1193 1194 /* Point to next PCI Path entry */ 1195 1196 PathOffset += 2; 1197 PciPath += 2; 1198 AcpiOsPrintf ("\n"); 1199 } 1200 1201 /* Point to next device scope entry */ 1202 1203 ScopeOffset += ScopeTable->Length; 1204 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, 1205 ScopeTable, ScopeTable->Length); 1206 } 1207 1208 NextSubtable: 1209 /* Point to next subtable */ 1210 1211 Offset += SubTable->Length; 1212 SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, 1213 SubTable->Length); 1214 } 1215 } 1216 1217 1218 /******************************************************************************* 1219 * 1220 * FUNCTION: AcpiDmDumpDrtm 1221 * 1222 * PARAMETERS: Table - A DRTM table 1223 * 1224 * RETURN: None 1225 * 1226 * DESCRIPTION: Format the contents of a DRTM. 1227 * 1228 ******************************************************************************/ 1229 1230 void 1231 AcpiDmDumpDrtm ( 1232 ACPI_TABLE_HEADER *Table) 1233 { 1234 ACPI_STATUS Status; 1235 UINT32 Offset; 1236 ACPI_DRTM_VTABLE_LIST *DrtmVtl; 1237 ACPI_DRTM_RESOURCE_LIST *DrtmRl; 1238 ACPI_DRTM_DPS_ID *DrtmDps; 1239 UINT32 Count; 1240 1241 1242 /* Main table */ 1243 1244 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, 1245 AcpiDmTableInfoDrtm); 1246 if (ACPI_FAILURE (Status)) 1247 { 1248 return; 1249 } 1250 1251 Offset = sizeof (ACPI_TABLE_DRTM); 1252 1253 /* Sub-tables */ 1254 1255 /* Dump ValidatedTable length */ 1256 1257 DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset); 1258 AcpiOsPrintf ("\n"); 1259 Status = AcpiDmDumpTable (Table->Length, Offset, 1260 DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables), 1261 AcpiDmTableInfoDrtm0); 1262 if (ACPI_FAILURE (Status)) 1263 { 1264 return; 1265 } 1266 1267 Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables); 1268 1269 /* Dump Validated table addresses */ 1270 1271 Count = 0; 1272 while ((Offset < Table->Length) && 1273 (DrtmVtl->ValidatedTableCount > Count)) 1274 { 1275 Status = AcpiDmDumpTable (Table->Length, Offset, 1276 ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64), 1277 AcpiDmTableInfoDrtm0a); 1278 if (ACPI_FAILURE (Status)) 1279 { 1280 return; 1281 } 1282 1283 Offset += sizeof (UINT64); 1284 Count++; 1285 } 1286 1287 /* Dump ResourceList length */ 1288 1289 DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset); 1290 AcpiOsPrintf ("\n"); 1291 Status = AcpiDmDumpTable (Table->Length, Offset, 1292 DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources), 1293 AcpiDmTableInfoDrtm1); 1294 if (ACPI_FAILURE (Status)) 1295 { 1296 return; 1297 } 1298 1299 Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources); 1300 1301 /* Dump the Resource List */ 1302 1303 Count = 0; 1304 while ((Offset < Table->Length) && 1305 (DrtmRl->ResourceCount > Count)) 1306 { 1307 Status = AcpiDmDumpTable (Table->Length, Offset, 1308 ACPI_ADD_PTR (void, Table, Offset), 1309 sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a); 1310 if (ACPI_FAILURE (Status)) 1311 { 1312 return; 1313 } 1314 1315 Offset += sizeof (ACPI_DRTM_RESOURCE); 1316 Count++; 1317 } 1318 1319 /* Dump DPS */ 1320 1321 DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset); 1322 AcpiOsPrintf ("\n"); 1323 (void) AcpiDmDumpTable (Table->Length, Offset, 1324 DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2); 1325 } 1326 1327 1328 /******************************************************************************* 1329 * 1330 * FUNCTION: AcpiDmDumpEinj 1331 * 1332 * PARAMETERS: Table - A EINJ table 1333 * 1334 * RETURN: None 1335 * 1336 * DESCRIPTION: Format the contents of a EINJ. This table type consists 1337 * of an open-ended number of subtables. 1338 * 1339 ******************************************************************************/ 1340 1341 void 1342 AcpiDmDumpEinj ( 1343 ACPI_TABLE_HEADER *Table) 1344 { 1345 ACPI_STATUS Status; 1346 ACPI_WHEA_HEADER *SubTable; 1347 UINT32 Length = Table->Length; 1348 UINT32 Offset = sizeof (ACPI_TABLE_EINJ); 1349 1350 1351 /* Main table */ 1352 1353 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj); 1354 if (ACPI_FAILURE (Status)) 1355 { 1356 return; 1357 } 1358 1359 /* Subtables */ 1360 1361 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); 1362 while (Offset < Table->Length) 1363 { 1364 AcpiOsPrintf ("\n"); 1365 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1366 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); 1367 if (ACPI_FAILURE (Status)) 1368 { 1369 return; 1370 } 1371 1372 /* Point to next subtable (each subtable is of fixed length) */ 1373 1374 Offset += sizeof (ACPI_WHEA_HEADER); 1375 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, 1376 sizeof (ACPI_WHEA_HEADER)); 1377 } 1378 } 1379 1380 1381 /******************************************************************************* 1382 * 1383 * FUNCTION: AcpiDmDumpErst 1384 * 1385 * PARAMETERS: Table - A ERST table 1386 * 1387 * RETURN: None 1388 * 1389 * DESCRIPTION: Format the contents of a ERST. This table type consists 1390 * of an open-ended number of subtables. 1391 * 1392 ******************************************************************************/ 1393 1394 void 1395 AcpiDmDumpErst ( 1396 ACPI_TABLE_HEADER *Table) 1397 { 1398 ACPI_STATUS Status; 1399 ACPI_WHEA_HEADER *SubTable; 1400 UINT32 Length = Table->Length; 1401 UINT32 Offset = sizeof (ACPI_TABLE_ERST); 1402 1403 1404 /* Main table */ 1405 1406 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst); 1407 if (ACPI_FAILURE (Status)) 1408 { 1409 return; 1410 } 1411 1412 /* Subtables */ 1413 1414 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); 1415 while (Offset < Table->Length) 1416 { 1417 AcpiOsPrintf ("\n"); 1418 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1419 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); 1420 if (ACPI_FAILURE (Status)) 1421 { 1422 return; 1423 } 1424 1425 /* Point to next subtable (each subtable is of fixed length) */ 1426 1427 Offset += sizeof (ACPI_WHEA_HEADER); 1428 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, 1429 sizeof (ACPI_WHEA_HEADER)); 1430 } 1431 } 1432 1433 1434 /******************************************************************************* 1435 * 1436 * FUNCTION: AcpiDmDumpFpdt 1437 * 1438 * PARAMETERS: Table - A FPDT table 1439 * 1440 * RETURN: None 1441 * 1442 * DESCRIPTION: Format the contents of a FPDT. This table type consists 1443 * of an open-ended number of subtables. 1444 * 1445 ******************************************************************************/ 1446 1447 void 1448 AcpiDmDumpFpdt ( 1449 ACPI_TABLE_HEADER *Table) 1450 { 1451 ACPI_STATUS Status; 1452 ACPI_FPDT_HEADER *SubTable; 1453 UINT32 Length = Table->Length; 1454 UINT32 Offset = sizeof (ACPI_TABLE_FPDT); 1455 ACPI_DMTABLE_INFO *InfoTable; 1456 1457 1458 /* There is no main table (other than the standard ACPI header) */ 1459 1460 /* Subtables */ 1461 1462 SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); 1463 while (Offset < Table->Length) 1464 { 1465 /* Common subtable header */ 1466 1467 AcpiOsPrintf ("\n"); 1468 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1469 SubTable->Length, AcpiDmTableInfoFpdtHdr); 1470 if (ACPI_FAILURE (Status)) 1471 { 1472 return; 1473 } 1474 1475 switch (SubTable->Type) 1476 { 1477 case ACPI_FPDT_TYPE_BOOT: 1478 1479 InfoTable = AcpiDmTableInfoFpdt0; 1480 break; 1481 1482 case ACPI_FPDT_TYPE_S3PERF: 1483 1484 InfoTable = AcpiDmTableInfoFpdt1; 1485 break; 1486 1487 default: 1488 1489 AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", 1490 SubTable->Type); 1491 1492 /* Attempt to continue */ 1493 1494 if (!SubTable->Length) 1495 { 1496 AcpiOsPrintf ("Invalid zero length subtable\n"); 1497 return; 1498 } 1499 goto NextSubTable; 1500 } 1501 1502 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1503 SubTable->Length, InfoTable); 1504 if (ACPI_FAILURE (Status)) 1505 { 1506 return; 1507 } 1508 1509 NextSubTable: 1510 /* Point to next subtable */ 1511 1512 Offset += SubTable->Length; 1513 SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, 1514 SubTable->Length); 1515 } 1516 } 1517 1518 1519 /******************************************************************************* 1520 * 1521 * FUNCTION: AcpiDmDumpGtdt 1522 * 1523 * PARAMETERS: Table - A GTDT table 1524 * 1525 * RETURN: None 1526 * 1527 * DESCRIPTION: Format the contents of a GTDT. This table type consists 1528 * of an open-ended number of subtables. 1529 * 1530 ******************************************************************************/ 1531 1532 void 1533 AcpiDmDumpGtdt ( 1534 ACPI_TABLE_HEADER *Table) 1535 { 1536 ACPI_STATUS Status; 1537 ACPI_GTDT_HEADER *SubTable; 1538 UINT32 Length = Table->Length; 1539 UINT32 Offset = sizeof (ACPI_TABLE_GTDT); 1540 ACPI_DMTABLE_INFO *InfoTable; 1541 UINT32 SubTableLength; 1542 UINT32 GtCount; 1543 ACPI_GTDT_TIMER_ENTRY *GtxTable; 1544 1545 1546 /* Main table */ 1547 1548 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt); 1549 if (ACPI_FAILURE (Status)) 1550 { 1551 return; 1552 } 1553 1554 /* Subtables */ 1555 1556 SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); 1557 while (Offset < Table->Length) 1558 { 1559 /* Common subtable header */ 1560 1561 AcpiOsPrintf ("\n"); 1562 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1563 SubTable->Length, AcpiDmTableInfoGtdtHdr); 1564 if (ACPI_FAILURE (Status)) 1565 { 1566 return; 1567 } 1568 1569 GtCount = 0; 1570 switch (SubTable->Type) 1571 { 1572 case ACPI_GTDT_TYPE_TIMER_BLOCK: 1573 1574 SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); 1575 GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, 1576 SubTable))->TimerCount; 1577 1578 InfoTable = AcpiDmTableInfoGtdt0; 1579 break; 1580 1581 case ACPI_GTDT_TYPE_WATCHDOG: 1582 1583 SubTableLength = sizeof (ACPI_GTDT_WATCHDOG); 1584 1585 InfoTable = AcpiDmTableInfoGtdt1; 1586 break; 1587 1588 default: 1589 1590 /* Cannot continue on unknown type - no length */ 1591 1592 AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", 1593 SubTable->Type); 1594 return; 1595 } 1596 1597 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1598 SubTable->Length, InfoTable); 1599 if (ACPI_FAILURE (Status)) 1600 { 1601 return; 1602 } 1603 1604 /* Point to end of current subtable (each subtable above is of fixed length) */ 1605 1606 Offset += SubTableLength; 1607 1608 /* If there are any Gt Timer Blocks from above, dump them now */ 1609 1610 if (GtCount) 1611 { 1612 GtxTable = ACPI_ADD_PTR ( 1613 ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength); 1614 SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); 1615 1616 while (GtCount) 1617 { 1618 AcpiOsPrintf ("\n"); 1619 Status = AcpiDmDumpTable (Length, Offset, GtxTable, 1620 sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a); 1621 if (ACPI_FAILURE (Status)) 1622 { 1623 return; 1624 } 1625 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY); 1626 GtxTable++; 1627 GtCount--; 1628 } 1629 } 1630 1631 /* Point to next subtable */ 1632 1633 SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength); 1634 } 1635 } 1636 1637 1638 /******************************************************************************* 1639 * 1640 * FUNCTION: AcpiDmDumpHest 1641 * 1642 * PARAMETERS: Table - A HEST table 1643 * 1644 * RETURN: None 1645 * 1646 * DESCRIPTION: Format the contents of a HEST. This table type consists 1647 * of an open-ended number of subtables. 1648 * 1649 ******************************************************************************/ 1650 1651 void 1652 AcpiDmDumpHest ( 1653 ACPI_TABLE_HEADER *Table) 1654 { 1655 ACPI_STATUS Status; 1656 ACPI_HEST_HEADER *SubTable; 1657 UINT32 Length = Table->Length; 1658 UINT32 Offset = sizeof (ACPI_TABLE_HEST); 1659 ACPI_DMTABLE_INFO *InfoTable; 1660 UINT32 SubTableLength; 1661 UINT32 BankCount; 1662 ACPI_HEST_IA_ERROR_BANK *BankTable; 1663 1664 1665 /* Main table */ 1666 1667 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest); 1668 if (ACPI_FAILURE (Status)) 1669 { 1670 return; 1671 } 1672 1673 /* Subtables */ 1674 1675 SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); 1676 while (Offset < Table->Length) 1677 { 1678 BankCount = 0; 1679 switch (SubTable->Type) 1680 { 1681 case ACPI_HEST_TYPE_IA32_CHECK: 1682 1683 InfoTable = AcpiDmTableInfoHest0; 1684 SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK); 1685 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, 1686 SubTable))->NumHardwareBanks; 1687 break; 1688 1689 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: 1690 1691 InfoTable = AcpiDmTableInfoHest1; 1692 SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED); 1693 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, 1694 SubTable))->NumHardwareBanks; 1695 break; 1696 1697 case ACPI_HEST_TYPE_IA32_NMI: 1698 1699 InfoTable = AcpiDmTableInfoHest2; 1700 SubTableLength = sizeof (ACPI_HEST_IA_NMI); 1701 break; 1702 1703 case ACPI_HEST_TYPE_AER_ROOT_PORT: 1704 1705 InfoTable = AcpiDmTableInfoHest6; 1706 SubTableLength = sizeof (ACPI_HEST_AER_ROOT); 1707 break; 1708 1709 case ACPI_HEST_TYPE_AER_ENDPOINT: 1710 1711 InfoTable = AcpiDmTableInfoHest7; 1712 SubTableLength = sizeof (ACPI_HEST_AER); 1713 break; 1714 1715 case ACPI_HEST_TYPE_AER_BRIDGE: 1716 1717 InfoTable = AcpiDmTableInfoHest8; 1718 SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE); 1719 break; 1720 1721 case ACPI_HEST_TYPE_GENERIC_ERROR: 1722 1723 InfoTable = AcpiDmTableInfoHest9; 1724 SubTableLength = sizeof (ACPI_HEST_GENERIC); 1725 break; 1726 1727 case ACPI_HEST_TYPE_GENERIC_ERROR_V2: 1728 1729 InfoTable = AcpiDmTableInfoHest10; 1730 SubTableLength = sizeof (ACPI_HEST_GENERIC_V2); 1731 break; 1732 1733 default: 1734 1735 /* Cannot continue on unknown type - no length */ 1736 1737 AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", 1738 SubTable->Type); 1739 return; 1740 } 1741 1742 AcpiOsPrintf ("\n"); 1743 Status = AcpiDmDumpTable (Length, Offset, SubTable, 1744 SubTableLength, InfoTable); 1745 if (ACPI_FAILURE (Status)) 1746 { 1747 return; 1748 } 1749 1750 /* Point to end of current subtable (each subtable above is of fixed length) */ 1751 1752 Offset += SubTableLength; 1753 1754 /* If there are any (fixed-length) Error Banks from above, dump them now */ 1755 1756 if (BankCount) 1757 { 1758 BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, 1759 SubTableLength); 1760 SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK); 1761 1762 while (BankCount) 1763 { 1764 AcpiOsPrintf ("\n"); 1765 Status = AcpiDmDumpTable (Length, Offset, BankTable, 1766 sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank); 1767 if (ACPI_FAILURE (Status)) 1768 { 1769 return; 1770 } 1771 1772 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK); 1773 BankTable++; 1774 BankCount--; 1775 } 1776 } 1777 1778 /* Point to next subtable */ 1779 1780 SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength); 1781 } 1782 } 1783 1784 1785 /******************************************************************************* 1786 * 1787 * FUNCTION: AcpiDmDumpIort 1788 * 1789 * PARAMETERS: Table - A IORT table 1790 * 1791 * RETURN: None 1792 * 1793 * DESCRIPTION: Format the contents of a IORT 1794 * 1795 ******************************************************************************/ 1796 1797 void 1798 AcpiDmDumpIort ( 1799 ACPI_TABLE_HEADER *Table) 1800 { 1801 ACPI_STATUS Status; 1802 ACPI_TABLE_IORT *Iort; 1803 ACPI_IORT_NODE *IortNode; 1804 ACPI_IORT_ITS_GROUP *IortItsGroup = NULL; 1805 ACPI_IORT_SMMU *IortSmmu = NULL; 1806 UINT32 Offset; 1807 UINT32 NodeOffset; 1808 UINT32 Length; 1809 ACPI_DMTABLE_INFO *InfoTable; 1810 char *String; 1811 UINT32 i; 1812 1813 1814 /* Main table */ 1815 1816 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort); 1817 if (ACPI_FAILURE (Status)) 1818 { 1819 return; 1820 } 1821 1822 Iort = ACPI_CAST_PTR (ACPI_TABLE_IORT, Table); 1823 Offset = sizeof (ACPI_TABLE_IORT); 1824 1825 /* Dump the OptionalPadding (optional) */ 1826 1827 if (Iort->NodeOffset > Offset) 1828 { 1829 Status = AcpiDmDumpTable (Table->Length, Offset, Table, 1830 Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad); 1831 if (ACPI_FAILURE (Status)) 1832 { 1833 return; 1834 } 1835 } 1836 1837 Offset = Iort->NodeOffset; 1838 while (Offset < Table->Length) 1839 { 1840 /* Common subtable header */ 1841 1842 IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, Table, Offset); 1843 AcpiOsPrintf ("\n"); 1844 Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData); 1845 Status = AcpiDmDumpTable (Table->Length, Offset, 1846 IortNode, Length, AcpiDmTableInfoIortHdr); 1847 if (ACPI_FAILURE (Status)) 1848 { 1849 return; 1850 } 1851 1852 NodeOffset = Length; 1853 1854 switch (IortNode->Type) 1855 { 1856 case ACPI_IORT_NODE_ITS_GROUP: 1857 1858 InfoTable = AcpiDmTableInfoIort0; 1859 Length = ACPI_OFFSET (ACPI_IORT_ITS_GROUP, Identifiers); 1860 IortItsGroup = ACPI_ADD_PTR (ACPI_IORT_ITS_GROUP, IortNode, NodeOffset); 1861 break; 1862 1863 case ACPI_IORT_NODE_NAMED_COMPONENT: 1864 1865 InfoTable = AcpiDmTableInfoIort1; 1866 Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); 1867 String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); 1868 Length += strlen (String) + 1; 1869 break; 1870 1871 case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: 1872 1873 InfoTable = AcpiDmTableInfoIort2; 1874 Length = IortNode->Length - NodeOffset; 1875 break; 1876 1877 case ACPI_IORT_NODE_SMMU: 1878 1879 InfoTable = AcpiDmTableInfoIort3; 1880 Length = ACPI_OFFSET (ACPI_IORT_SMMU, Interrupts); 1881 IortSmmu = ACPI_ADD_PTR (ACPI_IORT_SMMU, IortNode, NodeOffset); 1882 break; 1883 1884 case ACPI_IORT_NODE_SMMU_V3: 1885 1886 InfoTable = AcpiDmTableInfoIort4; 1887 Length = IortNode->Length - NodeOffset; 1888 break; 1889 1890 default: 1891 1892 AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n", 1893 IortNode->Type); 1894 1895 /* Attempt to continue */ 1896 1897 if (!IortNode->Length) 1898 { 1899 AcpiOsPrintf ("Invalid zero length IORT node\n"); 1900 return; 1901 } 1902 goto NextSubTable; 1903 } 1904 1905 /* Dump the node subtable header */ 1906 1907 AcpiOsPrintf ("\n"); 1908 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 1909 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 1910 Length, InfoTable); 1911 if (ACPI_FAILURE (Status)) 1912 { 1913 return; 1914 } 1915 1916 NodeOffset += Length; 1917 1918 /* Dump the node specific data */ 1919 1920 switch (IortNode->Type) 1921 { 1922 case ACPI_IORT_NODE_ITS_GROUP: 1923 1924 /* Validate IortItsGroup to avoid compiler warnings */ 1925 1926 if (IortItsGroup) 1927 { 1928 for (i = 0; i < IortItsGroup->ItsCount; i++) 1929 { 1930 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 1931 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 1932 4, AcpiDmTableInfoIort0a); 1933 NodeOffset += 4; 1934 } 1935 } 1936 break; 1937 1938 case ACPI_IORT_NODE_NAMED_COMPONENT: 1939 1940 /* Dump the Padding (optional) */ 1941 1942 if (IortNode->Length > NodeOffset) 1943 { 1944 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 1945 Table, IortNode->Length - NodeOffset, 1946 AcpiDmTableInfoIort1a); 1947 if (ACPI_FAILURE (Status)) 1948 { 1949 return; 1950 } 1951 } 1952 break; 1953 1954 case ACPI_IORT_NODE_SMMU: 1955 1956 AcpiOsPrintf ("\n"); 1957 1958 /* Validate IortSmmu to avoid compiler warnings */ 1959 1960 if (IortSmmu) 1961 { 1962 Length = 2 * sizeof (UINT64); 1963 NodeOffset = IortSmmu->GlobalInterruptOffset; 1964 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 1965 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 1966 Length, AcpiDmTableInfoIort3a); 1967 if (ACPI_FAILURE (Status)) 1968 { 1969 return; 1970 } 1971 1972 NodeOffset = IortSmmu->ContextInterruptOffset; 1973 for (i = 0; i < IortSmmu->ContextInterruptCount; i++) 1974 { 1975 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 1976 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 1977 8, AcpiDmTableInfoIort3b); 1978 if (ACPI_FAILURE (Status)) 1979 { 1980 return; 1981 } 1982 1983 NodeOffset += 8; 1984 } 1985 1986 NodeOffset = IortSmmu->PmuInterruptOffset; 1987 for (i = 0; i < IortSmmu->PmuInterruptCount; i++) 1988 { 1989 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 1990 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 1991 8, AcpiDmTableInfoIort3c); 1992 if (ACPI_FAILURE (Status)) 1993 { 1994 return; 1995 } 1996 1997 NodeOffset += 8; 1998 } 1999 } 2000 break; 2001 2002 default: 2003 2004 break; 2005 } 2006 2007 /* Dump the ID mappings */ 2008 2009 NodeOffset = IortNode->MappingOffset; 2010 for (i = 0; i < IortNode->MappingCount; i++) 2011 { 2012 AcpiOsPrintf ("\n"); 2013 Length = sizeof (ACPI_IORT_ID_MAPPING); 2014 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 2015 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 2016 Length, AcpiDmTableInfoIortMap); 2017 if (ACPI_FAILURE (Status)) 2018 { 2019 return; 2020 } 2021 2022 NodeOffset += Length; 2023 } 2024 2025 NextSubTable: 2026 /* Point to next node subtable */ 2027 2028 Offset += IortNode->Length; 2029 IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length); 2030 } 2031 } 2032 2033 2034 /******************************************************************************* 2035 * 2036 * FUNCTION: AcpiDmDumpIvrs 2037 * 2038 * PARAMETERS: Table - A IVRS table 2039 * 2040 * RETURN: None 2041 * 2042 * DESCRIPTION: Format the contents of a IVRS 2043 * 2044 ******************************************************************************/ 2045 2046 static UINT8 EntrySizes[] = {4,8,16,32}; 2047 2048 void 2049 AcpiDmDumpIvrs ( 2050 ACPI_TABLE_HEADER *Table) 2051 { 2052 ACPI_STATUS Status; 2053 UINT32 Offset = sizeof (ACPI_TABLE_IVRS); 2054 UINT32 EntryOffset; 2055 UINT32 EntryLength; 2056 UINT32 EntryType; 2057 ACPI_IVRS_DE_HEADER *DeviceEntry; 2058 ACPI_IVRS_HEADER *SubTable; 2059 ACPI_DMTABLE_INFO *InfoTable; 2060 2061 2062 /* Main table */ 2063 2064 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs); 2065 if (ACPI_FAILURE (Status)) 2066 { 2067 return; 2068 } 2069 2070 /* Subtables */ 2071 2072 SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset); 2073 while (Offset < Table->Length) 2074 { 2075 /* Common subtable header */ 2076 2077 AcpiOsPrintf ("\n"); 2078 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2079 SubTable->Length, AcpiDmTableInfoIvrsHdr); 2080 if (ACPI_FAILURE (Status)) 2081 { 2082 return; 2083 } 2084 2085 switch (SubTable->Type) 2086 { 2087 case ACPI_IVRS_TYPE_HARDWARE: 2088 2089 InfoTable = AcpiDmTableInfoIvrs0; 2090 break; 2091 2092 case ACPI_IVRS_TYPE_MEMORY1: 2093 case ACPI_IVRS_TYPE_MEMORY2: 2094 case ACPI_IVRS_TYPE_MEMORY3: 2095 2096 InfoTable = AcpiDmTableInfoIvrs1; 2097 break; 2098 2099 default: 2100 2101 AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n", 2102 SubTable->Type); 2103 2104 /* Attempt to continue */ 2105 2106 if (!SubTable->Length) 2107 { 2108 AcpiOsPrintf ("Invalid zero length subtable\n"); 2109 return; 2110 } 2111 goto NextSubTable; 2112 } 2113 2114 /* Dump the subtable */ 2115 2116 AcpiOsPrintf ("\n"); 2117 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2118 SubTable->Length, InfoTable); 2119 if (ACPI_FAILURE (Status)) 2120 { 2121 return; 2122 } 2123 2124 /* The hardware subtable can contain multiple device entries */ 2125 2126 if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE) 2127 { 2128 EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE); 2129 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable, 2130 sizeof (ACPI_IVRS_HARDWARE)); 2131 2132 while (EntryOffset < (Offset + SubTable->Length)) 2133 { 2134 AcpiOsPrintf ("\n"); 2135 /* 2136 * Upper 2 bits of Type encode the length of the device entry 2137 * 2138 * 00 = 4 byte 2139 * 01 = 8 byte 2140 * 10 = 16 byte - currently no entries defined 2141 * 11 = 32 byte - currently no entries defined 2142 */ 2143 EntryType = DeviceEntry->Type; 2144 EntryLength = EntrySizes [EntryType >> 6]; 2145 2146 switch (EntryType) 2147 { 2148 /* 4-byte device entries */ 2149 2150 case ACPI_IVRS_TYPE_PAD4: 2151 case ACPI_IVRS_TYPE_ALL: 2152 case ACPI_IVRS_TYPE_SELECT: 2153 case ACPI_IVRS_TYPE_START: 2154 case ACPI_IVRS_TYPE_END: 2155 2156 InfoTable = AcpiDmTableInfoIvrs4; 2157 break; 2158 2159 /* 8-byte entries, type A */ 2160 2161 case ACPI_IVRS_TYPE_ALIAS_SELECT: 2162 case ACPI_IVRS_TYPE_ALIAS_START: 2163 2164 InfoTable = AcpiDmTableInfoIvrs8a; 2165 break; 2166 2167 /* 8-byte entries, type B */ 2168 2169 case ACPI_IVRS_TYPE_PAD8: 2170 case ACPI_IVRS_TYPE_EXT_SELECT: 2171 case ACPI_IVRS_TYPE_EXT_START: 2172 2173 InfoTable = AcpiDmTableInfoIvrs8b; 2174 break; 2175 2176 /* 8-byte entries, type C */ 2177 2178 case ACPI_IVRS_TYPE_SPECIAL: 2179 2180 InfoTable = AcpiDmTableInfoIvrs8c; 2181 break; 2182 2183 default: 2184 InfoTable = AcpiDmTableInfoIvrs4; 2185 AcpiOsPrintf ( 2186 "\n**** Unknown IVRS device entry type/length: " 2187 "0x%.2X/0x%X at offset 0x%.4X: (header below)\n", 2188 EntryType, EntryLength, EntryOffset); 2189 break; 2190 } 2191 2192 /* Dump the Device Entry */ 2193 2194 Status = AcpiDmDumpTable (Table->Length, EntryOffset, 2195 DeviceEntry, EntryLength, InfoTable); 2196 if (ACPI_FAILURE (Status)) 2197 { 2198 return; 2199 } 2200 2201 EntryOffset += EntryLength; 2202 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry, 2203 EntryLength); 2204 } 2205 } 2206 2207 NextSubTable: 2208 /* Point to next subtable */ 2209 2210 Offset += SubTable->Length; 2211 SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length); 2212 } 2213 } 2214 2215 2216 /******************************************************************************* 2217 * 2218 * FUNCTION: AcpiDmDumpLpit 2219 * 2220 * PARAMETERS: Table - A LPIT table 2221 * 2222 * RETURN: None 2223 * 2224 * DESCRIPTION: Format the contents of a LPIT. This table type consists 2225 * of an open-ended number of subtables. Note: There are no 2226 * entries in the main table. An LPIT consists of the table 2227 * header and then subtables only. 2228 * 2229 ******************************************************************************/ 2230 2231 void 2232 AcpiDmDumpLpit ( 2233 ACPI_TABLE_HEADER *Table) 2234 { 2235 ACPI_STATUS Status; 2236 ACPI_LPIT_HEADER *SubTable; 2237 UINT32 Length = Table->Length; 2238 UINT32 Offset = sizeof (ACPI_TABLE_LPIT); 2239 ACPI_DMTABLE_INFO *InfoTable; 2240 UINT32 SubTableLength; 2241 2242 2243 /* Subtables */ 2244 2245 SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset); 2246 while (Offset < Table->Length) 2247 { 2248 /* Common subtable header */ 2249 2250 Status = AcpiDmDumpTable (Length, Offset, SubTable, 2251 sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr); 2252 if (ACPI_FAILURE (Status)) 2253 { 2254 return; 2255 } 2256 2257 switch (SubTable->Type) 2258 { 2259 case ACPI_LPIT_TYPE_NATIVE_CSTATE: 2260 2261 InfoTable = AcpiDmTableInfoLpit0; 2262 SubTableLength = sizeof (ACPI_LPIT_NATIVE); 2263 break; 2264 2265 default: 2266 2267 /* Cannot continue on unknown type - no length */ 2268 2269 AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", 2270 SubTable->Type); 2271 return; 2272 } 2273 2274 Status = AcpiDmDumpTable (Length, Offset, SubTable, 2275 SubTableLength, InfoTable); 2276 if (ACPI_FAILURE (Status)) 2277 { 2278 return; 2279 } 2280 2281 AcpiOsPrintf ("\n"); 2282 2283 /* Point to next subtable */ 2284 2285 Offset += SubTableLength; 2286 SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength); 2287 } 2288 } 2289 2290 2291 /******************************************************************************* 2292 * 2293 * FUNCTION: AcpiDmDumpMadt 2294 * 2295 * PARAMETERS: Table - A MADT table 2296 * 2297 * RETURN: None 2298 * 2299 * DESCRIPTION: Format the contents of a MADT. This table type consists 2300 * of an open-ended number of subtables. 2301 * 2302 ******************************************************************************/ 2303 2304 void 2305 AcpiDmDumpMadt ( 2306 ACPI_TABLE_HEADER *Table) 2307 { 2308 ACPI_STATUS Status; 2309 ACPI_SUBTABLE_HEADER *SubTable; 2310 UINT32 Length = Table->Length; 2311 UINT32 Offset = sizeof (ACPI_TABLE_MADT); 2312 ACPI_DMTABLE_INFO *InfoTable; 2313 2314 2315 /* Main table */ 2316 2317 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt); 2318 if (ACPI_FAILURE (Status)) 2319 { 2320 return; 2321 } 2322 2323 /* Subtables */ 2324 2325 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); 2326 while (Offset < Table->Length) 2327 { 2328 /* Common subtable header */ 2329 2330 AcpiOsPrintf ("\n"); 2331 Status = AcpiDmDumpTable (Length, Offset, SubTable, 2332 SubTable->Length, AcpiDmTableInfoMadtHdr); 2333 if (ACPI_FAILURE (Status)) 2334 { 2335 return; 2336 } 2337 2338 switch (SubTable->Type) 2339 { 2340 case ACPI_MADT_TYPE_LOCAL_APIC: 2341 2342 InfoTable = AcpiDmTableInfoMadt0; 2343 break; 2344 2345 case ACPI_MADT_TYPE_IO_APIC: 2346 2347 InfoTable = AcpiDmTableInfoMadt1; 2348 break; 2349 2350 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: 2351 2352 InfoTable = AcpiDmTableInfoMadt2; 2353 break; 2354 2355 case ACPI_MADT_TYPE_NMI_SOURCE: 2356 2357 InfoTable = AcpiDmTableInfoMadt3; 2358 break; 2359 2360 case ACPI_MADT_TYPE_LOCAL_APIC_NMI: 2361 2362 InfoTable = AcpiDmTableInfoMadt4; 2363 break; 2364 2365 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: 2366 2367 InfoTable = AcpiDmTableInfoMadt5; 2368 break; 2369 2370 case ACPI_MADT_TYPE_IO_SAPIC: 2371 2372 InfoTable = AcpiDmTableInfoMadt6; 2373 break; 2374 2375 case ACPI_MADT_TYPE_LOCAL_SAPIC: 2376 2377 InfoTable = AcpiDmTableInfoMadt7; 2378 break; 2379 2380 case ACPI_MADT_TYPE_INTERRUPT_SOURCE: 2381 2382 InfoTable = AcpiDmTableInfoMadt8; 2383 break; 2384 2385 case ACPI_MADT_TYPE_LOCAL_X2APIC: 2386 2387 InfoTable = AcpiDmTableInfoMadt9; 2388 break; 2389 2390 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: 2391 2392 InfoTable = AcpiDmTableInfoMadt10; 2393 break; 2394 2395 case ACPI_MADT_TYPE_GENERIC_INTERRUPT: 2396 2397 InfoTable = AcpiDmTableInfoMadt11; 2398 break; 2399 2400 case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: 2401 2402 InfoTable = AcpiDmTableInfoMadt12; 2403 break; 2404 2405 case ACPI_MADT_TYPE_GENERIC_MSI_FRAME: 2406 2407 InfoTable = AcpiDmTableInfoMadt13; 2408 break; 2409 2410 case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: 2411 2412 InfoTable = AcpiDmTableInfoMadt14; 2413 break; 2414 2415 case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: 2416 2417 InfoTable = AcpiDmTableInfoMadt15; 2418 break; 2419 2420 default: 2421 2422 AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", 2423 SubTable->Type); 2424 2425 /* Attempt to continue */ 2426 2427 if (!SubTable->Length) 2428 { 2429 AcpiOsPrintf ("Invalid zero length subtable\n"); 2430 return; 2431 } 2432 2433 goto NextSubTable; 2434 } 2435 2436 Status = AcpiDmDumpTable (Length, Offset, SubTable, 2437 SubTable->Length, InfoTable); 2438 if (ACPI_FAILURE (Status)) 2439 { 2440 return; 2441 } 2442 2443 NextSubTable: 2444 /* Point to next subtable */ 2445 2446 Offset += SubTable->Length; 2447 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, 2448 SubTable->Length); 2449 } 2450 } 2451 2452 2453 /******************************************************************************* 2454 * 2455 * FUNCTION: AcpiDmDumpMcfg 2456 * 2457 * PARAMETERS: Table - A MCFG Table 2458 * 2459 * RETURN: None 2460 * 2461 * DESCRIPTION: Format the contents of a MCFG table 2462 * 2463 ******************************************************************************/ 2464 2465 void 2466 AcpiDmDumpMcfg ( 2467 ACPI_TABLE_HEADER *Table) 2468 { 2469 ACPI_STATUS Status; 2470 UINT32 Offset = sizeof (ACPI_TABLE_MCFG); 2471 ACPI_MCFG_ALLOCATION *SubTable; 2472 2473 2474 /* Main table */ 2475 2476 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg); 2477 if (ACPI_FAILURE (Status)) 2478 { 2479 return; 2480 } 2481 2482 /* Subtables */ 2483 2484 SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset); 2485 while (Offset < Table->Length) 2486 { 2487 if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length) 2488 { 2489 AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n", 2490 sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length)); 2491 return; 2492 } 2493 2494 AcpiOsPrintf ("\n"); 2495 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2496 sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0); 2497 if (ACPI_FAILURE (Status)) 2498 { 2499 return; 2500 } 2501 2502 /* Point to next subtable (each subtable is of fixed length) */ 2503 2504 Offset += sizeof (ACPI_MCFG_ALLOCATION); 2505 SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable, 2506 sizeof (ACPI_MCFG_ALLOCATION)); 2507 } 2508 } 2509 2510 2511 /******************************************************************************* 2512 * 2513 * FUNCTION: AcpiDmDumpMpst 2514 * 2515 * PARAMETERS: Table - A MPST Table 2516 * 2517 * RETURN: None 2518 * 2519 * DESCRIPTION: Format the contents of a MPST table 2520 * 2521 ******************************************************************************/ 2522 2523 void 2524 AcpiDmDumpMpst ( 2525 ACPI_TABLE_HEADER *Table) 2526 { 2527 ACPI_STATUS Status; 2528 UINT32 Offset = sizeof (ACPI_TABLE_MPST); 2529 ACPI_MPST_POWER_NODE *SubTable0; 2530 ACPI_MPST_POWER_STATE *SubTable0A; 2531 ACPI_MPST_COMPONENT *SubTable0B; 2532 ACPI_MPST_DATA_HDR *SubTable1; 2533 ACPI_MPST_POWER_DATA *SubTable2; 2534 UINT16 SubtableCount; 2535 UINT32 PowerStateCount; 2536 UINT32 ComponentCount; 2537 2538 2539 /* Main table */ 2540 2541 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst); 2542 if (ACPI_FAILURE (Status)) 2543 { 2544 return; 2545 } 2546 2547 /* Subtable: Memory Power Node(s) */ 2548 2549 SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount; 2550 SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset); 2551 2552 while ((Offset < Table->Length) && SubtableCount) 2553 { 2554 AcpiOsPrintf ("\n"); 2555 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0, 2556 sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0); 2557 if (ACPI_FAILURE (Status)) 2558 { 2559 return; 2560 } 2561 2562 /* Extract the sub-subtable counts */ 2563 2564 PowerStateCount = SubTable0->NumPowerStates; 2565 ComponentCount = SubTable0->NumPhysicalComponents; 2566 Offset += sizeof (ACPI_MPST_POWER_NODE); 2567 2568 /* Sub-subtables - Memory Power State Structure(s) */ 2569 2570 SubTable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, SubTable0, 2571 sizeof (ACPI_MPST_POWER_NODE)); 2572 2573 while (PowerStateCount) 2574 { 2575 AcpiOsPrintf ("\n"); 2576 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A, 2577 sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A); 2578 if (ACPI_FAILURE (Status)) 2579 { 2580 return; 2581 } 2582 2583 SubTable0A++; 2584 PowerStateCount--; 2585 Offset += sizeof (ACPI_MPST_POWER_STATE); 2586 } 2587 2588 /* Sub-subtables - Physical Component ID Structure(s) */ 2589 2590 SubTable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, SubTable0A); 2591 2592 if (ComponentCount) 2593 { 2594 AcpiOsPrintf ("\n"); 2595 } 2596 2597 while (ComponentCount) 2598 { 2599 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B, 2600 sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B); 2601 if (ACPI_FAILURE (Status)) 2602 { 2603 return; 2604 } 2605 2606 SubTable0B++; 2607 ComponentCount--; 2608 Offset += sizeof (ACPI_MPST_COMPONENT); 2609 } 2610 2611 /* Point to next Memory Power Node subtable */ 2612 2613 SubtableCount--; 2614 SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, SubTable0, 2615 sizeof (ACPI_MPST_POWER_NODE) + 2616 (sizeof (ACPI_MPST_POWER_STATE) * SubTable0->NumPowerStates) + 2617 (sizeof (ACPI_MPST_COMPONENT) * SubTable0->NumPhysicalComponents)); 2618 } 2619 2620 /* Subtable: Count of Memory Power State Characteristic structures */ 2621 2622 AcpiOsPrintf ("\n"); 2623 SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0); 2624 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1, 2625 sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1); 2626 if (ACPI_FAILURE (Status)) 2627 { 2628 return; 2629 } 2630 2631 SubtableCount = SubTable1->CharacteristicsCount; 2632 Offset += sizeof (ACPI_MPST_DATA_HDR); 2633 2634 /* Subtable: Memory Power State Characteristics structure(s) */ 2635 2636 SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1, 2637 sizeof (ACPI_MPST_DATA_HDR)); 2638 2639 while ((Offset < Table->Length) && SubtableCount) 2640 { 2641 AcpiOsPrintf ("\n"); 2642 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2, 2643 sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2); 2644 if (ACPI_FAILURE (Status)) 2645 { 2646 return; 2647 } 2648 2649 SubTable2++; 2650 SubtableCount--; 2651 Offset += sizeof (ACPI_MPST_POWER_DATA); 2652 } 2653 } 2654 2655 2656 /******************************************************************************* 2657 * 2658 * FUNCTION: AcpiDmDumpMsct 2659 * 2660 * PARAMETERS: Table - A MSCT table 2661 * 2662 * RETURN: None 2663 * 2664 * DESCRIPTION: Format the contents of a MSCT 2665 * 2666 ******************************************************************************/ 2667 2668 void 2669 AcpiDmDumpMsct ( 2670 ACPI_TABLE_HEADER *Table) 2671 { 2672 ACPI_STATUS Status; 2673 UINT32 Offset = sizeof (ACPI_TABLE_MSCT); 2674 ACPI_MSCT_PROXIMITY *SubTable; 2675 2676 2677 /* Main table */ 2678 2679 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct); 2680 if (ACPI_FAILURE (Status)) 2681 { 2682 return; 2683 } 2684 2685 /* Subtables */ 2686 2687 SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset); 2688 while (Offset < Table->Length) 2689 { 2690 /* Common subtable header */ 2691 2692 AcpiOsPrintf ("\n"); 2693 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2694 sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0); 2695 if (ACPI_FAILURE (Status)) 2696 { 2697 return; 2698 } 2699 2700 /* Point to next subtable */ 2701 2702 Offset += sizeof (ACPI_MSCT_PROXIMITY); 2703 SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, 2704 sizeof (ACPI_MSCT_PROXIMITY)); 2705 } 2706 } 2707 2708 2709 /******************************************************************************* 2710 * 2711 * FUNCTION: AcpiDmDumpMtmr 2712 * 2713 * PARAMETERS: Table - A MTMR table 2714 * 2715 * RETURN: None 2716 * 2717 * DESCRIPTION: Format the contents of a MTMR 2718 * 2719 ******************************************************************************/ 2720 2721 void 2722 AcpiDmDumpMtmr ( 2723 ACPI_TABLE_HEADER *Table) 2724 { 2725 ACPI_STATUS Status; 2726 UINT32 Offset = sizeof (ACPI_TABLE_MTMR); 2727 ACPI_MTMR_ENTRY *SubTable; 2728 2729 2730 /* Main table */ 2731 2732 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr); 2733 if (ACPI_FAILURE (Status)) 2734 { 2735 return; 2736 } 2737 2738 /* Subtables */ 2739 2740 SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset); 2741 while (Offset < Table->Length) 2742 { 2743 /* Common subtable header */ 2744 2745 AcpiOsPrintf ("\n"); 2746 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2747 sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0); 2748 if (ACPI_FAILURE (Status)) 2749 { 2750 return; 2751 } 2752 2753 /* Point to next subtable */ 2754 2755 Offset += sizeof (ACPI_MTMR_ENTRY); 2756 SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, 2757 sizeof (ACPI_MTMR_ENTRY)); 2758 } 2759 } 2760 2761 2762 /******************************************************************************* 2763 * 2764 * FUNCTION: AcpiDmDumpNfit 2765 * 2766 * PARAMETERS: Table - A NFIT table 2767 * 2768 * RETURN: None 2769 * 2770 * DESCRIPTION: Format the contents of an NFIT. 2771 * 2772 ******************************************************************************/ 2773 2774 void 2775 AcpiDmDumpNfit ( 2776 ACPI_TABLE_HEADER *Table) 2777 { 2778 ACPI_STATUS Status; 2779 UINT32 Offset = sizeof (ACPI_TABLE_NFIT); 2780 UINT32 FieldOffset = 0; 2781 UINT32 Length; 2782 ACPI_NFIT_HEADER *SubTable; 2783 ACPI_DMTABLE_INFO *InfoTable; 2784 ACPI_NFIT_INTERLEAVE *Interleave = NULL; 2785 ACPI_NFIT_SMBIOS *SmbiosInfo = NULL; 2786 ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL; 2787 UINT32 i; 2788 2789 2790 /* Main table */ 2791 2792 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit); 2793 if (ACPI_FAILURE (Status)) 2794 { 2795 return; 2796 } 2797 2798 /* Subtables */ 2799 2800 SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset); 2801 while (Offset < Table->Length) 2802 { 2803 /* NFIT subtable header */ 2804 2805 AcpiOsPrintf ("\n"); 2806 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2807 SubTable->Length, AcpiDmTableInfoNfitHdr); 2808 if (ACPI_FAILURE (Status)) 2809 { 2810 return; 2811 } 2812 2813 switch (SubTable->Type) 2814 { 2815 case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: 2816 2817 InfoTable = AcpiDmTableInfoNfit0; 2818 break; 2819 2820 case ACPI_NFIT_TYPE_MEMORY_MAP: 2821 2822 InfoTable = AcpiDmTableInfoNfit1; 2823 break; 2824 2825 case ACPI_NFIT_TYPE_INTERLEAVE: 2826 2827 /* Has a variable number of 32-bit values at the end */ 2828 2829 InfoTable = AcpiDmTableInfoNfit2; 2830 Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, SubTable); 2831 FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE); 2832 break; 2833 2834 case ACPI_NFIT_TYPE_SMBIOS: 2835 2836 SmbiosInfo = ACPI_CAST_PTR (ACPI_NFIT_SMBIOS, SubTable); 2837 InfoTable = AcpiDmTableInfoNfit3; 2838 break; 2839 2840 case ACPI_NFIT_TYPE_CONTROL_REGION: 2841 2842 InfoTable = AcpiDmTableInfoNfit4; 2843 break; 2844 2845 case ACPI_NFIT_TYPE_DATA_REGION: 2846 2847 InfoTable = AcpiDmTableInfoNfit5; 2848 break; 2849 2850 case ACPI_NFIT_TYPE_FLUSH_ADDRESS: 2851 2852 /* Has a variable number of 64-bit addresses at the end */ 2853 2854 InfoTable = AcpiDmTableInfoNfit6; 2855 Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, SubTable); 2856 FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); 2857 break; 2858 2859 default: 2860 AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", 2861 SubTable->Type); 2862 2863 /* Attempt to continue */ 2864 2865 if (!SubTable->Length) 2866 { 2867 AcpiOsPrintf ("Invalid zero length subtable\n"); 2868 return; 2869 } 2870 goto NextSubTable; 2871 } 2872 2873 AcpiOsPrintf ("\n"); 2874 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 2875 SubTable->Length, InfoTable); 2876 if (ACPI_FAILURE (Status)) 2877 { 2878 return; 2879 } 2880 2881 /* Per-subtable variable-length fields */ 2882 2883 switch (SubTable->Type) 2884 { 2885 case ACPI_NFIT_TYPE_INTERLEAVE: 2886 2887 for (i = 0; i < Interleave->LineCount; i++) 2888 { 2889 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, 2890 &Interleave->LineOffset[i], 2891 sizeof (UINT32), AcpiDmTableInfoNfit2a); 2892 if (ACPI_FAILURE (Status)) 2893 { 2894 return; 2895 } 2896 2897 FieldOffset += sizeof (UINT32); 2898 } 2899 break; 2900 2901 case ACPI_NFIT_TYPE_SMBIOS: 2902 2903 Length = SubTable->Length - 2904 sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8); 2905 2906 if (Length) 2907 { 2908 Status = AcpiDmDumpTable (Table->Length, 2909 sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8), 2910 SmbiosInfo, 2911 Length, AcpiDmTableInfoNfit3a); 2912 if (ACPI_FAILURE (Status)) 2913 { 2914 return; 2915 } 2916 } 2917 2918 break; 2919 2920 case ACPI_NFIT_TYPE_FLUSH_ADDRESS: 2921 2922 for (i = 0; i < Hint->HintCount; i++) 2923 { 2924 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, 2925 &Hint->HintAddress[i], 2926 sizeof (UINT64), AcpiDmTableInfoNfit6a); 2927 if (ACPI_FAILURE (Status)) 2928 { 2929 return; 2930 } 2931 2932 FieldOffset += sizeof (UINT64); 2933 } 2934 break; 2935 2936 default: 2937 break; 2938 } 2939 2940 NextSubTable: 2941 /* Point to next subtable */ 2942 2943 Offset += SubTable->Length; 2944 SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, SubTable, SubTable->Length); 2945 } 2946 } 2947 2948 2949 /******************************************************************************* 2950 * 2951 * FUNCTION: AcpiDmDumpPcct 2952 * 2953 * PARAMETERS: Table - A PCCT table 2954 * 2955 * RETURN: None 2956 * 2957 * DESCRIPTION: Format the contents of a PCCT. This table type consists 2958 * of an open-ended number of subtables. 2959 * 2960 ******************************************************************************/ 2961 2962 void 2963 AcpiDmDumpPcct ( 2964 ACPI_TABLE_HEADER *Table) 2965 { 2966 ACPI_STATUS Status; 2967 ACPI_PCCT_SUBSPACE *SubTable; 2968 ACPI_DMTABLE_INFO *InfoTable; 2969 UINT32 Length = Table->Length; 2970 UINT32 Offset = sizeof (ACPI_TABLE_PCCT); 2971 2972 2973 /* Main table */ 2974 2975 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct); 2976 if (ACPI_FAILURE (Status)) 2977 { 2978 return; 2979 } 2980 2981 /* Subtables */ 2982 2983 SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset); 2984 while (Offset < Table->Length) 2985 { 2986 /* Common subtable header */ 2987 2988 AcpiOsPrintf ("\n"); 2989 Status = AcpiDmDumpTable (Length, Offset, SubTable, 2990 SubTable->Header.Length, AcpiDmTableInfoPcctHdr); 2991 if (ACPI_FAILURE (Status)) 2992 { 2993 return; 2994 } 2995 2996 switch (SubTable->Header.Type) 2997 { 2998 case ACPI_PCCT_TYPE_GENERIC_SUBSPACE: 2999 3000 InfoTable = AcpiDmTableInfoPcct0; 3001 break; 3002 3003 case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE: 3004 3005 InfoTable = AcpiDmTableInfoPcct1; 3006 break; 3007 3008 case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2: 3009 3010 InfoTable = AcpiDmTableInfoPcct2; 3011 break; 3012 3013 default: 3014 3015 AcpiOsPrintf ( 3016 "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n", 3017 SubTable->Header.Type); 3018 return; 3019 } 3020 3021 AcpiOsPrintf ("\n"); 3022 Status = AcpiDmDumpTable (Length, Offset, SubTable, 3023 SubTable->Header.Length, InfoTable); 3024 if (ACPI_FAILURE (Status)) 3025 { 3026 return; 3027 } 3028 3029 /* Point to next subtable */ 3030 3031 Offset += SubTable->Header.Length; 3032 SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable, 3033 SubTable->Header.Length); 3034 } 3035 } 3036 3037 3038 /******************************************************************************* 3039 * 3040 * FUNCTION: AcpiDmDumpPmtt 3041 * 3042 * PARAMETERS: Table - A PMTT table 3043 * 3044 * RETURN: None 3045 * 3046 * DESCRIPTION: Format the contents of a PMTT. This table type consists 3047 * of an open-ended number of subtables. 3048 * 3049 ******************************************************************************/ 3050 3051 void 3052 AcpiDmDumpPmtt ( 3053 ACPI_TABLE_HEADER *Table) 3054 { 3055 ACPI_STATUS Status; 3056 ACPI_PMTT_HEADER *SubTable; 3057 ACPI_PMTT_HEADER *MemSubTable; 3058 ACPI_PMTT_HEADER *DimmSubTable; 3059 ACPI_PMTT_DOMAIN *DomainArray; 3060 UINT32 Length = Table->Length; 3061 UINT32 Offset = sizeof (ACPI_TABLE_PMTT); 3062 UINT32 MemOffset; 3063 UINT32 DimmOffset; 3064 UINT32 DomainOffset; 3065 UINT32 DomainCount; 3066 3067 3068 /* Main table */ 3069 3070 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt); 3071 if (ACPI_FAILURE (Status)) 3072 { 3073 return; 3074 } 3075 3076 /* Subtables */ 3077 3078 SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset); 3079 while (Offset < Table->Length) 3080 { 3081 /* Common subtable header */ 3082 3083 AcpiOsPrintf ("\n"); 3084 Status = AcpiDmDumpTable (Length, Offset, SubTable, 3085 SubTable->Length, AcpiDmTableInfoPmttHdr); 3086 if (ACPI_FAILURE (Status)) 3087 { 3088 return; 3089 } 3090 3091 /* Only Socket subtables are expected at this level */ 3092 3093 if (SubTable->Type != ACPI_PMTT_TYPE_SOCKET) 3094 { 3095 AcpiOsPrintf ( 3096 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", 3097 SubTable->Type); 3098 return; 3099 } 3100 3101 /* Dump the fixed-length portion of the subtable */ 3102 3103 Status = AcpiDmDumpTable (Length, Offset, SubTable, 3104 SubTable->Length, AcpiDmTableInfoPmtt0); 3105 if (ACPI_FAILURE (Status)) 3106 { 3107 return; 3108 } 3109 3110 /* Walk the memory controller subtables */ 3111 3112 MemOffset = sizeof (ACPI_PMTT_SOCKET); 3113 MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable, 3114 sizeof (ACPI_PMTT_SOCKET)); 3115 3116 while (((Offset + MemOffset) < Table->Length) && 3117 (MemOffset < SubTable->Length)) 3118 { 3119 /* Common subtable header */ 3120 3121 AcpiOsPrintf ("\n"); 3122 Status = AcpiDmDumpTable (Length, 3123 Offset + MemOffset, MemSubTable, 3124 MemSubTable->Length, AcpiDmTableInfoPmttHdr); 3125 if (ACPI_FAILURE (Status)) 3126 { 3127 return; 3128 } 3129 3130 /* Only memory controller subtables are expected at this level */ 3131 3132 if (MemSubTable->Type != ACPI_PMTT_TYPE_CONTROLLER) 3133 { 3134 AcpiOsPrintf ( 3135 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", 3136 MemSubTable->Type); 3137 return; 3138 } 3139 3140 /* Dump the fixed-length portion of the controller subtable */ 3141 3142 Status = AcpiDmDumpTable (Length, 3143 Offset + MemOffset, MemSubTable, 3144 MemSubTable->Length, AcpiDmTableInfoPmtt1); 3145 if (ACPI_FAILURE (Status)) 3146 { 3147 return; 3148 } 3149 3150 /* Walk the variable count of proximity domains */ 3151 3152 DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount; 3153 DomainOffset = sizeof (ACPI_PMTT_CONTROLLER); 3154 DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubTable, 3155 sizeof (ACPI_PMTT_CONTROLLER)); 3156 3157 while (((Offset + MemOffset + DomainOffset) < Table->Length) && 3158 ((MemOffset + DomainOffset) < SubTable->Length) && 3159 DomainCount) 3160 { 3161 Status = AcpiDmDumpTable (Length, 3162 Offset + MemOffset + DomainOffset, DomainArray, 3163 sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a); 3164 if (ACPI_FAILURE (Status)) 3165 { 3166 return; 3167 } 3168 3169 DomainOffset += sizeof (ACPI_PMTT_DOMAIN); 3170 DomainArray++; 3171 DomainCount--; 3172 } 3173 3174 if (DomainCount) 3175 { 3176 AcpiOsPrintf ( 3177 "\n**** DomainCount exceeds subtable length\n\n"); 3178 } 3179 3180 /* Walk the physical component (DIMM) subtables */ 3181 3182 DimmOffset = DomainOffset; 3183 DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubTable, 3184 DomainOffset); 3185 3186 while (((Offset + MemOffset + DimmOffset) < Table->Length) && 3187 (DimmOffset < MemSubTable->Length)) 3188 { 3189 /* Common subtable header */ 3190 3191 AcpiOsPrintf ("\n"); 3192 Status = AcpiDmDumpTable (Length, 3193 Offset + MemOffset + DimmOffset, DimmSubTable, 3194 DimmSubTable->Length, AcpiDmTableInfoPmttHdr); 3195 if (ACPI_FAILURE (Status)) 3196 { 3197 return; 3198 } 3199 3200 /* Only DIMM subtables are expected at this level */ 3201 3202 if (DimmSubTable->Type != ACPI_PMTT_TYPE_DIMM) 3203 { 3204 AcpiOsPrintf ( 3205 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", 3206 DimmSubTable->Type); 3207 return; 3208 } 3209 3210 /* Dump the fixed-length DIMM subtable */ 3211 3212 Status = AcpiDmDumpTable (Length, 3213 Offset + MemOffset + DimmOffset, DimmSubTable, 3214 DimmSubTable->Length, AcpiDmTableInfoPmtt2); 3215 if (ACPI_FAILURE (Status)) 3216 { 3217 return; 3218 } 3219 3220 /* Point to next DIMM subtable */ 3221 3222 DimmOffset += DimmSubTable->Length; 3223 DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, 3224 DimmSubTable, DimmSubTable->Length); 3225 } 3226 3227 /* Point to next Controller subtable */ 3228 3229 MemOffset += MemSubTable->Length; 3230 MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, 3231 MemSubTable, MemSubTable->Length); 3232 } 3233 3234 /* Point to next Socket subtable */ 3235 3236 Offset += SubTable->Length; 3237 SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, 3238 SubTable, SubTable->Length); 3239 } 3240 } 3241 3242 3243 /******************************************************************************* 3244 * 3245 * FUNCTION: AcpiDmDumpS3pt 3246 * 3247 * PARAMETERS: Table - A S3PT table 3248 * 3249 * RETURN: Length of the table 3250 * 3251 * DESCRIPTION: Format the contents of a S3PT 3252 * 3253 ******************************************************************************/ 3254 3255 UINT32 3256 AcpiDmDumpS3pt ( 3257 ACPI_TABLE_HEADER *Tables) 3258 { 3259 ACPI_STATUS Status; 3260 UINT32 Offset = sizeof (ACPI_TABLE_S3PT); 3261 ACPI_FPDT_HEADER *SubTable; 3262 ACPI_DMTABLE_INFO *InfoTable; 3263 ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables); 3264 3265 3266 /* Main table */ 3267 3268 Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt); 3269 if (ACPI_FAILURE (Status)) 3270 { 3271 return 0; 3272 } 3273 3274 SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset); 3275 while (Offset < S3ptTable->Length) 3276 { 3277 /* Common subtable header */ 3278 3279 AcpiOsPrintf ("\n"); 3280 Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable, 3281 SubTable->Length, AcpiDmTableInfoS3ptHdr); 3282 if (ACPI_FAILURE (Status)) 3283 { 3284 return 0; 3285 } 3286 3287 switch (SubTable->Type) 3288 { 3289 case ACPI_S3PT_TYPE_RESUME: 3290 3291 InfoTable = AcpiDmTableInfoS3pt0; 3292 break; 3293 3294 case ACPI_S3PT_TYPE_SUSPEND: 3295 3296 InfoTable = AcpiDmTableInfoS3pt1; 3297 break; 3298 3299 default: 3300 3301 AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", 3302 SubTable->Type); 3303 3304 /* Attempt to continue */ 3305 3306 if (!SubTable->Length) 3307 { 3308 AcpiOsPrintf ("Invalid zero length subtable\n"); 3309 return 0; 3310 } 3311 goto NextSubTable; 3312 } 3313 3314 AcpiOsPrintf ("\n"); 3315 Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable, 3316 SubTable->Length, InfoTable); 3317 if (ACPI_FAILURE (Status)) 3318 { 3319 return 0; 3320 } 3321 3322 NextSubTable: 3323 /* Point to next subtable */ 3324 3325 Offset += SubTable->Length; 3326 SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length); 3327 } 3328 3329 return (S3ptTable->Length); 3330 } 3331 3332 3333 /******************************************************************************* 3334 * 3335 * FUNCTION: AcpiDmDumpSlic 3336 * 3337 * PARAMETERS: Table - A SLIC table 3338 * 3339 * RETURN: None 3340 * 3341 * DESCRIPTION: Format the contents of a SLIC 3342 * 3343 ******************************************************************************/ 3344 3345 void 3346 AcpiDmDumpSlic ( 3347 ACPI_TABLE_HEADER *Table) 3348 { 3349 3350 (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table, 3351 Table->Length - sizeof (*Table), AcpiDmTableInfoSlic); 3352 } 3353 3354 3355 /******************************************************************************* 3356 * 3357 * FUNCTION: AcpiDmDumpSlit 3358 * 3359 * PARAMETERS: Table - An SLIT 3360 * 3361 * RETURN: None 3362 * 3363 * DESCRIPTION: Format the contents of a SLIT 3364 * 3365 ******************************************************************************/ 3366 3367 void 3368 AcpiDmDumpSlit ( 3369 ACPI_TABLE_HEADER *Table) 3370 { 3371 ACPI_STATUS Status; 3372 UINT32 Offset; 3373 UINT8 *Row; 3374 UINT32 Localities; 3375 UINT32 i; 3376 UINT32 j; 3377 3378 3379 /* Main table */ 3380 3381 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit); 3382 if (ACPI_FAILURE (Status)) 3383 { 3384 return; 3385 } 3386 3387 /* Display the Locality NxN Matrix */ 3388 3389 Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount; 3390 Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]); 3391 Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry; 3392 3393 for (i = 0; i < Localities; i++) 3394 { 3395 /* Display one row of the matrix */ 3396 3397 AcpiDmLineHeader2 (Offset, Localities, "Locality", i); 3398 for (j = 0; j < Localities; j++) 3399 { 3400 /* Check for beyond EOT */ 3401 3402 if (Offset >= Table->Length) 3403 { 3404 AcpiOsPrintf ( 3405 "\n**** Not enough room in table for all localities\n"); 3406 return; 3407 } 3408 3409 AcpiOsPrintf ("%2.2X", Row[j]); 3410 Offset++; 3411 3412 /* Display up to 16 bytes per output row */ 3413 3414 if ((j+1) < Localities) 3415 { 3416 AcpiOsPrintf (" "); 3417 3418 if (j && (((j+1) % 16) == 0)) 3419 { 3420 AcpiOsPrintf ("\\\n"); /* With line continuation char */ 3421 AcpiDmLineHeader (Offset, 0, NULL); 3422 } 3423 } 3424 } 3425 3426 /* Point to next row */ 3427 3428 AcpiOsPrintf ("\n"); 3429 Row += Localities; 3430 } 3431 } 3432 3433 3434 /******************************************************************************* 3435 * 3436 * FUNCTION: AcpiDmDumpSrat 3437 * 3438 * PARAMETERS: Table - A SRAT table 3439 * 3440 * RETURN: None 3441 * 3442 * DESCRIPTION: Format the contents of a SRAT 3443 * 3444 ******************************************************************************/ 3445 3446 void 3447 AcpiDmDumpSrat ( 3448 ACPI_TABLE_HEADER *Table) 3449 { 3450 ACPI_STATUS Status; 3451 UINT32 Offset = sizeof (ACPI_TABLE_SRAT); 3452 ACPI_SUBTABLE_HEADER *SubTable; 3453 ACPI_DMTABLE_INFO *InfoTable; 3454 3455 3456 /* Main table */ 3457 3458 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat); 3459 if (ACPI_FAILURE (Status)) 3460 { 3461 return; 3462 } 3463 3464 /* Subtables */ 3465 3466 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); 3467 while (Offset < Table->Length) 3468 { 3469 /* Common subtable header */ 3470 3471 AcpiOsPrintf ("\n"); 3472 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 3473 SubTable->Length, AcpiDmTableInfoSratHdr); 3474 if (ACPI_FAILURE (Status)) 3475 { 3476 return; 3477 } 3478 3479 switch (SubTable->Type) 3480 { 3481 case ACPI_SRAT_TYPE_CPU_AFFINITY: 3482 3483 InfoTable = AcpiDmTableInfoSrat0; 3484 break; 3485 3486 case ACPI_SRAT_TYPE_MEMORY_AFFINITY: 3487 3488 InfoTable = AcpiDmTableInfoSrat1; 3489 break; 3490 3491 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: 3492 3493 InfoTable = AcpiDmTableInfoSrat2; 3494 break; 3495 3496 case ACPI_SRAT_TYPE_GICC_AFFINITY: 3497 3498 InfoTable = AcpiDmTableInfoSrat3; 3499 break; 3500 3501 default: 3502 AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", 3503 SubTable->Type); 3504 3505 /* Attempt to continue */ 3506 3507 if (!SubTable->Length) 3508 { 3509 AcpiOsPrintf ("Invalid zero length subtable\n"); 3510 return; 3511 } 3512 goto NextSubTable; 3513 } 3514 3515 AcpiOsPrintf ("\n"); 3516 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 3517 SubTable->Length, InfoTable); 3518 if (ACPI_FAILURE (Status)) 3519 { 3520 return; 3521 } 3522 3523 NextSubTable: 3524 /* Point to next subtable */ 3525 3526 Offset += SubTable->Length; 3527 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, 3528 SubTable->Length); 3529 } 3530 } 3531 3532 3533 /******************************************************************************* 3534 * 3535 * FUNCTION: AcpiDmDumpStao 3536 * 3537 * PARAMETERS: Table - A STAO table 3538 * 3539 * RETURN: None 3540 * 3541 * DESCRIPTION: Format the contents of a STAO. This is a variable-length 3542 * table that contains an open-ended number of ASCII strings 3543 * at the end of the table. 3544 * 3545 ******************************************************************************/ 3546 3547 void 3548 AcpiDmDumpStao ( 3549 ACPI_TABLE_HEADER *Table) 3550 { 3551 ACPI_STATUS Status; 3552 char *Namepath; 3553 UINT32 Length = Table->Length; 3554 UINT32 StringLength; 3555 UINT32 Offset = sizeof (ACPI_TABLE_STAO); 3556 3557 3558 /* Main table */ 3559 3560 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao); 3561 if (ACPI_FAILURE (Status)) 3562 { 3563 return; 3564 } 3565 3566 /* The rest of the table consists of Namepath strings */ 3567 3568 while (Offset < Table->Length) 3569 { 3570 Namepath = ACPI_ADD_PTR (char, Table, Offset); 3571 StringLength = strlen (Namepath) + 1; 3572 3573 AcpiDmLineHeader (Offset, StringLength, "Namestring"); 3574 AcpiOsPrintf ("\"%s\"\n", Namepath); 3575 3576 /* Point to next namepath */ 3577 3578 Offset += StringLength; 3579 } 3580 } 3581 3582 3583 /******************************************************************************* 3584 * 3585 * FUNCTION: AcpiDmDumpTcpa 3586 * 3587 * PARAMETERS: Table - A TCPA table 3588 * 3589 * RETURN: None 3590 * 3591 * DESCRIPTION: Format the contents of a TCPA. 3592 * 3593 * NOTE: There are two versions of the table with the same signature: 3594 * the client version and the server version. The common 3595 * PlatformClass field is used to differentiate the two types of 3596 * tables. 3597 * 3598 ******************************************************************************/ 3599 3600 void 3601 AcpiDmDumpTcpa ( 3602 ACPI_TABLE_HEADER *Table) 3603 { 3604 UINT32 Offset = sizeof (ACPI_TABLE_TCPA_HDR); 3605 ACPI_TABLE_TCPA_HDR *CommonHeader = ACPI_CAST_PTR ( 3606 ACPI_TABLE_TCPA_HDR, Table); 3607 ACPI_TABLE_TCPA_HDR *SubTable = ACPI_ADD_PTR ( 3608 ACPI_TABLE_TCPA_HDR, Table, Offset); 3609 ACPI_STATUS Status; 3610 3611 3612 /* Main table */ 3613 3614 Status = AcpiDmDumpTable (Table->Length, 0, Table, 3615 0, AcpiDmTableInfoTcpaHdr); 3616 if (ACPI_FAILURE (Status)) 3617 { 3618 return; 3619 } 3620 3621 /* 3622 * Examine the PlatformClass field to determine the table type. 3623 * Either a client or server table. Only one. 3624 */ 3625 switch (CommonHeader->PlatformClass) 3626 { 3627 case ACPI_TCPA_CLIENT_TABLE: 3628 3629 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 3630 Table->Length - Offset, AcpiDmTableInfoTcpaClient); 3631 break; 3632 3633 case ACPI_TCPA_SERVER_TABLE: 3634 3635 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 3636 Table->Length - Offset, AcpiDmTableInfoTcpaServer); 3637 break; 3638 3639 default: 3640 3641 AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n", 3642 CommonHeader->PlatformClass); 3643 Status = AE_ERROR; 3644 break; 3645 } 3646 3647 if (ACPI_FAILURE (Status)) 3648 { 3649 AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n"); 3650 } 3651 } 3652 3653 3654 /******************************************************************************* 3655 * 3656 * FUNCTION: AcpiDmDumpVrtc 3657 * 3658 * PARAMETERS: Table - A VRTC table 3659 * 3660 * RETURN: None 3661 * 3662 * DESCRIPTION: Format the contents of a VRTC 3663 * 3664 ******************************************************************************/ 3665 3666 void 3667 AcpiDmDumpVrtc ( 3668 ACPI_TABLE_HEADER *Table) 3669 { 3670 ACPI_STATUS Status; 3671 UINT32 Offset = sizeof (ACPI_TABLE_VRTC); 3672 ACPI_VRTC_ENTRY *SubTable; 3673 3674 3675 /* Main table */ 3676 3677 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc); 3678 if (ACPI_FAILURE (Status)) 3679 { 3680 return; 3681 } 3682 3683 /* Subtables */ 3684 3685 SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset); 3686 while (Offset < Table->Length) 3687 { 3688 /* Common subtable header */ 3689 3690 AcpiOsPrintf ("\n"); 3691 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 3692 sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0); 3693 if (ACPI_FAILURE (Status)) 3694 { 3695 return; 3696 } 3697 3698 /* Point to next subtable */ 3699 3700 Offset += sizeof (ACPI_VRTC_ENTRY); 3701 SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, 3702 sizeof (ACPI_VRTC_ENTRY)); 3703 } 3704 } 3705 3706 3707 /******************************************************************************* 3708 * 3709 * FUNCTION: AcpiDmDumpWdat 3710 * 3711 * PARAMETERS: Table - A WDAT table 3712 * 3713 * RETURN: None 3714 * 3715 * DESCRIPTION: Format the contents of a WDAT 3716 * 3717 ******************************************************************************/ 3718 3719 void 3720 AcpiDmDumpWdat ( 3721 ACPI_TABLE_HEADER *Table) 3722 { 3723 ACPI_STATUS Status; 3724 UINT32 Offset = sizeof (ACPI_TABLE_WDAT); 3725 ACPI_WDAT_ENTRY *SubTable; 3726 3727 3728 /* Main table */ 3729 3730 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat); 3731 if (ACPI_FAILURE (Status)) 3732 { 3733 return; 3734 } 3735 3736 /* Subtables */ 3737 3738 SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset); 3739 while (Offset < Table->Length) 3740 { 3741 /* Common subtable header */ 3742 3743 AcpiOsPrintf ("\n"); 3744 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, 3745 sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0); 3746 if (ACPI_FAILURE (Status)) 3747 { 3748 return; 3749 } 3750 3751 /* Point to next subtable */ 3752 3753 Offset += sizeof (ACPI_WDAT_ENTRY); 3754 SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, 3755 sizeof (ACPI_WDAT_ENTRY)); 3756 } 3757 } 3758 3759 3760 /******************************************************************************* 3761 * 3762 * FUNCTION: AcpiDmDumpWpbt 3763 * 3764 * PARAMETERS: Table - A WPBT table 3765 * 3766 * RETURN: None 3767 * 3768 * DESCRIPTION: Format the contents of a WPBT. This table type consists 3769 * of an open-ended arguments buffer at the end of the table. 3770 * 3771 ******************************************************************************/ 3772 3773 void 3774 AcpiDmDumpWpbt ( 3775 ACPI_TABLE_HEADER *Table) 3776 { 3777 ACPI_STATUS Status; 3778 ACPI_TABLE_WPBT *SubTable; 3779 UINT32 Length = Table->Length; 3780 UINT16 ArgumentsLength; 3781 3782 3783 /* Dump the main table */ 3784 3785 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt); 3786 if (ACPI_FAILURE (Status)) 3787 { 3788 return; 3789 } 3790 3791 /* Extract the arguments buffer length from the main table */ 3792 3793 SubTable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table); 3794 ArgumentsLength = SubTable->ArgumentsLength; 3795 3796 /* Dump the arguments buffer */ 3797 3798 (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength, 3799 AcpiDmTableInfoWpbt0); 3800 } 3801