1 /******************************************************************************
3 * Module Name: dmtbdump1 - Dump ACPI data tables that contain no AML code
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2018, 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 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
153 #include "accommon.h"
154 #include "acdisasm.h"
155 #include "actables.h"
157 /* This module used for application-level code only */
159 #define _COMPONENT ACPI_CA_DISASSEMBLER
160 ACPI_MODULE_NAME ("dmtbdump1")
163 /*******************************************************************************
165 * FUNCTION: AcpiDmDumpAsf
167 * PARAMETERS: Table - A ASF table
171 * DESCRIPTION: Format the contents of a ASF table
173 ******************************************************************************/
177 ACPI_TABLE_HEADER
*Table
)
180 UINT32 Offset
= sizeof (ACPI_TABLE_HEADER
);
181 ACPI_ASF_INFO
*Subtable
;
182 ACPI_DMTABLE_INFO
*InfoTable
;
183 ACPI_DMTABLE_INFO
*DataInfoTable
= NULL
;
184 UINT8
*DataTable
= NULL
;
185 UINT32 DataCount
= 0;
186 UINT32 DataLength
= 0;
187 UINT32 DataOffset
= 0;
192 /* No main table, only subtables */
194 Subtable
= ACPI_ADD_PTR (ACPI_ASF_INFO
, Table
, Offset
);
195 while (Offset
< Table
->Length
)
197 /* Common subtable header */
199 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, Subtable
,
200 Subtable
->Header
.Length
, AcpiDmTableInfoAsfHdr
);
201 if (ACPI_FAILURE (Status
))
206 /* The actual type is the lower 7 bits of Type */
208 Type
= (UINT8
) (Subtable
->Header
.Type
& 0x7F);
212 case ACPI_ASF_TYPE_INFO
:
214 InfoTable
= AcpiDmTableInfoAsf0
;
217 case ACPI_ASF_TYPE_ALERT
:
219 InfoTable
= AcpiDmTableInfoAsf1
;
220 DataInfoTable
= AcpiDmTableInfoAsf1a
;
221 DataTable
= ACPI_ADD_PTR (UINT8
, Subtable
, sizeof (ACPI_ASF_ALERT
));
222 DataCount
= ACPI_CAST_PTR (ACPI_ASF_ALERT
, Subtable
)->Alerts
;
223 DataLength
= ACPI_CAST_PTR (ACPI_ASF_ALERT
, Subtable
)->DataLength
;
224 DataOffset
= Offset
+ sizeof (ACPI_ASF_ALERT
);
227 case ACPI_ASF_TYPE_CONTROL
:
229 InfoTable
= AcpiDmTableInfoAsf2
;
230 DataInfoTable
= AcpiDmTableInfoAsf2a
;
231 DataTable
= ACPI_ADD_PTR (UINT8
, Subtable
, sizeof (ACPI_ASF_REMOTE
));
232 DataCount
= ACPI_CAST_PTR (ACPI_ASF_REMOTE
, Subtable
)->Controls
;
233 DataLength
= ACPI_CAST_PTR (ACPI_ASF_REMOTE
, Subtable
)->DataLength
;
234 DataOffset
= Offset
+ sizeof (ACPI_ASF_REMOTE
);
237 case ACPI_ASF_TYPE_BOOT
:
239 InfoTable
= AcpiDmTableInfoAsf3
;
242 case ACPI_ASF_TYPE_ADDRESS
:
244 InfoTable
= AcpiDmTableInfoAsf4
;
245 DataTable
= ACPI_ADD_PTR (UINT8
, Subtable
, sizeof (ACPI_ASF_ADDRESS
));
246 DataLength
= ACPI_CAST_PTR (ACPI_ASF_ADDRESS
, Subtable
)->Devices
;
247 DataOffset
= Offset
+ sizeof (ACPI_ASF_ADDRESS
);
252 AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
253 Subtable
->Header
.Type
);
257 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, Subtable
,
258 Subtable
->Header
.Length
, InfoTable
);
259 if (ACPI_FAILURE (Status
))
264 /* Dump variable-length extra data */
268 case ACPI_ASF_TYPE_ALERT
:
269 case ACPI_ASF_TYPE_CONTROL
:
271 for (i
= 0; i
< DataCount
; i
++)
274 Status
= AcpiDmDumpTable (Table
->Length
, DataOffset
,
275 DataTable
, DataLength
, DataInfoTable
);
276 if (ACPI_FAILURE (Status
))
281 DataTable
= ACPI_ADD_PTR (UINT8
, DataTable
, DataLength
);
282 DataOffset
+= DataLength
;
286 case ACPI_ASF_TYPE_ADDRESS
:
288 for (i
= 0; i
< DataLength
; i
++)
292 AcpiDmLineHeader (DataOffset
, 1, "Addresses");
295 AcpiOsPrintf ("%2.2X ", *DataTable
);
299 if (DataOffset
> Table
->Length
)
302 "**** ACPI table terminates in the middle of a "
303 "data structure! (ASF! table)\n");
318 /* Point to next subtable */
320 if (!Subtable
->Header
.Length
)
322 AcpiOsPrintf ("Invalid zero subtable header length\n");
326 Offset
+= Subtable
->Header
.Length
;
327 Subtable
= ACPI_ADD_PTR (ACPI_ASF_INFO
, Subtable
,
328 Subtable
->Header
.Length
);
333 /*******************************************************************************
335 * FUNCTION: AcpiDmDumpCpep
337 * PARAMETERS: Table - A CPEP table
341 * DESCRIPTION: Format the contents of a CPEP. This table type consists
342 * of an open-ended number of subtables.
344 ******************************************************************************/
348 ACPI_TABLE_HEADER
*Table
)
351 ACPI_CPEP_POLLING
*Subtable
;
352 UINT32 Length
= Table
->Length
;
353 UINT32 Offset
= sizeof (ACPI_TABLE_CPEP
);
358 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoCpep
);
359 if (ACPI_FAILURE (Status
))
366 Subtable
= ACPI_ADD_PTR (ACPI_CPEP_POLLING
, Table
, Offset
);
367 while (Offset
< Table
->Length
)
370 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
371 Subtable
->Header
.Length
, AcpiDmTableInfoCpep0
);
372 if (ACPI_FAILURE (Status
))
377 /* Point to next subtable */
379 Offset
+= Subtable
->Header
.Length
;
380 Subtable
= ACPI_ADD_PTR (ACPI_CPEP_POLLING
, Subtable
,
381 Subtable
->Header
.Length
);
386 /*******************************************************************************
388 * FUNCTION: AcpiDmDumpCsrt
390 * PARAMETERS: Table - A CSRT table
394 * DESCRIPTION: Format the contents of a CSRT. This table type consists
395 * of an open-ended number of subtables.
397 ******************************************************************************/
401 ACPI_TABLE_HEADER
*Table
)
404 ACPI_CSRT_GROUP
*Subtable
;
405 ACPI_CSRT_SHARED_INFO
*SharedInfoTable
;
406 ACPI_CSRT_DESCRIPTOR
*SubSubtable
;
407 UINT32 Length
= Table
->Length
;
408 UINT32 Offset
= sizeof (ACPI_TABLE_CSRT
);
414 /* The main table only contains the ACPI header, thus already handled */
416 /* Subtables (Resource Groups) */
418 Subtable
= ACPI_ADD_PTR (ACPI_CSRT_GROUP
, Table
, Offset
);
419 while (Offset
< Table
->Length
)
421 /* Resource group subtable */
424 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
425 Subtable
->Length
, AcpiDmTableInfoCsrt0
);
426 if (ACPI_FAILURE (Status
))
431 /* Shared info subtable (One per resource group) */
433 SubOffset
= sizeof (ACPI_CSRT_GROUP
);
434 SharedInfoTable
= ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO
, Table
,
438 Status
= AcpiDmDumpTable (Length
, Offset
+ SubOffset
, SharedInfoTable
,
439 sizeof (ACPI_CSRT_SHARED_INFO
), AcpiDmTableInfoCsrt1
);
440 if (ACPI_FAILURE (Status
))
445 SubOffset
+= Subtable
->SharedInfoLength
;
447 /* Sub-Subtables (Resource Descriptors) */
449 SubSubtable
= ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR
, Table
,
452 while ((SubOffset
< Subtable
->Length
) &&
453 ((Offset
+ SubOffset
) < Table
->Length
))
456 Status
= AcpiDmDumpTable (Length
, Offset
+ SubOffset
, SubSubtable
,
457 SubSubtable
->Length
, AcpiDmTableInfoCsrt2
);
458 if (ACPI_FAILURE (Status
))
463 SubSubOffset
= sizeof (ACPI_CSRT_DESCRIPTOR
);
465 /* Resource-specific info buffer */
467 InfoLength
= SubSubtable
->Length
- SubSubOffset
;
470 Status
= AcpiDmDumpTable (Length
,
471 Offset
+ SubOffset
+ SubSubOffset
, Table
,
472 InfoLength
, AcpiDmTableInfoCsrt2a
);
473 if (ACPI_FAILURE (Status
))
477 SubSubOffset
+= InfoLength
;
480 /* Point to next sub-subtable */
482 SubOffset
+= SubSubtable
->Length
;
483 SubSubtable
= ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR
, SubSubtable
,
484 SubSubtable
->Length
);
487 /* Point to next subtable */
489 Offset
+= Subtable
->Length
;
490 Subtable
= ACPI_ADD_PTR (ACPI_CSRT_GROUP
, Subtable
,
496 /*******************************************************************************
498 * FUNCTION: AcpiDmDumpDbg2
500 * PARAMETERS: Table - A DBG2 table
504 * DESCRIPTION: Format the contents of a DBG2. This table type consists
505 * of an open-ended number of subtables.
507 ******************************************************************************/
511 ACPI_TABLE_HEADER
*Table
)
514 ACPI_DBG2_DEVICE
*Subtable
;
515 UINT32 Length
= Table
->Length
;
516 UINT32 Offset
= sizeof (ACPI_TABLE_DBG2
);
519 UINT32 AbsoluteOffset
;
525 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoDbg2
);
526 if (ACPI_FAILURE (Status
))
533 Subtable
= ACPI_ADD_PTR (ACPI_DBG2_DEVICE
, Table
, Offset
);
534 while (Offset
< Table
->Length
)
537 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
538 Subtable
->Length
, AcpiDmTableInfoDbg2Device
);
539 if (ACPI_FAILURE (Status
))
544 /* Dump the BaseAddress array */
546 for (i
= 0; i
< Subtable
->RegisterCount
; i
++)
548 ArrayOffset
= Subtable
->BaseAddressOffset
+
549 (sizeof (ACPI_GENERIC_ADDRESS
) * i
);
550 AbsoluteOffset
= Offset
+ ArrayOffset
;
551 Array
= (UINT8
*) Subtable
+ ArrayOffset
;
553 Status
= AcpiDmDumpTable (Length
, AbsoluteOffset
, Array
,
554 Subtable
->Length
, AcpiDmTableInfoDbg2Addr
);
555 if (ACPI_FAILURE (Status
))
561 /* Dump the AddressSize array */
563 for (i
= 0; i
< Subtable
->RegisterCount
; i
++)
565 ArrayOffset
= Subtable
->AddressSizeOffset
+
566 (sizeof (UINT32
) * i
);
567 AbsoluteOffset
= Offset
+ ArrayOffset
;
568 Array
= (UINT8
*) Subtable
+ ArrayOffset
;
570 Status
= AcpiDmDumpTable (Length
, AbsoluteOffset
, Array
,
571 Subtable
->Length
, AcpiDmTableInfoDbg2Size
);
572 if (ACPI_FAILURE (Status
))
578 /* Dump the Namestring (required) */
581 ArrayOffset
= Subtable
->NamepathOffset
;
582 AbsoluteOffset
= Offset
+ ArrayOffset
;
583 Array
= (UINT8
*) Subtable
+ ArrayOffset
;
585 Status
= AcpiDmDumpTable (Length
, AbsoluteOffset
, Array
,
586 Subtable
->Length
, AcpiDmTableInfoDbg2Name
);
587 if (ACPI_FAILURE (Status
))
592 /* Dump the OemData (optional) */
594 if (Subtable
->OemDataOffset
)
596 Status
= AcpiDmDumpTable (Length
, Offset
+ Subtable
->OemDataOffset
,
597 Table
, Subtable
->OemDataLength
,
598 AcpiDmTableInfoDbg2OemData
);
599 if (ACPI_FAILURE (Status
))
605 /* Point to next subtable */
607 Offset
+= Subtable
->Length
;
608 Subtable
= ACPI_ADD_PTR (ACPI_DBG2_DEVICE
, Subtable
,
614 /*******************************************************************************
616 * FUNCTION: AcpiDmDumpDmar
618 * PARAMETERS: Table - A DMAR table
622 * DESCRIPTION: Format the contents of a DMAR. This table type consists
623 * of an open-ended number of subtables.
625 ******************************************************************************/
629 ACPI_TABLE_HEADER
*Table
)
632 ACPI_DMAR_HEADER
*Subtable
;
633 UINT32 Length
= Table
->Length
;
634 UINT32 Offset
= sizeof (ACPI_TABLE_DMAR
);
635 ACPI_DMTABLE_INFO
*InfoTable
;
636 ACPI_DMAR_DEVICE_SCOPE
*ScopeTable
;
644 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoDmar
);
645 if (ACPI_FAILURE (Status
))
652 Subtable
= ACPI_ADD_PTR (ACPI_DMAR_HEADER
, Table
, Offset
);
653 while (Offset
< Table
->Length
)
655 /* Common subtable header */
658 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
659 Subtable
->Length
, AcpiDmTableInfoDmarHdr
);
660 if (ACPI_FAILURE (Status
))
667 switch (Subtable
->Type
)
669 case ACPI_DMAR_TYPE_HARDWARE_UNIT
:
671 InfoTable
= AcpiDmTableInfoDmar0
;
672 ScopeOffset
= sizeof (ACPI_DMAR_HARDWARE_UNIT
);
675 case ACPI_DMAR_TYPE_RESERVED_MEMORY
:
677 InfoTable
= AcpiDmTableInfoDmar1
;
678 ScopeOffset
= sizeof (ACPI_DMAR_RESERVED_MEMORY
);
681 case ACPI_DMAR_TYPE_ROOT_ATS
:
683 InfoTable
= AcpiDmTableInfoDmar2
;
684 ScopeOffset
= sizeof (ACPI_DMAR_ATSR
);
687 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY
:
689 InfoTable
= AcpiDmTableInfoDmar3
;
690 ScopeOffset
= sizeof (ACPI_DMAR_RHSA
);
693 case ACPI_DMAR_TYPE_NAMESPACE
:
695 InfoTable
= AcpiDmTableInfoDmar4
;
696 ScopeOffset
= sizeof (ACPI_DMAR_ANDD
);
701 AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
706 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
707 Subtable
->Length
, InfoTable
);
708 if (ACPI_FAILURE (Status
))
714 * Dump the optional device scope entries
716 if ((Subtable
->Type
== ACPI_DMAR_TYPE_HARDWARE_AFFINITY
) ||
717 (Subtable
->Type
== ACPI_DMAR_TYPE_NAMESPACE
))
719 /* These types do not support device scopes */
724 ScopeTable
= ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE
, Subtable
, ScopeOffset
);
725 while (ScopeOffset
< Subtable
->Length
)
728 Status
= AcpiDmDumpTable (Length
, Offset
+ ScopeOffset
, ScopeTable
,
729 ScopeTable
->Length
, AcpiDmTableInfoDmarScope
);
730 if (ACPI_FAILURE (Status
))
736 /* Dump the PCI Path entries for this device scope */
738 PathOffset
= sizeof (ACPI_DMAR_DEVICE_SCOPE
); /* Path entries start at this offset */
740 PciPath
= ACPI_ADD_PTR (UINT8
, ScopeTable
,
741 sizeof (ACPI_DMAR_DEVICE_SCOPE
));
743 while (PathOffset
< ScopeTable
->Length
)
745 AcpiDmLineHeader ((PathOffset
+ ScopeOffset
+ Offset
), 2,
747 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath
[0], PciPath
[1]);
749 /* Point to next PCI Path entry */
756 /* Point to next device scope entry */
758 ScopeOffset
+= ScopeTable
->Length
;
759 ScopeTable
= ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE
,
760 ScopeTable
, ScopeTable
->Length
);
764 /* Point to next subtable */
766 Offset
+= Subtable
->Length
;
767 Subtable
= ACPI_ADD_PTR (ACPI_DMAR_HEADER
, Subtable
,
773 /*******************************************************************************
775 * FUNCTION: AcpiDmDumpDrtm
777 * PARAMETERS: Table - A DRTM table
781 * DESCRIPTION: Format the contents of a DRTM.
783 ******************************************************************************/
787 ACPI_TABLE_HEADER
*Table
)
791 ACPI_DRTM_VTABLE_LIST
*DrtmVtl
;
792 ACPI_DRTM_RESOURCE_LIST
*DrtmRl
;
793 ACPI_DRTM_DPS_ID
*DrtmDps
;
799 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0,
800 AcpiDmTableInfoDrtm
);
801 if (ACPI_FAILURE (Status
))
806 Offset
= sizeof (ACPI_TABLE_DRTM
);
810 /* Dump ValidatedTable length */
812 DrtmVtl
= ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST
, Table
, Offset
);
814 Status
= AcpiDmDumpTable (Table
->Length
, Offset
,
815 DrtmVtl
, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST
, ValidatedTables
),
816 AcpiDmTableInfoDrtm0
);
817 if (ACPI_FAILURE (Status
))
822 Offset
+= ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST
, ValidatedTables
);
824 /* Dump Validated table addresses */
827 while ((Offset
< Table
->Length
) &&
828 (DrtmVtl
->ValidatedTableCount
> Count
))
830 Status
= AcpiDmDumpTable (Table
->Length
, Offset
,
831 ACPI_ADD_PTR (void, Table
, Offset
), sizeof (UINT64
),
832 AcpiDmTableInfoDrtm0a
);
833 if (ACPI_FAILURE (Status
))
838 Offset
+= sizeof (UINT64
);
842 /* Dump ResourceList length */
844 DrtmRl
= ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST
, Table
, Offset
);
846 Status
= AcpiDmDumpTable (Table
->Length
, Offset
,
847 DrtmRl
, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST
, Resources
),
848 AcpiDmTableInfoDrtm1
);
849 if (ACPI_FAILURE (Status
))
854 Offset
+= ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST
, Resources
);
856 /* Dump the Resource List */
859 while ((Offset
< Table
->Length
) &&
860 (DrtmRl
->ResourceCount
> Count
))
862 Status
= AcpiDmDumpTable (Table
->Length
, Offset
,
863 ACPI_ADD_PTR (void, Table
, Offset
),
864 sizeof (ACPI_DRTM_RESOURCE
), AcpiDmTableInfoDrtm1a
);
865 if (ACPI_FAILURE (Status
))
870 Offset
+= sizeof (ACPI_DRTM_RESOURCE
);
876 DrtmDps
= ACPI_ADD_PTR (ACPI_DRTM_DPS_ID
, Table
, Offset
);
878 (void) AcpiDmDumpTable (Table
->Length
, Offset
,
879 DrtmDps
, sizeof (ACPI_DRTM_DPS_ID
), AcpiDmTableInfoDrtm2
);
883 /*******************************************************************************
885 * FUNCTION: AcpiDmDumpEinj
887 * PARAMETERS: Table - A EINJ table
891 * DESCRIPTION: Format the contents of a EINJ. This table type consists
892 * of an open-ended number of subtables.
894 ******************************************************************************/
898 ACPI_TABLE_HEADER
*Table
)
901 ACPI_WHEA_HEADER
*Subtable
;
902 UINT32 Length
= Table
->Length
;
903 UINT32 Offset
= sizeof (ACPI_TABLE_EINJ
);
908 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoEinj
);
909 if (ACPI_FAILURE (Status
))
916 Subtable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, Table
, Offset
);
917 while (Offset
< Table
->Length
)
920 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
921 sizeof (ACPI_WHEA_HEADER
), AcpiDmTableInfoEinj0
);
922 if (ACPI_FAILURE (Status
))
927 /* Point to next subtable (each subtable is of fixed length) */
929 Offset
+= sizeof (ACPI_WHEA_HEADER
);
930 Subtable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, Subtable
,
931 sizeof (ACPI_WHEA_HEADER
));
936 /*******************************************************************************
938 * FUNCTION: AcpiDmDumpErst
940 * PARAMETERS: Table - A ERST table
944 * DESCRIPTION: Format the contents of a ERST. This table type consists
945 * of an open-ended number of subtables.
947 ******************************************************************************/
951 ACPI_TABLE_HEADER
*Table
)
954 ACPI_WHEA_HEADER
*Subtable
;
955 UINT32 Length
= Table
->Length
;
956 UINT32 Offset
= sizeof (ACPI_TABLE_ERST
);
961 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoErst
);
962 if (ACPI_FAILURE (Status
))
969 Subtable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, Table
, Offset
);
970 while (Offset
< Table
->Length
)
973 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
974 sizeof (ACPI_WHEA_HEADER
), AcpiDmTableInfoErst0
);
975 if (ACPI_FAILURE (Status
))
980 /* Point to next subtable (each subtable is of fixed length) */
982 Offset
+= sizeof (ACPI_WHEA_HEADER
);
983 Subtable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, Subtable
,
984 sizeof (ACPI_WHEA_HEADER
));
989 /*******************************************************************************
991 * FUNCTION: AcpiDmDumpFpdt
993 * PARAMETERS: Table - A FPDT table
997 * DESCRIPTION: Format the contents of a FPDT. This table type consists
998 * of an open-ended number of subtables.
1000 ******************************************************************************/
1004 ACPI_TABLE_HEADER
*Table
)
1007 ACPI_FPDT_HEADER
*Subtable
;
1008 UINT32 Length
= Table
->Length
;
1009 UINT32 Offset
= sizeof (ACPI_TABLE_FPDT
);
1010 ACPI_DMTABLE_INFO
*InfoTable
;
1013 /* There is no main table (other than the standard ACPI header) */
1017 Subtable
= ACPI_ADD_PTR (ACPI_FPDT_HEADER
, Table
, Offset
);
1018 while (Offset
< Table
->Length
)
1020 /* Common subtable header */
1022 AcpiOsPrintf ("\n");
1023 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
1024 Subtable
->Length
, AcpiDmTableInfoFpdtHdr
);
1025 if (ACPI_FAILURE (Status
))
1030 switch (Subtable
->Type
)
1032 case ACPI_FPDT_TYPE_BOOT
:
1034 InfoTable
= AcpiDmTableInfoFpdt0
;
1037 case ACPI_FPDT_TYPE_S3PERF
:
1039 InfoTable
= AcpiDmTableInfoFpdt1
;
1044 AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
1047 /* Attempt to continue */
1049 if (!Subtable
->Length
)
1051 AcpiOsPrintf ("Invalid zero length subtable\n");
1057 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
1058 Subtable
->Length
, InfoTable
);
1059 if (ACPI_FAILURE (Status
))
1065 /* Point to next subtable */
1067 Offset
+= Subtable
->Length
;
1068 Subtable
= ACPI_ADD_PTR (ACPI_FPDT_HEADER
, Subtable
,
1074 /*******************************************************************************
1076 * FUNCTION: AcpiDmDumpGtdt
1078 * PARAMETERS: Table - A GTDT table
1082 * DESCRIPTION: Format the contents of a GTDT. This table type consists
1083 * of an open-ended number of subtables.
1085 ******************************************************************************/
1089 ACPI_TABLE_HEADER
*Table
)
1092 ACPI_GTDT_HEADER
*Subtable
;
1093 UINT32 Length
= Table
->Length
;
1094 UINT32 Offset
= sizeof (ACPI_TABLE_GTDT
);
1095 ACPI_DMTABLE_INFO
*InfoTable
;
1096 UINT32 SubtableLength
;
1098 ACPI_GTDT_TIMER_ENTRY
*GtxTable
;
1103 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoGtdt
);
1104 if (ACPI_FAILURE (Status
))
1111 Subtable
= ACPI_ADD_PTR (ACPI_GTDT_HEADER
, Table
, Offset
);
1112 while (Offset
< Table
->Length
)
1114 /* Common subtable header */
1116 AcpiOsPrintf ("\n");
1117 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
1118 Subtable
->Length
, AcpiDmTableInfoGtdtHdr
);
1119 if (ACPI_FAILURE (Status
))
1125 switch (Subtable
->Type
)
1127 case ACPI_GTDT_TYPE_TIMER_BLOCK
:
1129 SubtableLength
= sizeof (ACPI_GTDT_TIMER_BLOCK
);
1130 GtCount
= (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK
,
1131 Subtable
))->TimerCount
;
1133 InfoTable
= AcpiDmTableInfoGtdt0
;
1136 case ACPI_GTDT_TYPE_WATCHDOG
:
1138 SubtableLength
= sizeof (ACPI_GTDT_WATCHDOG
);
1140 InfoTable
= AcpiDmTableInfoGtdt1
;
1145 /* Cannot continue on unknown type - no length */
1147 AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
1152 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
1153 Subtable
->Length
, InfoTable
);
1154 if (ACPI_FAILURE (Status
))
1159 /* Point to end of current subtable (each subtable above is of fixed length) */
1161 Offset
+= SubtableLength
;
1163 /* If there are any Gt Timer Blocks from above, dump them now */
1167 GtxTable
= ACPI_ADD_PTR (
1168 ACPI_GTDT_TIMER_ENTRY
, Subtable
, SubtableLength
);
1169 SubtableLength
+= GtCount
* sizeof (ACPI_GTDT_TIMER_ENTRY
);
1173 AcpiOsPrintf ("\n");
1174 Status
= AcpiDmDumpTable (Length
, Offset
, GtxTable
,
1175 sizeof (ACPI_GTDT_TIMER_ENTRY
), AcpiDmTableInfoGtdt0a
);
1176 if (ACPI_FAILURE (Status
))
1180 Offset
+= sizeof (ACPI_GTDT_TIMER_ENTRY
);
1186 /* Point to next subtable */
1188 Subtable
= ACPI_ADD_PTR (ACPI_GTDT_HEADER
, Subtable
, SubtableLength
);
1193 /*******************************************************************************
1195 * FUNCTION: AcpiDmDumpHest
1197 * PARAMETERS: Table - A HEST table
1201 * DESCRIPTION: Format the contents of a HEST. This table type consists
1202 * of an open-ended number of subtables.
1204 ******************************************************************************/
1208 ACPI_TABLE_HEADER
*Table
)
1211 ACPI_HEST_HEADER
*Subtable
;
1212 UINT32 Length
= Table
->Length
;
1213 UINT32 Offset
= sizeof (ACPI_TABLE_HEST
);
1214 ACPI_DMTABLE_INFO
*InfoTable
;
1215 UINT32 SubtableLength
;
1217 ACPI_HEST_IA_ERROR_BANK
*BankTable
;
1222 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoHest
);
1223 if (ACPI_FAILURE (Status
))
1230 Subtable
= ACPI_ADD_PTR (ACPI_HEST_HEADER
, Table
, Offset
);
1231 while (Offset
< Table
->Length
)
1234 switch (Subtable
->Type
)
1236 case ACPI_HEST_TYPE_IA32_CHECK
:
1238 InfoTable
= AcpiDmTableInfoHest0
;
1239 SubtableLength
= sizeof (ACPI_HEST_IA_MACHINE_CHECK
);
1240 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK
,
1241 Subtable
))->NumHardwareBanks
;
1244 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
1246 InfoTable
= AcpiDmTableInfoHest1
;
1247 SubtableLength
= sizeof (ACPI_HEST_IA_CORRECTED
);
1248 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED
,
1249 Subtable
))->NumHardwareBanks
;
1252 case ACPI_HEST_TYPE_IA32_NMI
:
1254 InfoTable
= AcpiDmTableInfoHest2
;
1255 SubtableLength
= sizeof (ACPI_HEST_IA_NMI
);
1258 case ACPI_HEST_TYPE_AER_ROOT_PORT
:
1260 InfoTable
= AcpiDmTableInfoHest6
;
1261 SubtableLength
= sizeof (ACPI_HEST_AER_ROOT
);
1264 case ACPI_HEST_TYPE_AER_ENDPOINT
:
1266 InfoTable
= AcpiDmTableInfoHest7
;
1267 SubtableLength
= sizeof (ACPI_HEST_AER
);
1270 case ACPI_HEST_TYPE_AER_BRIDGE
:
1272 InfoTable
= AcpiDmTableInfoHest8
;
1273 SubtableLength
= sizeof (ACPI_HEST_AER_BRIDGE
);
1276 case ACPI_HEST_TYPE_GENERIC_ERROR
:
1278 InfoTable
= AcpiDmTableInfoHest9
;
1279 SubtableLength
= sizeof (ACPI_HEST_GENERIC
);
1282 case ACPI_HEST_TYPE_GENERIC_ERROR_V2
:
1284 InfoTable
= AcpiDmTableInfoHest10
;
1285 SubtableLength
= sizeof (ACPI_HEST_GENERIC_V2
);
1288 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK
:
1290 InfoTable
= AcpiDmTableInfoHest11
;
1291 SubtableLength
= sizeof (ACPI_HEST_IA_DEFERRED_CHECK
);
1292 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK
,
1293 Subtable
))->NumHardwareBanks
;
1298 /* Cannot continue on unknown type - no length */
1300 AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
1305 AcpiOsPrintf ("\n");
1306 Status
= AcpiDmDumpTable (Length
, Offset
, Subtable
,
1307 SubtableLength
, InfoTable
);
1308 if (ACPI_FAILURE (Status
))
1313 /* Point to end of current subtable (each subtable above is of fixed length) */
1315 Offset
+= SubtableLength
;
1317 /* If there are any (fixed-length) Error Banks from above, dump them now */
1321 BankTable
= ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK
, Subtable
,
1323 SubtableLength
+= BankCount
* sizeof (ACPI_HEST_IA_ERROR_BANK
);
1327 AcpiOsPrintf ("\n");
1328 Status
= AcpiDmDumpTable (Length
, Offset
, BankTable
,
1329 sizeof (ACPI_HEST_IA_ERROR_BANK
), AcpiDmTableInfoHestBank
);
1330 if (ACPI_FAILURE (Status
))
1335 Offset
+= sizeof (ACPI_HEST_IA_ERROR_BANK
);
1341 /* Point to next subtable */
1343 Subtable
= ACPI_ADD_PTR (ACPI_HEST_HEADER
, Subtable
, SubtableLength
);
1348 /*******************************************************************************
1350 * FUNCTION: AcpiDmDumpHmat
1352 * PARAMETERS: Table - A HMAT table
1356 * DESCRIPTION: Format the contents of a HMAT.
1358 ******************************************************************************/
1362 ACPI_TABLE_HEADER
*Table
)
1365 ACPI_HMAT_STRUCTURE
*HmatStruct
;
1366 ACPI_HMAT_LOCALITY
*HmatLocality
;
1367 ACPI_HMAT_CACHE
*HmatCache
;
1369 UINT32 SubtableOffset
;
1371 ACPI_DMTABLE_INFO
*InfoTable
;
1377 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoHmat
);
1378 if (ACPI_FAILURE (Status
))
1382 Offset
= sizeof (ACPI_TABLE_HMAT
);
1384 while (Offset
< Table
->Length
)
1386 AcpiOsPrintf ("\n");
1389 /* Dump HMAT structure header */
1391 HmatStruct
= ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE
, Table
, Offset
);
1392 if (HmatStruct
->Length
< sizeof (ACPI_HMAT_STRUCTURE
))
1394 AcpiOsPrintf ("Invalid HMAT structure length\n");
1397 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, HmatStruct
,
1398 HmatStruct
->Length
, AcpiDmTableInfoHmatHdr
);
1399 if (ACPI_FAILURE (Status
))
1404 switch (HmatStruct
->Type
)
1406 case ACPI_HMAT_TYPE_ADDRESS_RANGE
:
1408 InfoTable
= AcpiDmTableInfoHmat0
;
1409 Length
= sizeof (ACPI_HMAT_ADDRESS_RANGE
);
1412 case ACPI_HMAT_TYPE_LOCALITY
:
1414 InfoTable
= AcpiDmTableInfoHmat1
;
1415 Length
= sizeof (ACPI_HMAT_LOCALITY
);
1418 case ACPI_HMAT_TYPE_CACHE
:
1420 InfoTable
= AcpiDmTableInfoHmat2
;
1421 Length
= sizeof (ACPI_HMAT_CACHE
);
1426 AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
1429 /* Attempt to continue */
1434 /* Dump HMAT structure body */
1436 if (HmatStruct
->Length
< Length
)
1438 AcpiOsPrintf ("Invalid HMAT structure length\n");
1441 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, HmatStruct
,
1442 HmatStruct
->Length
, InfoTable
);
1443 if (ACPI_FAILURE (Status
))
1448 /* Dump HMAT structure additionals */
1450 switch (HmatStruct
->Type
)
1452 case ACPI_HMAT_TYPE_LOCALITY
:
1454 HmatLocality
= ACPI_CAST_PTR (ACPI_HMAT_LOCALITY
, HmatStruct
);
1455 SubtableOffset
= sizeof (ACPI_HMAT_LOCALITY
);
1457 /* Dump initiator proximity domains */
1459 if ((UINT32
)(HmatStruct
->Length
- SubtableOffset
) <
1460 (UINT32
)(HmatLocality
->NumberOfInitiatorPDs
* 4))
1462 AcpiOsPrintf ("Invalid initiator proximity domain number\n");
1465 for (i
= 0; i
< HmatLocality
->NumberOfInitiatorPDs
; i
++)
1467 Status
= AcpiDmDumpTable (Table
->Length
, Offset
+ SubtableOffset
,
1468 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE
, HmatStruct
, SubtableOffset
),
1469 4, AcpiDmTableInfoHmat1a
);
1470 SubtableOffset
+= 4;
1473 /* Dump target proximity domains */
1475 if ((UINT32
)(HmatStruct
->Length
- SubtableOffset
) <
1476 (UINT32
)(HmatLocality
->NumberOfTargetPDs
* 4))
1478 AcpiOsPrintf ("Invalid target proximity domain number\n");
1481 for (i
= 0; i
< HmatLocality
->NumberOfTargetPDs
; i
++)
1483 Status
= AcpiDmDumpTable (Table
->Length
, Offset
+ SubtableOffset
,
1484 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE
, HmatStruct
, SubtableOffset
),
1485 4, AcpiDmTableInfoHmat1b
);
1486 SubtableOffset
+= 4;
1489 /* Dump latency/bandwidth entris */
1491 if ((UINT32
)(HmatStruct
->Length
- SubtableOffset
) <
1492 (UINT32
)(HmatLocality
->NumberOfInitiatorPDs
*
1493 HmatLocality
->NumberOfTargetPDs
* 2))
1495 AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
1498 for (i
= 0; i
< HmatLocality
->NumberOfInitiatorPDs
; i
++)
1500 for (j
= 0; j
< HmatLocality
->NumberOfTargetPDs
; j
++)
1502 Status
= AcpiDmDumpTable (Table
->Length
, Offset
+ SubtableOffset
,
1503 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE
, HmatStruct
, SubtableOffset
),
1504 2, AcpiDmTableInfoHmat1c
);
1505 SubtableOffset
+= 2;
1510 case ACPI_HMAT_TYPE_CACHE
:
1512 HmatCache
= ACPI_CAST_PTR (ACPI_HMAT_CACHE
, HmatStruct
);
1513 SubtableOffset
= sizeof (ACPI_HMAT_CACHE
);
1515 /* Dump SMBIOS handles */
1517 if ((UINT32
)(HmatStruct
->Length
- SubtableOffset
) <
1518 (UINT32
)(HmatCache
->NumberOfSMBIOSHandles
* 2))
1520 AcpiOsPrintf ("Invalid SMBIOS handle number\n");
1523 for (i
= 0; i
< HmatCache
->NumberOfSMBIOSHandles
; i
++)
1525 Status
= AcpiDmDumpTable (Table
->Length
, Offset
+ SubtableOffset
,
1526 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE
, HmatStruct
, SubtableOffset
),
1527 2, AcpiDmTableInfoHmat2a
);
1528 SubtableOffset
+= 2;
1538 /* Point to next HMAT structure subtable */
1540 Offset
+= (HmatStruct
->Length
);