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;
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 %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 %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
;
754 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoHest
);
755 if (ACPI_FAILURE (Status
))
762 SubTable
= ACPI_ADD_PTR (ACPI_HEST_HEADER
, Table
, Offset
);
763 while (Offset
< Table
->Length
)
765 switch (SubTable
->Type
)
767 case ACPI_HEST_TYPE_IA32_CHECK
:
768 InfoTable
= AcpiDmTableInfoHest0
;
769 SubTableLength
= sizeof (ACPI_HEST_IA_MACHINE_CHECK
);
772 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
773 InfoTable
= AcpiDmTableInfoHest1
;
774 SubTableLength
= sizeof (ACPI_HEST_IA_CORRECTED
);
777 case ACPI_HEST_TYPE_IA32_NMI
:
778 InfoTable
= AcpiDmTableInfoHest2
;
779 SubTableLength
= sizeof (ACPI_HEST_IA_NMI
);
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_ERROR
:
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: AcpiDmDumpIvrs
829 * PARAMETERS: Table - A IVRS table
833 * DESCRIPTION: Format the contents of a IVRS
835 ******************************************************************************/
837 static UINT8 EntrySizes
[] = {4,8,16,32};
841 ACPI_TABLE_HEADER
*Table
)
844 UINT32 Offset
= sizeof (ACPI_TABLE_IVRS
);
848 ACPI_IVRS_DE_HEADER
*DeviceEntry
;
849 ACPI_IVRS_HEADER
*SubTable
;
850 ACPI_DMTABLE_INFO
*InfoTable
;
855 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoIvrs
);
856 if (ACPI_FAILURE (Status
))
863 SubTable
= ACPI_ADD_PTR (ACPI_IVRS_HEADER
, Table
, Offset
);
864 while (Offset
< Table
->Length
)
866 /* Common sub-table header */
869 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
870 SubTable
->Length
, AcpiDmTableInfoIvrsHdr
);
871 if (ACPI_FAILURE (Status
))
876 switch (SubTable
->Type
)
878 case ACPI_IVRS_TYPE_HARDWARE
:
879 InfoTable
= AcpiDmTableInfoIvrs0
;
881 case ACPI_IVRS_TYPE_MEMORY1
:
882 case ACPI_IVRS_TYPE_MEMORY2
:
883 case ACPI_IVRS_TYPE_MEMORY3
:
884 InfoTable
= AcpiDmTableInfoIvrs1
;
887 AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n",
890 /* Attempt to continue */
892 if (!SubTable
->Length
)
894 AcpiOsPrintf ("Invalid zero length subtable\n");
900 /* Dump the subtable */
903 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
904 SubTable
->Length
, InfoTable
);
905 if (ACPI_FAILURE (Status
))
910 /* The hardware subtable can contain multiple device entries */
912 if (SubTable
->Type
== ACPI_IVRS_TYPE_HARDWARE
)
914 EntryOffset
= Offset
+ sizeof (ACPI_IVRS_HARDWARE
);
915 DeviceEntry
= ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER
, SubTable
,
916 sizeof (ACPI_IVRS_HARDWARE
));
918 while (EntryOffset
< (Offset
+ SubTable
->Length
))
922 * Upper 2 bits of Type encode the length of the device entry
926 * 10 = 16 byte - currently no entries defined
927 * 11 = 32 byte - currently no entries defined
929 EntryType
= DeviceEntry
->Type
;
930 EntryLength
= EntrySizes
[EntryType
>> 6];
934 /* 4-byte device entries */
936 case ACPI_IVRS_TYPE_PAD4
:
937 case ACPI_IVRS_TYPE_ALL
:
938 case ACPI_IVRS_TYPE_SELECT
:
939 case ACPI_IVRS_TYPE_START
:
940 case ACPI_IVRS_TYPE_END
:
942 InfoTable
= AcpiDmTableInfoIvrs4
;
945 /* 8-byte entries, type A */
947 case ACPI_IVRS_TYPE_ALIAS_SELECT
:
948 case ACPI_IVRS_TYPE_ALIAS_START
:
950 InfoTable
= AcpiDmTableInfoIvrs8a
;
953 /* 8-byte entries, type B */
955 case ACPI_IVRS_TYPE_PAD8
:
956 case ACPI_IVRS_TYPE_EXT_SELECT
:
957 case ACPI_IVRS_TYPE_EXT_START
:
959 InfoTable
= AcpiDmTableInfoIvrs8b
;
962 /* 8-byte entries, type C */
964 case ACPI_IVRS_TYPE_SPECIAL
:
966 InfoTable
= AcpiDmTableInfoIvrs8c
;
970 InfoTable
= AcpiDmTableInfoIvrs4
;
972 "\n**** Unknown IVRS device entry type/length: "
973 "%.2X/%X at offset %.4X: (header below)\n",
974 EntryType
, EntryLength
, EntryOffset
);
978 /* Dump the Device Entry */
980 Status
= AcpiDmDumpTable (Table
->Length
, EntryOffset
,
981 DeviceEntry
, EntryLength
, InfoTable
);
983 EntryOffset
+= EntryLength
;
984 DeviceEntry
= ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER
, DeviceEntry
,
990 /* Point to next sub-table */
992 Offset
+= SubTable
->Length
;
993 SubTable
= ACPI_ADD_PTR (ACPI_IVRS_HEADER
, SubTable
, SubTable
->Length
);
998 /*******************************************************************************
1000 * FUNCTION: AcpiDmDumpMadt
1002 * PARAMETERS: Table - A MADT table
1006 * DESCRIPTION: Format the contents of a MADT. This table type consists
1007 * of an open-ended number of subtables.
1009 ******************************************************************************/
1013 ACPI_TABLE_HEADER
*Table
)
1016 ACPI_SUBTABLE_HEADER
*SubTable
;
1017 UINT32 Length
= Table
->Length
;
1018 UINT32 Offset
= sizeof (ACPI_TABLE_MADT
);
1019 ACPI_DMTABLE_INFO
*InfoTable
;
1024 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoMadt
);
1025 if (ACPI_FAILURE (Status
))
1032 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, Table
, Offset
);
1033 while (Offset
< Table
->Length
)
1035 /* Common sub-table header */
1037 AcpiOsPrintf ("\n");
1038 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1039 SubTable
->Length
, AcpiDmTableInfoMadtHdr
);
1040 if (ACPI_FAILURE (Status
))
1045 switch (SubTable
->Type
)
1047 case ACPI_MADT_TYPE_LOCAL_APIC
:
1048 InfoTable
= AcpiDmTableInfoMadt0
;
1050 case ACPI_MADT_TYPE_IO_APIC
:
1051 InfoTable
= AcpiDmTableInfoMadt1
;
1053 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE
:
1054 InfoTable
= AcpiDmTableInfoMadt2
;
1056 case ACPI_MADT_TYPE_NMI_SOURCE
:
1057 InfoTable
= AcpiDmTableInfoMadt3
;
1059 case ACPI_MADT_TYPE_LOCAL_APIC_NMI
:
1060 InfoTable
= AcpiDmTableInfoMadt4
;
1062 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE
:
1063 InfoTable
= AcpiDmTableInfoMadt5
;
1065 case ACPI_MADT_TYPE_IO_SAPIC
:
1066 InfoTable
= AcpiDmTableInfoMadt6
;
1068 case ACPI_MADT_TYPE_LOCAL_SAPIC
:
1069 InfoTable
= AcpiDmTableInfoMadt7
;
1071 case ACPI_MADT_TYPE_INTERRUPT_SOURCE
:
1072 InfoTable
= AcpiDmTableInfoMadt8
;
1074 case ACPI_MADT_TYPE_LOCAL_X2APIC
:
1075 InfoTable
= AcpiDmTableInfoMadt9
;
1077 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI
:
1078 InfoTable
= AcpiDmTableInfoMadt10
;
1081 AcpiOsPrintf ("\n**** Unknown MADT sub-table type %X\n\n", SubTable
->Type
);
1083 /* Attempt to continue */
1085 if (!SubTable
->Length
)
1087 AcpiOsPrintf ("Invalid zero length subtable\n");
1093 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1094 SubTable
->Length
, InfoTable
);
1095 if (ACPI_FAILURE (Status
))
1101 /* Point to next sub-table */
1103 Offset
+= SubTable
->Length
;
1104 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, SubTable
, SubTable
->Length
);
1109 /*******************************************************************************
1111 * FUNCTION: AcpiDmDumpMcfg
1113 * PARAMETERS: Table - A MCFG Table
1117 * DESCRIPTION: Format the contents of a MCFG table
1119 ******************************************************************************/
1123 ACPI_TABLE_HEADER
*Table
)
1126 UINT32 Offset
= sizeof (ACPI_TABLE_MCFG
);
1127 ACPI_MCFG_ALLOCATION
*SubTable
;
1132 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoMcfg
);
1133 if (ACPI_FAILURE (Status
))
1140 SubTable
= ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION
, Table
, Offset
);
1141 while (Offset
< Table
->Length
)
1143 if (Offset
+ sizeof (ACPI_MCFG_ALLOCATION
) > Table
->Length
)
1145 AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n",
1146 sizeof (ACPI_MCFG_ALLOCATION
) - (Offset
- Table
->Length
));
1150 AcpiOsPrintf ("\n");
1151 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1152 sizeof (ACPI_MCFG_ALLOCATION
), AcpiDmTableInfoMcfg0
);
1153 if (ACPI_FAILURE (Status
))
1158 /* Point to next sub-table (each subtable is of fixed length) */
1160 Offset
+= sizeof (ACPI_MCFG_ALLOCATION
);
1161 SubTable
= ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION
, SubTable
,
1162 sizeof (ACPI_MCFG_ALLOCATION
));
1167 /*******************************************************************************
1169 * FUNCTION: AcpiDmDumpMsct
1171 * PARAMETERS: Table - A MSCT table
1175 * DESCRIPTION: Format the contents of a MSCT
1177 ******************************************************************************/
1181 ACPI_TABLE_HEADER
*Table
)
1184 UINT32 Offset
= sizeof (ACPI_TABLE_MSCT
);
1185 ACPI_MSCT_PROXIMITY
*SubTable
;
1190 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoMsct
);
1191 if (ACPI_FAILURE (Status
))
1198 SubTable
= ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY
, Table
, Offset
);
1199 while (Offset
< Table
->Length
)
1201 /* Common sub-table header */
1203 AcpiOsPrintf ("\n");
1204 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1205 sizeof (ACPI_MSCT_PROXIMITY
), AcpiDmTableInfoMsct0
);
1206 if (ACPI_FAILURE (Status
))
1211 /* Point to next sub-table */
1213 Offset
+= sizeof (ACPI_MSCT_PROXIMITY
);
1214 SubTable
= ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY
, SubTable
, sizeof (ACPI_MSCT_PROXIMITY
));
1219 /*******************************************************************************
1221 * FUNCTION: AcpiDmDumpSlit
1223 * PARAMETERS: Table - An SLIT
1227 * DESCRIPTION: Format the contents of a SLIT
1229 ******************************************************************************/
1233 ACPI_TABLE_HEADER
*Table
)
1245 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoSlit
);
1246 if (ACPI_FAILURE (Status
))
1251 /* Display the Locality NxN Matrix */
1253 Localities
= (UINT32
) ACPI_CAST_PTR (ACPI_TABLE_SLIT
, Table
)->LocalityCount
;
1254 Offset
= ACPI_OFFSET (ACPI_TABLE_SLIT
, Entry
[0]);
1255 Row
= (UINT8
*) ACPI_CAST_PTR (ACPI_TABLE_SLIT
, Table
)->Entry
;
1257 for (i
= 0; i
< Localities
; i
++)
1259 /* Display one row of the matrix */
1261 AcpiDmLineHeader2 (Offset
, Localities
, "Locality", i
);
1262 for (j
= 0; j
< Localities
; j
++)
1264 /* Check for beyond EOT */
1266 if (Offset
>= Table
->Length
)
1268 AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
1272 AcpiOsPrintf ("%2.2X ", Row
[j
]);
1275 /* Display up to 16 bytes per output row */
1277 if (j
&& (((j
+1) % 16) == 0) && ((j
+1) < Localities
))
1279 AcpiOsPrintf ("\n");
1280 AcpiDmLineHeader (Offset
, 0, "");
1284 /* Point to next row */
1286 AcpiOsPrintf ("\n");
1292 /*******************************************************************************
1294 * FUNCTION: AcpiDmDumpSrat
1296 * PARAMETERS: Table - A SRAT table
1300 * DESCRIPTION: Format the contents of a SRAT
1302 ******************************************************************************/
1306 ACPI_TABLE_HEADER
*Table
)
1309 UINT32 Offset
= sizeof (ACPI_TABLE_SRAT
);
1310 ACPI_SUBTABLE_HEADER
*SubTable
;
1311 ACPI_DMTABLE_INFO
*InfoTable
;
1316 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoSrat
);
1317 if (ACPI_FAILURE (Status
))
1324 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, Table
, Offset
);
1325 while (Offset
< Table
->Length
)
1327 /* Common sub-table header */
1329 AcpiOsPrintf ("\n");
1330 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1331 SubTable
->Length
, AcpiDmTableInfoSratHdr
);
1332 if (ACPI_FAILURE (Status
))
1337 switch (SubTable
->Type
)
1339 case ACPI_SRAT_TYPE_CPU_AFFINITY
:
1340 InfoTable
= AcpiDmTableInfoSrat0
;
1342 case ACPI_SRAT_TYPE_MEMORY_AFFINITY
:
1343 InfoTable
= AcpiDmTableInfoSrat1
;
1345 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY
:
1346 InfoTable
= AcpiDmTableInfoSrat2
;
1349 AcpiOsPrintf ("\n**** Unknown SRAT sub-table type %X\n", SubTable
->Type
);
1351 /* Attempt to continue */
1353 if (!SubTable
->Length
)
1355 AcpiOsPrintf ("Invalid zero length subtable\n");
1361 AcpiOsPrintf ("\n");
1362 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1363 SubTable
->Length
, InfoTable
);
1364 if (ACPI_FAILURE (Status
))
1370 /* Point to next sub-table */
1372 Offset
+= SubTable
->Length
;
1373 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, SubTable
, SubTable
->Length
);
1378 /*******************************************************************************
1380 * FUNCTION: AcpiDmDumpWdat
1382 * PARAMETERS: Table - A WDAT table
1386 * DESCRIPTION: Format the contents of a WDAT
1388 ******************************************************************************/
1392 ACPI_TABLE_HEADER
*Table
)
1395 UINT32 Offset
= sizeof (ACPI_TABLE_WDAT
);
1396 ACPI_WDAT_ENTRY
*SubTable
;
1401 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoWdat
);
1402 if (ACPI_FAILURE (Status
))
1409 SubTable
= ACPI_ADD_PTR (ACPI_WDAT_ENTRY
, Table
, Offset
);
1410 while (Offset
< Table
->Length
)
1412 /* Common sub-table header */
1414 AcpiOsPrintf ("\n");
1415 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1416 sizeof (ACPI_WDAT_ENTRY
), AcpiDmTableInfoWdat0
);
1417 if (ACPI_FAILURE (Status
))
1422 /* Point to next sub-table */
1424 Offset
+= sizeof (ACPI_WDAT_ENTRY
);
1425 SubTable
= ACPI_ADD_PTR (ACPI_WDAT_ENTRY
, SubTable
, sizeof (ACPI_WDAT_ENTRY
));