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