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 - 2010, 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 *****************************************************************************/
116 #include <contrib/dev/acpica/include/acpi.h>
117 #include <contrib/dev/acpica/include/accommon.h>
118 #include <contrib/dev/acpica/include/acdisasm.h>
119 #include <contrib/dev/acpica/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;
312 /* No main table, only sub-tables */
314 SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
315 while (Offset < Table->Length)
317 /* Common sub-table header */
319 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
320 SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
321 if (ACPI_FAILURE (Status))
326 /* The actual type is the lower 7 bits of Type */
328 Type = (UINT8) (SubTable->Header.Type & 0x7F);
332 case ACPI_ASF_TYPE_INFO:
333 InfoTable = AcpiDmTableInfoAsf0;
336 case ACPI_ASF_TYPE_ALERT:
337 InfoTable = AcpiDmTableInfoAsf1;
338 DataInfoTable = AcpiDmTableInfoAsf1a;
339 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
340 DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts;
341 DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength;
342 DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
345 case ACPI_ASF_TYPE_CONTROL:
346 InfoTable = AcpiDmTableInfoAsf2;
347 DataInfoTable = AcpiDmTableInfoAsf2a;
348 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
349 DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls;
350 DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength;
351 DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
354 case ACPI_ASF_TYPE_BOOT:
355 InfoTable = AcpiDmTableInfoAsf3;
358 case ACPI_ASF_TYPE_ADDRESS:
359 InfoTable = AcpiDmTableInfoAsf4;
360 DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
361 DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices;
362 DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
366 AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type);
370 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
371 SubTable->Header.Length, InfoTable);
372 if (ACPI_FAILURE (Status))
377 /* Dump variable-length extra data */
381 case ACPI_ASF_TYPE_ALERT:
382 case ACPI_ASF_TYPE_CONTROL:
384 for (i = 0; i < DataCount; i++)
387 Status = AcpiDmDumpTable (Table->Length, DataOffset,
388 DataTable, DataLength, DataInfoTable);
389 if (ACPI_FAILURE (Status))
394 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
395 DataOffset += DataLength;
399 case ACPI_ASF_TYPE_ADDRESS:
401 for (i = 0; i < DataLength; i++)
405 AcpiDmLineHeader (DataOffset, 1, "Addresses");
408 AcpiOsPrintf ("%2.2X ", *DataTable);
411 if (DataOffset > Table->Length)
413 AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
427 /* Point to next sub-table */
429 if (!SubTable->Header.Length)
431 AcpiOsPrintf ("Invalid zero subtable header length\n");
435 Offset += SubTable->Header.Length;
436 SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubTable->Header.Length);
441 /*******************************************************************************
443 * FUNCTION: AcpiDmDumpCpep
445 * PARAMETERS: Table - A CPEP table
449 * DESCRIPTION: Format the contents of a CPEP. This table type consists
450 * of an open-ended number of subtables.
452 ******************************************************************************/
456 ACPI_TABLE_HEADER *Table)
459 ACPI_CPEP_POLLING *SubTable;
460 UINT32 Length = Table->Length;
461 UINT32 Offset = sizeof (ACPI_TABLE_CPEP);
466 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
467 if (ACPI_FAILURE (Status))
474 SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
475 while (Offset < Table->Length)
478 Status = AcpiDmDumpTable (Length, Offset, SubTable,
479 SubTable->Header.Length, AcpiDmTableInfoCpep0);
480 if (ACPI_FAILURE (Status))
485 /* Point to next sub-table */
487 Offset += SubTable->Header.Length;
488 SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
489 SubTable->Header.Length);
494 /*******************************************************************************
496 * FUNCTION: AcpiDmDumpDmar
498 * PARAMETERS: Table - A DMAR table
502 * DESCRIPTION: Format the contents of a DMAR. This table type consists
503 * of an open-ended number of subtables.
505 ******************************************************************************/
509 ACPI_TABLE_HEADER *Table)
512 ACPI_DMAR_HEADER *SubTable;
513 UINT32 Length = Table->Length;
514 UINT32 Offset = sizeof (ACPI_TABLE_DMAR);
515 ACPI_DMTABLE_INFO *InfoTable;
516 ACPI_DMAR_DEVICE_SCOPE *ScopeTable;
524 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
525 if (ACPI_FAILURE (Status))
532 SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
533 while (Offset < Table->Length)
535 /* Common sub-table header */
538 Status = AcpiDmDumpTable (Length, Offset, SubTable,
539 SubTable->Length, AcpiDmTableInfoDmarHdr);
540 if (ACPI_FAILURE (Status))
545 switch (SubTable->Type)
547 case ACPI_DMAR_TYPE_HARDWARE_UNIT:
548 InfoTable = AcpiDmTableInfoDmar0;
549 ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
551 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
552 InfoTable = AcpiDmTableInfoDmar1;
553 ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
555 case ACPI_DMAR_TYPE_ATSR:
556 InfoTable = AcpiDmTableInfoDmar2;
557 ScopeOffset = sizeof (ACPI_DMAR_ATSR);
559 case ACPI_DMAR_HARDWARE_AFFINITY:
560 InfoTable = AcpiDmTableInfoDmar3;
561 ScopeOffset = sizeof (ACPI_DMAR_RHSA);
564 AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type);
568 Status = AcpiDmDumpTable (Length, Offset, SubTable,
569 SubTable->Length, InfoTable);
570 if (ACPI_FAILURE (Status))
575 /* Dump the device scope entries (if any) */
577 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
578 while (ScopeOffset < SubTable->Length)
581 Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
582 ScopeTable->Length, AcpiDmTableInfoDmarScope);
583 if (ACPI_FAILURE (Status))
588 /* Dump the PCI Path entries for this device scope */
590 PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
592 PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
593 sizeof (ACPI_DMAR_DEVICE_SCOPE));
595 while (PathOffset < ScopeTable->Length)
597 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
598 AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
600 /* Point to next PCI Path entry */
606 /* Point to next device scope entry */
608 ScopeOffset += ScopeTable->Length;
609 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
610 ScopeTable, ScopeTable->Length);
613 /* Point to next sub-table */
615 Offset += SubTable->Length;
616 SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
621 /*******************************************************************************
623 * FUNCTION: AcpiDmDumpEinj
625 * PARAMETERS: Table - A EINJ table
629 * DESCRIPTION: Format the contents of a EINJ. This table type consists
630 * of an open-ended number of subtables.
632 ******************************************************************************/
636 ACPI_TABLE_HEADER *Table)
639 ACPI_WHEA_HEADER *SubTable;
640 UINT32 Length = Table->Length;
641 UINT32 Offset = sizeof (ACPI_TABLE_EINJ);
646 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
647 if (ACPI_FAILURE (Status))
654 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
655 while (Offset < Table->Length)
658 Status = AcpiDmDumpTable (Length, Offset, SubTable,
659 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
660 if (ACPI_FAILURE (Status))
665 /* Point to next sub-table (each subtable is of fixed length) */
667 Offset += sizeof (ACPI_WHEA_HEADER);
668 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
669 sizeof (ACPI_WHEA_HEADER));
674 /*******************************************************************************
676 * FUNCTION: AcpiDmDumpErst
678 * PARAMETERS: Table - A ERST table
682 * DESCRIPTION: Format the contents of a ERST. This table type consists
683 * of an open-ended number of subtables.
685 ******************************************************************************/
689 ACPI_TABLE_HEADER *Table)
692 ACPI_WHEA_HEADER *SubTable;
693 UINT32 Length = Table->Length;
694 UINT32 Offset = sizeof (ACPI_TABLE_ERST);
699 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
700 if (ACPI_FAILURE (Status))
707 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
708 while (Offset < Table->Length)
711 Status = AcpiDmDumpTable (Length, Offset, SubTable,
712 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
713 if (ACPI_FAILURE (Status))
718 /* Point to next sub-table (each subtable is of fixed length) */
720 Offset += sizeof (ACPI_WHEA_HEADER);
721 SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
722 sizeof (ACPI_WHEA_HEADER));
727 /*******************************************************************************
729 * FUNCTION: AcpiDmDumpHest
731 * PARAMETERS: Table - A HEST table
735 * DESCRIPTION: Format the contents of a HEST. This table type consists
736 * of an open-ended number of subtables.
738 ******************************************************************************/
742 ACPI_TABLE_HEADER *Table)
745 ACPI_HEST_HEADER *SubTable;
746 UINT32 Length = Table->Length;
747 UINT32 Offset = sizeof (ACPI_TABLE_HEST);
748 ACPI_DMTABLE_INFO *InfoTable;
749 UINT32 SubTableLength;
751 ACPI_HEST_IA_ERROR_BANK *BankTable;
756 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
757 if (ACPI_FAILURE (Status))
764 SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
765 while (Offset < Table->Length)
768 switch (SubTable->Type)
770 case ACPI_HEST_TYPE_IA32_CHECK:
771 InfoTable = AcpiDmTableInfoHest0;
772 SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
773 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
774 SubTable))->NumHardwareBanks;
777 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
778 InfoTable = AcpiDmTableInfoHest1;
779 SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
780 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
781 SubTable))->NumHardwareBanks;
784 case ACPI_HEST_TYPE_IA32_NMI:
785 InfoTable = AcpiDmTableInfoHest2;
786 SubTableLength = sizeof (ACPI_HEST_IA_NMI);
789 case ACPI_HEST_TYPE_AER_ROOT_PORT:
790 InfoTable = AcpiDmTableInfoHest6;
791 SubTableLength = sizeof (ACPI_HEST_AER_ROOT);
794 case ACPI_HEST_TYPE_AER_ENDPOINT:
795 InfoTable = AcpiDmTableInfoHest7;
796 SubTableLength = sizeof (ACPI_HEST_AER);
799 case ACPI_HEST_TYPE_AER_BRIDGE:
800 InfoTable = AcpiDmTableInfoHest8;
801 SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE);
804 case ACPI_HEST_TYPE_GENERIC_ERROR:
805 InfoTable = AcpiDmTableInfoHest9;
806 SubTableLength = sizeof (ACPI_HEST_GENERIC);
810 /* Cannot continue on unknown type - no length */
812 AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type);
817 Status = AcpiDmDumpTable (Length, Offset, SubTable,
818 SubTableLength, InfoTable);
819 if (ACPI_FAILURE (Status))
824 /* Point to end of current subtable (each subtable above is of fixed length) */
826 Offset += SubTableLength;
828 /* If there are any (fixed-length) Error Banks from above, dump them now */
832 BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength);
833 SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
838 Status = AcpiDmDumpTable (Length, Offset, BankTable,
839 sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
840 if (ACPI_FAILURE (Status))
844 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
850 /* Point to next sub-table */
852 SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
857 /*******************************************************************************
859 * FUNCTION: AcpiDmDumpIvrs
861 * PARAMETERS: Table - A IVRS table
865 * DESCRIPTION: Format the contents of a IVRS
867 ******************************************************************************/
869 static UINT8 EntrySizes[] = {4,8,16,32};
873 ACPI_TABLE_HEADER *Table)
876 UINT32 Offset = sizeof (ACPI_TABLE_IVRS);
880 ACPI_IVRS_DE_HEADER *DeviceEntry;
881 ACPI_IVRS_HEADER *SubTable;
882 ACPI_DMTABLE_INFO *InfoTable;
887 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
888 if (ACPI_FAILURE (Status))
895 SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
896 while (Offset < Table->Length)
898 /* Common sub-table header */
901 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
902 SubTable->Length, AcpiDmTableInfoIvrsHdr);
903 if (ACPI_FAILURE (Status))
908 switch (SubTable->Type)
910 case ACPI_IVRS_TYPE_HARDWARE:
911 InfoTable = AcpiDmTableInfoIvrs0;
913 case ACPI_IVRS_TYPE_MEMORY1:
914 case ACPI_IVRS_TYPE_MEMORY2:
915 case ACPI_IVRS_TYPE_MEMORY3:
916 InfoTable = AcpiDmTableInfoIvrs1;
919 AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n",
922 /* Attempt to continue */
924 if (!SubTable->Length)
926 AcpiOsPrintf ("Invalid zero length subtable\n");
932 /* Dump the subtable */
935 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
936 SubTable->Length, InfoTable);
937 if (ACPI_FAILURE (Status))
942 /* The hardware subtable can contain multiple device entries */
944 if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE)
946 EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
947 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
948 sizeof (ACPI_IVRS_HARDWARE));
950 while (EntryOffset < (Offset + SubTable->Length))
954 * Upper 2 bits of Type encode the length of the device entry
958 * 10 = 16 byte - currently no entries defined
959 * 11 = 32 byte - currently no entries defined
961 EntryType = DeviceEntry->Type;
962 EntryLength = EntrySizes [EntryType >> 6];
966 /* 4-byte device entries */
968 case ACPI_IVRS_TYPE_PAD4:
969 case ACPI_IVRS_TYPE_ALL:
970 case ACPI_IVRS_TYPE_SELECT:
971 case ACPI_IVRS_TYPE_START:
972 case ACPI_IVRS_TYPE_END:
974 InfoTable = AcpiDmTableInfoIvrs4;
977 /* 8-byte entries, type A */
979 case ACPI_IVRS_TYPE_ALIAS_SELECT:
980 case ACPI_IVRS_TYPE_ALIAS_START:
982 InfoTable = AcpiDmTableInfoIvrs8a;
985 /* 8-byte entries, type B */
987 case ACPI_IVRS_TYPE_PAD8:
988 case ACPI_IVRS_TYPE_EXT_SELECT:
989 case ACPI_IVRS_TYPE_EXT_START:
991 InfoTable = AcpiDmTableInfoIvrs8b;
994 /* 8-byte entries, type C */
996 case ACPI_IVRS_TYPE_SPECIAL:
998 InfoTable = AcpiDmTableInfoIvrs8c;
1002 InfoTable = AcpiDmTableInfoIvrs4;
1004 "\n**** Unknown IVRS device entry type/length: "
1005 "0x%.2X/0x%X at offset 0x%.4X: (header below)\n",
1006 EntryType, EntryLength, EntryOffset);
1010 /* Dump the Device Entry */
1012 Status = AcpiDmDumpTable (Table->Length, EntryOffset,
1013 DeviceEntry, EntryLength, InfoTable);
1015 EntryOffset += EntryLength;
1016 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
1022 /* Point to next sub-table */
1024 Offset += SubTable->Length;
1025 SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
1030 /*******************************************************************************
1032 * FUNCTION: AcpiDmDumpMadt
1034 * PARAMETERS: Table - A MADT table
1038 * DESCRIPTION: Format the contents of a MADT. This table type consists
1039 * of an open-ended number of subtables.
1041 ******************************************************************************/
1045 ACPI_TABLE_HEADER *Table)
1048 ACPI_SUBTABLE_HEADER *SubTable;
1049 UINT32 Length = Table->Length;
1050 UINT32 Offset = sizeof (ACPI_TABLE_MADT);
1051 ACPI_DMTABLE_INFO *InfoTable;
1056 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
1057 if (ACPI_FAILURE (Status))
1064 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
1065 while (Offset < Table->Length)
1067 /* Common sub-table header */
1069 AcpiOsPrintf ("\n");
1070 Status = AcpiDmDumpTable (Length, Offset, SubTable,
1071 SubTable->Length, AcpiDmTableInfoMadtHdr);
1072 if (ACPI_FAILURE (Status))
1077 switch (SubTable->Type)
1079 case ACPI_MADT_TYPE_LOCAL_APIC:
1080 InfoTable = AcpiDmTableInfoMadt0;
1082 case ACPI_MADT_TYPE_IO_APIC:
1083 InfoTable = AcpiDmTableInfoMadt1;
1085 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
1086 InfoTable = AcpiDmTableInfoMadt2;
1088 case ACPI_MADT_TYPE_NMI_SOURCE:
1089 InfoTable = AcpiDmTableInfoMadt3;
1091 case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
1092 InfoTable = AcpiDmTableInfoMadt4;
1094 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
1095 InfoTable = AcpiDmTableInfoMadt5;
1097 case ACPI_MADT_TYPE_IO_SAPIC:
1098 InfoTable = AcpiDmTableInfoMadt6;
1100 case ACPI_MADT_TYPE_LOCAL_SAPIC:
1101 InfoTable = AcpiDmTableInfoMadt7;
1103 case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
1104 InfoTable = AcpiDmTableInfoMadt8;
1106 case ACPI_MADT_TYPE_LOCAL_X2APIC:
1107 InfoTable = AcpiDmTableInfoMadt9;
1109 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
1110 InfoTable = AcpiDmTableInfoMadt10;
1113 AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type);
1115 /* Attempt to continue */
1117 if (!SubTable->Length)
1119 AcpiOsPrintf ("Invalid zero length subtable\n");
1125 Status = AcpiDmDumpTable (Length, Offset, SubTable,
1126 SubTable->Length, InfoTable);
1127 if (ACPI_FAILURE (Status))
1133 /* Point to next sub-table */
1135 Offset += SubTable->Length;
1136 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
1141 /*******************************************************************************
1143 * FUNCTION: AcpiDmDumpMcfg
1145 * PARAMETERS: Table - A MCFG Table
1149 * DESCRIPTION: Format the contents of a MCFG table
1151 ******************************************************************************/
1155 ACPI_TABLE_HEADER *Table)
1158 UINT32 Offset = sizeof (ACPI_TABLE_MCFG);
1159 ACPI_MCFG_ALLOCATION *SubTable;
1164 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
1165 if (ACPI_FAILURE (Status))
1172 SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
1173 while (Offset < Table->Length)
1175 if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
1177 AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n",
1178 sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
1182 AcpiOsPrintf ("\n");
1183 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1184 sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
1185 if (ACPI_FAILURE (Status))
1190 /* Point to next sub-table (each subtable is of fixed length) */
1192 Offset += sizeof (ACPI_MCFG_ALLOCATION);
1193 SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
1194 sizeof (ACPI_MCFG_ALLOCATION));
1199 /*******************************************************************************
1201 * FUNCTION: AcpiDmDumpMsct
1203 * PARAMETERS: Table - A MSCT table
1207 * DESCRIPTION: Format the contents of a MSCT
1209 ******************************************************************************/
1213 ACPI_TABLE_HEADER *Table)
1216 UINT32 Offset = sizeof (ACPI_TABLE_MSCT);
1217 ACPI_MSCT_PROXIMITY *SubTable;
1222 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
1223 if (ACPI_FAILURE (Status))
1230 SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
1231 while (Offset < Table->Length)
1233 /* Common sub-table header */
1235 AcpiOsPrintf ("\n");
1236 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1237 sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
1238 if (ACPI_FAILURE (Status))
1243 /* Point to next sub-table */
1245 Offset += sizeof (ACPI_MSCT_PROXIMITY);
1246 SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
1251 /*******************************************************************************
1253 * FUNCTION: AcpiDmDumpSlit
1255 * PARAMETERS: Table - An SLIT
1259 * DESCRIPTION: Format the contents of a SLIT
1261 ******************************************************************************/
1265 ACPI_TABLE_HEADER *Table)
1277 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
1278 if (ACPI_FAILURE (Status))
1283 /* Display the Locality NxN Matrix */
1285 Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
1286 Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
1287 Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
1289 for (i = 0; i < Localities; i++)
1291 /* Display one row of the matrix */
1293 AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
1294 for (j = 0; j < Localities; j++)
1296 /* Check for beyond EOT */
1298 if (Offset >= Table->Length)
1300 AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
1304 AcpiOsPrintf ("%2.2X ", Row[j]);
1307 /* Display up to 16 bytes per output row */
1309 if (j && (((j+1) % 16) == 0) && ((j+1) < Localities))
1311 AcpiOsPrintf ("\n");
1312 AcpiDmLineHeader (Offset, 0, "");
1316 /* Point to next row */
1318 AcpiOsPrintf ("\n");
1324 /*******************************************************************************
1326 * FUNCTION: AcpiDmDumpSrat
1328 * PARAMETERS: Table - A SRAT table
1332 * DESCRIPTION: Format the contents of a SRAT
1334 ******************************************************************************/
1338 ACPI_TABLE_HEADER *Table)
1341 UINT32 Offset = sizeof (ACPI_TABLE_SRAT);
1342 ACPI_SUBTABLE_HEADER *SubTable;
1343 ACPI_DMTABLE_INFO *InfoTable;
1348 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
1349 if (ACPI_FAILURE (Status))
1356 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
1357 while (Offset < Table->Length)
1359 /* Common sub-table header */
1361 AcpiOsPrintf ("\n");
1362 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1363 SubTable->Length, AcpiDmTableInfoSratHdr);
1364 if (ACPI_FAILURE (Status))
1369 switch (SubTable->Type)
1371 case ACPI_SRAT_TYPE_CPU_AFFINITY:
1372 InfoTable = AcpiDmTableInfoSrat0;
1374 case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
1375 InfoTable = AcpiDmTableInfoSrat1;
1377 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
1378 InfoTable = AcpiDmTableInfoSrat2;
1381 AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type);
1383 /* Attempt to continue */
1385 if (!SubTable->Length)
1387 AcpiOsPrintf ("Invalid zero length subtable\n");
1393 AcpiOsPrintf ("\n");
1394 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1395 SubTable->Length, InfoTable);
1396 if (ACPI_FAILURE (Status))
1402 /* Point to next sub-table */
1404 Offset += SubTable->Length;
1405 SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
1410 /*******************************************************************************
1412 * FUNCTION: AcpiDmDumpWdat
1414 * PARAMETERS: Table - A WDAT table
1418 * DESCRIPTION: Format the contents of a WDAT
1420 ******************************************************************************/
1424 ACPI_TABLE_HEADER *Table)
1427 UINT32 Offset = sizeof (ACPI_TABLE_WDAT);
1428 ACPI_WDAT_ENTRY *SubTable;
1433 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
1434 if (ACPI_FAILURE (Status))
1441 SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
1442 while (Offset < Table->Length)
1444 /* Common sub-table header */
1446 AcpiOsPrintf ("\n");
1447 Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
1448 sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
1449 if (ACPI_FAILURE (Status))
1454 /* Point to next sub-table */
1456 Offset += sizeof (ACPI_WDAT_ENTRY);
1457 SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));