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