1 /******************************************************************************
3 * Module Name: dmtbdump - Dump ACPI data tables that contain no AML code
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
117 #include "accommon.h"
118 #include "acdisasm.h"
119 #include "actables.h"
121 /* This module used for application-level code only */
123 #define _COMPONENT ACPI_CA_DISASSEMBLER
124 ACPI_MODULE_NAME ("dmtbdump")
127 /*******************************************************************************
129 * FUNCTION: AcpiDmDumpRsdp
131 * PARAMETERS: Table - A RSDP
133 * RETURN: Length of the table (there is no length field, use revision)
135 * DESCRIPTION: Format the contents of a RSDP
137 ******************************************************************************/
141 ACPI_TABLE_HEADER *Table)
143 UINT32 Length = ACPI_RSDP_REV0_SIZE;
146 /* Dump the common ACPI 1.0 portion */
148 AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
150 /* ACPI 2.0+ contains more data and has a Length field */
152 if (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Revision > 0)
154 Length = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Length;
155 AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
162 /*******************************************************************************
164 * FUNCTION: AcpiDmDumpRsdt
166 * PARAMETERS: Table - A RSDT
170 * DESCRIPTION: Format the contents of a RSDT
172 ******************************************************************************/
176 ACPI_TABLE_HEADER *Table)
184 /* Point to start of table pointer array */
186 Array = ACPI_CAST_PTR (ACPI_TABLE_RSDT, Table)->TableOffsetEntry;
187 Offset = sizeof (ACPI_TABLE_HEADER);
189 /* RSDT uses 32-bit pointers */
191 Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
193 for (i = 0; i < Entries; i++)
195 AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
196 AcpiOsPrintf ("%8.8X\n", Array[i]);
197 Offset += sizeof (UINT32);
202 /*******************************************************************************
204 * FUNCTION: AcpiDmDumpXsdt
206 * PARAMETERS: Table - A XSDT
210 * DESCRIPTION: Format the contents of a XSDT
212 ******************************************************************************/
216 ACPI_TABLE_HEADER *Table)
224 /* Point to start of table pointer array */
226 Array = ACPI_CAST_PTR (ACPI_TABLE_XSDT, Table)->TableOffsetEntry;
227 Offset = sizeof (ACPI_TABLE_HEADER);
229 /* XSDT uses 64-bit pointers */
231 Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
233 for (i = 0; i < Entries; i++)
235 AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
236 AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
237 Offset += sizeof (UINT64);
242 /*******************************************************************************
244 * FUNCTION: AcpiDmDumpFadt
246 * PARAMETERS: Table - A FADT
250 * DESCRIPTION: Format the contents of a FADT
252 ******************************************************************************/
256 ACPI_TABLE_HEADER *Table)
259 /* Common ACPI 1.0 portion of FADT */
261 AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
263 /* Check for ACPI 1.0B MS extensions (FADT revision 2) */
265 if (Table->Revision == 2)
267 AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
270 /* Check for ACPI 2.0+ extended data (FADT revision 3+) */
272 else if (Table->Length >= sizeof (ACPI_TABLE_FADT))
274 AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
277 /* Validate various fields in the FADT, including length */
279 AcpiTbCreateLocalFadt (Table, Table->Length);
283 /*******************************************************************************
285 * FUNCTION: AcpiDmDumpAsf
287 * PARAMETERS: Table - A ASF table
291 * DESCRIPTION: Format the contents of a ASF table
293 ******************************************************************************/
297 ACPI_TABLE_HEADER *Table)
300 UINT32 Offset = sizeof (ACPI_TABLE_HEADER);
301 ACPI_ASF_INFO *SubTable;
302 ACPI_DMTABLE_INFO *InfoTable;
303 ACPI_DMTABLE_INFO *DataInfoTable = NULL;
304 UINT8 *DataTable = NULL;
305 UINT32 DataCount = 0;
306 UINT32 DataLength = 0;
307 UINT32 DataOffset = 0;
311 /* No main table, only sub-tables */
313 SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
314 while (Offset < Table->Length)
316 /* Common sub-table header */
318 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
319 SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
320 if (ACPI_FAILURE (Status))
325 switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
327 case ACPI_ASF_TYPE_INFO:
328 InfoTable = AcpiDmTableInfoAsf0;
331 case ACPI_ASF_TYPE_ALERT:
332 InfoTable = AcpiDmTableInfoAsf1;
333 DataInfoTable = AcpiDmTableInfoAsf1a;
334 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
335 DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts;
336 DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength;
337 DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
340 case ACPI_ASF_TYPE_CONTROL:
341 InfoTable = AcpiDmTableInfoAsf2;
342 DataInfoTable = AcpiDmTableInfoAsf2a;
343 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
344 DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls;
345 DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength;
346 DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
349 case ACPI_ASF_TYPE_BOOT:
350 InfoTable = AcpiDmTableInfoAsf3;
353 case ACPI_ASF_TYPE_ADDRESS:
354 InfoTable = AcpiDmTableInfoAsf4;
355 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
356 DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices;
357 DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
361 AcpiOsPrintf ("\n**** Unknown ASF sub-table type %X\n", SubTable->Header.Type);
365 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
366 SubTable->Header.Length, InfoTable);
367 if (ACPI_FAILURE (Status))
372 /* Dump variable-length extra data */
374 switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
376 case ACPI_ASF_TYPE_ALERT:
377 case ACPI_ASF_TYPE_CONTROL:
379 for (i = 0; i < DataCount; i++)
382 Status = AcpiDmDumpTable (Table->Length, DataOffset,
383 DataTable, DataLength, DataInfoTable);
384 if (ACPI_FAILURE (Status))
389 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
390 DataOffset += DataLength;
394 case ACPI_ASF_TYPE_ADDRESS:
396 for (i = 0; i < DataLength; i++)
400 AcpiDmLineHeader (DataOffset, 1, "Addresses");
403 AcpiOsPrintf ("%2.2X ", *DataTable);
406 if (DataOffset > Table->Length)
408 AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
422 /* Point to next sub-table */
424 if (!SubTable->Header.Length)
426 AcpiOsPrintf ("Invalid zero subtable header length\n");
430 Offset += SubTable->Header.Length;
431 SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubTable->Header.Length);
436 /*******************************************************************************
438 * FUNCTION: AcpiDmDumpCpep
440 * PARAMETERS: Table - A CPEP table
444 * DESCRIPTION: Format the contents of a CPEP. This table type consists
445 * of an open-ended number of subtables.
447 ******************************************************************************/
451 ACPI_TABLE_HEADER *Table)
454 ACPI_CPEP_POLLING *SubTable;
455 UINT32 Length = Table->Length;
456 UINT32 Offset = sizeof (ACPI_TABLE_CPEP);
461 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
462 if (ACPI_FAILURE (Status))
469 SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
470 while (Offset < Table->Length)
473 Status = AcpiDmDumpTable (Length, Offset, SubTable,
474 SubTable->Length, AcpiDmTableInfoCpep0);
475 if (ACPI_FAILURE (Status))
480 /* Point to next sub-table */
482 Offset += SubTable->Length;
483 SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, SubTable->Length);
488 /*******************************************************************************
490 * FUNCTION: AcpiDmDumpDmar
492 * PARAMETERS: Table - A DMAR table
496 * DESCRIPTION: Format the contents of a DMAR. This table type consists
497 * of an open-ended number of subtables.
499 ******************************************************************************/
503 ACPI_TABLE_HEADER *Table)
506 ACPI_DMAR_HEADER *SubTable;
507 UINT32 Length = Table->Length;
508 UINT32 Offset = sizeof (ACPI_TABLE_DMAR);
509 ACPI_DMTABLE_INFO *InfoTable;
510 ACPI_DMAR_DEVICE_SCOPE *ScopeTable;
518 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
519 if (ACPI_FAILURE (Status))
526 SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
527 while (Offset < Table->Length)
529 /* Common sub-table header */
532 Status = AcpiDmDumpTable (Length, Offset, SubTable,
533 SubTable->Length, AcpiDmTableInfoDmarHdr);
534 if (ACPI_FAILURE (Status))
539 switch (SubTable->Type)
541 case ACPI_DMAR_TYPE_HARDWARE_UNIT:
542 InfoTable = AcpiDmTableInfoDmar0;
543 ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
545 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
546 InfoTable = AcpiDmTableInfoDmar1;
547 ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
549 case ACPI_DMAR_TYPE_ATSR:
550 InfoTable = AcpiDmTableInfoDmar2;
551 ScopeOffset = sizeof (ACPI_DMAR_ATSR);
554 AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type);
558 Status = AcpiDmDumpTable (Length, Offset, SubTable,
559 SubTable->Length, InfoTable);
560 if (ACPI_FAILURE (Status))
565 /* Dump the device scope entries (if any) */
567 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
568 while (ScopeOffset < SubTable->Length)
571 Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
572 ScopeTable->Length, AcpiDmTableInfoDmarScope);
573 if (ACPI_FAILURE (Status))
578 /* Dump the PCI Path entries for this device scope */
580 PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
582 PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
583 sizeof (ACPI_DMAR_DEVICE_SCOPE));
585 while (PathOffset < ScopeTable->Length)
587 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
588 AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
590 /* Point to next PCI Path entry */
596 /* Point to next device scope entry */
598 ScopeOffset += ScopeTable->Length;
599 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
600 ScopeTable, ScopeTable->Length);
603 /* Point to next sub-table */
605 Offset += SubTable->Length;
606 SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
611 /*******************************************************************************
613 * FUNCTION: AcpiDmDumpEinj
615 * PARAMETERS: Table - A EINJ table
619 * DESCRIPTION: Format the contents of a EINJ. This table type consists
620 * of an open-ended number of subtables.
622 ******************************************************************************/
626 ACPI_TABLE_HEADER *Table)
629 ACPI_WHEA_HEADER *SubTable;
630 UINT32 Length = Table->Length;
631 UINT32 Offset = sizeof (ACPI_TABLE_EINJ);
636 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
637 if (ACPI_FAILURE (Status))
644 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
645 while (Offset < Table->Length)
648 Status = AcpiDmDumpTable (Length, Offset, SubTable,
649 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
650 if (ACPI_FAILURE (Status))
655 /* Point to next sub-table (each subtable is of fixed length) */
657 Offset += sizeof (ACPI_WHEA_HEADER);
658 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
659 sizeof (ACPI_WHEA_HEADER));
664 /*******************************************************************************
666 * FUNCTION: AcpiDmDumpErst
668 * PARAMETERS: Table - A ERST table
672 * DESCRIPTION: Format the contents of a ERST. This table type consists
673 * of an open-ended number of subtables.
675 ******************************************************************************/
679 ACPI_TABLE_HEADER *Table)
682 ACPI_WHEA_HEADER *SubTable;
683 UINT32 Length = Table->Length;
684 UINT32 Offset = sizeof (ACPI_TABLE_ERST);
689 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
690 if (ACPI_FAILURE (Status))
697 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
698 while (Offset < Table->Length)
701 Status = AcpiDmDumpTable (Length, Offset, SubTable,
702 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
703 if (ACPI_FAILURE (Status))
708 /* Point to next sub-table (each subtable is of fixed length) */
710 Offset += sizeof (ACPI_WHEA_HEADER);
711 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
712 sizeof (ACPI_WHEA_HEADER));
717 /*******************************************************************************
719 * FUNCTION: AcpiDmDumpHest
721 * PARAMETERS: Table - A HEST table
725 * DESCRIPTION: Format the contents of a HEST. This table type consists
726 * of an open-ended number of subtables.
728 ******************************************************************************/
732 ACPI_TABLE_HEADER *Table)
735 ACPI_HEST_HEADER *SubTable;
736 UINT32 Length = Table->Length;
737 UINT32 Offset = sizeof (ACPI_TABLE_HEST);
738 ACPI_DMTABLE_INFO *InfoTable;
739 UINT32 SubTableLength;
744 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
745 if (ACPI_FAILURE (Status))
752 SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
753 while (Offset < Table->Length)
755 switch (SubTable->Type)
757 case ACPI_HEST_TYPE_XPF_MACHINE_CHECK:
758 InfoTable = AcpiDmTableInfoHest0;
759 SubTableLength = sizeof (ACPI_HEST_XPF_MACHINE_CHECK);
762 case ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK:
763 InfoTable = AcpiDmTableInfoHest1;
764 SubTableLength = sizeof (ACPI_HEST_XPF_CORRECTED);
767 case ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT:
768 InfoTable = AcpiDmTableInfoHest3;
769 SubTableLength = sizeof (ACPI_HEST_XPF_NMI);
772 case ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK:
773 InfoTable = AcpiDmTableInfoHest4;
774 SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED);
777 case ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR:
778 InfoTable = AcpiDmTableInfoHest5;
779 SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED_PLATFORM);
782 case ACPI_HEST_TYPE_AER_ROOT_PORT:
783 InfoTable = AcpiDmTableInfoHest6;
784 SubTableLength = sizeof (ACPI_HEST_AER_ROOT);
787 case ACPI_HEST_TYPE_AER_ENDPOINT:
788 InfoTable = AcpiDmTableInfoHest7;
789 SubTableLength = sizeof (ACPI_HEST_AER);
792 case ACPI_HEST_TYPE_AER_BRIDGE:
793 InfoTable = AcpiDmTableInfoHest8;
794 SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE);
797 case ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE:
798 InfoTable = AcpiDmTableInfoHest9;
799 SubTableLength = sizeof (ACPI_HEST_GENERIC);
803 /* Cannot continue on unknown type - no length */
805 AcpiOsPrintf ("\n**** Unknown HEST sub-table type %X\n", SubTable->Type);
810 Status = AcpiDmDumpTable (Length, Offset, SubTable,
811 SubTableLength, InfoTable);
812 if (ACPI_FAILURE (Status))
817 /* Point to next sub-table (each subtable is of fixed length) */
819 Offset += SubTableLength;
820 SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
825 /*******************************************************************************
827 * FUNCTION: AcpiDmDumpMadt
829 * PARAMETERS: Table - A MADT table
833 * DESCRIPTION: Format the contents of a MADT. This table type consists
834 * of an open-ended number of subtables.
836 ******************************************************************************/
840 ACPI_TABLE_HEADER *Table)
843 ACPI_SUBTABLE_HEADER *SubTable;
844 UINT32 Length = Table->Length;
845 UINT32 Offset = sizeof (ACPI_TABLE_MADT);
846 ACPI_DMTABLE_INFO *InfoTable;
851 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
852 if (ACPI_FAILURE (Status))
859 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
860 while (Offset < Table->Length)
862 /* Common sub-table header */
865 Status = AcpiDmDumpTable (Length, Offset, SubTable,
866 SubTable->Length, AcpiDmTableInfoMadtHdr);
867 if (ACPI_FAILURE (Status))
872 switch (SubTable->Type)
874 case ACPI_MADT_TYPE_LOCAL_APIC:
875 InfoTable = AcpiDmTableInfoMadt0;
877 case ACPI_MADT_TYPE_IO_APIC:
878 InfoTable = AcpiDmTableInfoMadt1;
880 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
881 InfoTable = AcpiDmTableInfoMadt2;
883 case ACPI_MADT_TYPE_NMI_SOURCE:
884 InfoTable = AcpiDmTableInfoMadt3;
886 case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
887 InfoTable = AcpiDmTableInfoMadt4;
889 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
890 InfoTable = AcpiDmTableInfoMadt5;
892 case ACPI_MADT_TYPE_IO_SAPIC:
893 InfoTable = AcpiDmTableInfoMadt6;
895 case ACPI_MADT_TYPE_LOCAL_SAPIC:
896 InfoTable = AcpiDmTableInfoMadt7;
898 case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
899 InfoTable = AcpiDmTableInfoMadt8;
901 case ACPI_MADT_TYPE_LOCAL_X2APIC:
902 InfoTable = AcpiDmTableInfoMadt9;
904 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
905 InfoTable = AcpiDmTableInfoMadt10;
908 AcpiOsPrintf ("\n**** Unknown MADT sub-table type %X\n\n", SubTable->Type);
910 /* Attempt to continue */
912 if (!SubTable->Length)
914 AcpiOsPrintf ("Invalid zero length subtable\n");
920 Status = AcpiDmDumpTable (Length, Offset, SubTable,
921 SubTable->Length, InfoTable);
922 if (ACPI_FAILURE (Status))
928 /* Point to next sub-table */
930 Offset += SubTable->Length;
931 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
936 /*******************************************************************************
938 * FUNCTION: AcpiDmDumpMcfg
940 * PARAMETERS: Table - A MCFG Table
944 * DESCRIPTION: Format the contents of a MCFG table
946 ******************************************************************************/
950 ACPI_TABLE_HEADER *Table)
953 UINT32 Offset = sizeof (ACPI_TABLE_MCFG);
954 ACPI_MCFG_ALLOCATION *SubTable;
959 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
960 if (ACPI_FAILURE (Status))
967 SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
968 while (Offset < Table->Length)
970 if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
972 AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n",
973 sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
978 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
979 sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
980 if (ACPI_FAILURE (Status))
985 /* Point to next sub-table (each subtable is of fixed length) */
987 Offset += sizeof (ACPI_MCFG_ALLOCATION);
988 SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
989 sizeof (ACPI_MCFG_ALLOCATION));
994 /*******************************************************************************
996 * FUNCTION: AcpiDmDumpSlit
998 * PARAMETERS: Table - An SLIT
1002 * DESCRIPTION: Format the contents of a SLIT
1004 ******************************************************************************/
1008 ACPI_TABLE_HEADER *Table)
1020 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
1021 if (ACPI_FAILURE (Status))
1026 /* Display the Locality NxN Matrix */
1028 Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
1029 Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
1030 Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
1032 for (i = 0; i < Localities; i++)
1034 /* Display one row of the matrix */
1036 AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
1037 for (j = 0; j < Localities; j++)
1039 /* Check for beyond EOT */
1041 if (Offset >= Table->Length)
1043 AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
1047 AcpiOsPrintf ("%2.2X ", Row[j]);
1050 /* Display up to 16 bytes per output row */
1052 if (j && (((j+1) % 16) == 0) && ((j+1) < Localities))
1054 AcpiOsPrintf ("\n");
1055 AcpiDmLineHeader (Offset, 0, "");
1059 /* Point to next row */
1061 AcpiOsPrintf ("\n");
1067 /*******************************************************************************
1069 * FUNCTION: AcpiDmDumpSrat
1071 * PARAMETERS: Table - A SRAT table
1075 * DESCRIPTION: Format the contents of a SRAT
1077 ******************************************************************************/
1081 ACPI_TABLE_HEADER *Table)
1084 UINT32 Offset = sizeof (ACPI_TABLE_SRAT);
1085 ACPI_SUBTABLE_HEADER *SubTable;
1086 ACPI_DMTABLE_INFO *InfoTable;
1091 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
1092 if (ACPI_FAILURE (Status))
1099 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
1100 while (Offset < Table->Length)
1102 /* Common sub-table header */
1104 AcpiOsPrintf ("\n");
1105 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1106 SubTable->Length, AcpiDmTableInfoSratHdr);
1107 if (ACPI_FAILURE (Status))
1112 switch (SubTable->Type)
1114 case ACPI_SRAT_TYPE_CPU_AFFINITY:
1115 InfoTable = AcpiDmTableInfoSrat0;
1117 case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
1118 InfoTable = AcpiDmTableInfoSrat1;
1120 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
1121 InfoTable = AcpiDmTableInfoSrat2;
1124 AcpiOsPrintf ("\n**** Unknown SRAT sub-table type %X\n", SubTable->Type);
1126 /* Attempt to continue */
1128 if (!SubTable->Length)
1130 AcpiOsPrintf ("Invalid zero length subtable\n");
1136 AcpiOsPrintf ("\n");
1137 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1138 SubTable->Length, InfoTable);
1139 if (ACPI_FAILURE (Status))
1145 /* Point to next sub-table */
1147 Offset += SubTable->Length;
1148 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);