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 - 2019, 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 *****************************************************************************/
152 #include <contrib/dev/acpica/include/acpi.h>
153 #include <contrib/dev/acpica/include/accommon.h>
154 #include <contrib/dev/acpica/include/acdisasm.h>
155 #include <contrib/dev/acpica/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);
1113 if (Table->Revision > 2)
1115 SubtableLength = sizeof (ACPI_GTDT_EL2);
1116 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1117 SubtableLength, AcpiDmTableInfoGtdtEl2);
1118 if (ACPI_FAILURE (Status))
1122 Offset += SubtableLength;
1125 Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
1129 while (Offset < Table->Length)
1131 /* Common subtable header */
1133 AcpiOsPrintf ("\n");
1134 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1135 Subtable->Length, AcpiDmTableInfoGtdtHdr);
1136 if (ACPI_FAILURE (Status))
1142 switch (Subtable->Type)
1144 case ACPI_GTDT_TYPE_TIMER_BLOCK:
1146 SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
1147 GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
1148 Subtable))->TimerCount;
1150 InfoTable = AcpiDmTableInfoGtdt0;
1153 case ACPI_GTDT_TYPE_WATCHDOG:
1155 SubtableLength = sizeof (ACPI_GTDT_WATCHDOG);
1157 InfoTable = AcpiDmTableInfoGtdt1;
1162 /* Cannot continue on unknown type - no length */
1164 AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
1169 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1170 Subtable->Length, InfoTable);
1171 if (ACPI_FAILURE (Status))
1176 /* Point to end of current subtable (each subtable above is of fixed length) */
1178 Offset += SubtableLength;
1180 /* If there are any Gt Timer Blocks from above, dump them now */
1184 GtxTable = ACPI_ADD_PTR (
1185 ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength);
1186 SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
1190 AcpiOsPrintf ("\n");
1191 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
1192 sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
1193 if (ACPI_FAILURE (Status))
1197 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
1203 /* Point to next subtable */
1205 Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength);
1210 /*******************************************************************************
1212 * FUNCTION: AcpiDmDumpHest
1214 * PARAMETERS: Table - A HEST table
1218 * DESCRIPTION: Format the contents of a HEST. This table type consists
1219 * of an open-ended number of subtables.
1221 ******************************************************************************/
1225 ACPI_TABLE_HEADER *Table)
1228 ACPI_HEST_HEADER *Subtable;
1229 UINT32 Length = Table->Length;
1230 UINT32 Offset = sizeof (ACPI_TABLE_HEST);
1231 ACPI_DMTABLE_INFO *InfoTable;
1232 UINT32 SubtableLength;
1234 ACPI_HEST_IA_ERROR_BANK *BankTable;
1239 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
1240 if (ACPI_FAILURE (Status))
1247 Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
1248 while (Offset < Table->Length)
1251 switch (Subtable->Type)
1253 case ACPI_HEST_TYPE_IA32_CHECK:
1255 InfoTable = AcpiDmTableInfoHest0;
1256 SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
1257 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
1258 Subtable))->NumHardwareBanks;
1261 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1263 InfoTable = AcpiDmTableInfoHest1;
1264 SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED);
1265 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
1266 Subtable))->NumHardwareBanks;
1269 case ACPI_HEST_TYPE_IA32_NMI:
1271 InfoTable = AcpiDmTableInfoHest2;
1272 SubtableLength = sizeof (ACPI_HEST_IA_NMI);
1275 case ACPI_HEST_TYPE_AER_ROOT_PORT:
1277 InfoTable = AcpiDmTableInfoHest6;
1278 SubtableLength = sizeof (ACPI_HEST_AER_ROOT);
1281 case ACPI_HEST_TYPE_AER_ENDPOINT:
1283 InfoTable = AcpiDmTableInfoHest7;
1284 SubtableLength = sizeof (ACPI_HEST_AER);
1287 case ACPI_HEST_TYPE_AER_BRIDGE:
1289 InfoTable = AcpiDmTableInfoHest8;
1290 SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE);
1293 case ACPI_HEST_TYPE_GENERIC_ERROR:
1295 InfoTable = AcpiDmTableInfoHest9;
1296 SubtableLength = sizeof (ACPI_HEST_GENERIC);
1299 case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
1301 InfoTable = AcpiDmTableInfoHest10;
1302 SubtableLength = sizeof (ACPI_HEST_GENERIC_V2);
1305 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1307 InfoTable = AcpiDmTableInfoHest11;
1308 SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
1309 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
1310 Subtable))->NumHardwareBanks;
1315 /* Cannot continue on unknown type - no length */
1317 AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
1322 AcpiOsPrintf ("\n");
1323 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1324 SubtableLength, InfoTable);
1325 if (ACPI_FAILURE (Status))
1330 /* Point to end of current subtable (each subtable above is of fixed length) */
1332 Offset += SubtableLength;
1334 /* If there are any (fixed-length) Error Banks from above, dump them now */
1338 BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable,
1340 SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
1344 AcpiOsPrintf ("\n");
1345 Status = AcpiDmDumpTable (Length, Offset, BankTable,
1346 sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
1347 if (ACPI_FAILURE (Status))
1352 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
1358 /* Point to next subtable */
1360 Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength);
1365 /*******************************************************************************
1367 * FUNCTION: AcpiDmDumpHmat
1369 * PARAMETERS: Table - A HMAT table
1373 * DESCRIPTION: Format the contents of a HMAT.
1375 ******************************************************************************/
1379 ACPI_TABLE_HEADER *Table)
1382 ACPI_HMAT_STRUCTURE *HmatStruct;
1383 ACPI_HMAT_LOCALITY *HmatLocality;
1384 ACPI_HMAT_CACHE *HmatCache;
1386 UINT32 SubtableOffset;
1388 ACPI_DMTABLE_INFO *InfoTable;
1394 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
1395 if (ACPI_FAILURE (Status))
1399 Offset = sizeof (ACPI_TABLE_HMAT);
1401 while (Offset < Table->Length)
1403 AcpiOsPrintf ("\n");
1406 /* Dump HMAT structure header */
1408 HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
1409 if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
1411 AcpiOsPrintf ("Invalid HMAT structure length\n");
1414 Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
1415 HmatStruct->Length, AcpiDmTableInfoHmatHdr);
1416 if (ACPI_FAILURE (Status))
1421 switch (HmatStruct->Type)
1423 case ACPI_HMAT_TYPE_ADDRESS_RANGE:
1425 InfoTable = AcpiDmTableInfoHmat0;
1426 Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN);
1429 case ACPI_HMAT_TYPE_LOCALITY:
1431 InfoTable = AcpiDmTableInfoHmat1;
1432 Length = sizeof (ACPI_HMAT_LOCALITY);
1435 case ACPI_HMAT_TYPE_CACHE:
1437 InfoTable = AcpiDmTableInfoHmat2;
1438 Length = sizeof (ACPI_HMAT_CACHE);
1443 AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
1446 /* Attempt to continue */
1451 /* Dump HMAT structure body */
1453 if (HmatStruct->Length < Length)
1455 AcpiOsPrintf ("Invalid HMAT structure length\n");
1458 Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
1459 HmatStruct->Length, InfoTable);
1460 if (ACPI_FAILURE (Status))
1465 /* Dump HMAT structure additionals */
1467 switch (HmatStruct->Type)
1469 case ACPI_HMAT_TYPE_LOCALITY:
1471 HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
1472 SubtableOffset = sizeof (ACPI_HMAT_LOCALITY);
1474 /* Dump initiator proximity domains */
1476 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1477 (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
1479 AcpiOsPrintf ("Invalid initiator proximity domain number\n");
1482 for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
1484 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1485 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1486 4, AcpiDmTableInfoHmat1a);
1487 SubtableOffset += 4;
1490 /* Dump target proximity domains */
1492 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1493 (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
1495 AcpiOsPrintf ("Invalid target proximity domain number\n");
1498 for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
1500 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1501 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1502 4, AcpiDmTableInfoHmat1b);
1503 SubtableOffset += 4;
1506 /* Dump latency/bandwidth entris */
1508 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1509 (UINT32)(HmatLocality->NumberOfInitiatorPDs *
1510 HmatLocality->NumberOfTargetPDs * 2))
1512 AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
1515 for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
1517 for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
1519 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1520 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1521 2, AcpiDmTableInfoHmat1c);
1522 SubtableOffset += 2;
1527 case ACPI_HMAT_TYPE_CACHE:
1529 HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
1530 SubtableOffset = sizeof (ACPI_HMAT_CACHE);
1532 /* Dump SMBIOS handles */
1534 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1535 (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
1537 AcpiOsPrintf ("Invalid SMBIOS handle number\n");
1540 for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
1542 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1543 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1544 2, AcpiDmTableInfoHmat2a);
1545 SubtableOffset += 2;
1555 /* Point to next HMAT structure subtable */
1557 Offset += (HmatStruct->Length);