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 - 2020, 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))
479 /* Point to next sub-subtable */
481 SubOffset += SubSubtable->Length;
482 SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
483 SubSubtable->Length);
486 /* Point to next subtable */
488 Offset += Subtable->Length;
489 Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
495 /*******************************************************************************
497 * FUNCTION: AcpiDmDumpDbg2
499 * PARAMETERS: Table - A DBG2 table
503 * DESCRIPTION: Format the contents of a DBG2. This table type consists
504 * of an open-ended number of subtables.
506 ******************************************************************************/
510 ACPI_TABLE_HEADER *Table)
513 ACPI_DBG2_DEVICE *Subtable;
514 UINT32 Length = Table->Length;
515 UINT32 Offset = sizeof (ACPI_TABLE_DBG2);
518 UINT32 AbsoluteOffset;
524 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
525 if (ACPI_FAILURE (Status))
532 Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
533 while (Offset < Table->Length)
536 Status = AcpiDmDumpTable (Length, Offset, Subtable,
537 Subtable->Length, AcpiDmTableInfoDbg2Device);
538 if (ACPI_FAILURE (Status))
543 /* Dump the BaseAddress array */
545 for (i = 0; i < Subtable->RegisterCount; i++)
547 ArrayOffset = Subtable->BaseAddressOffset +
548 (sizeof (ACPI_GENERIC_ADDRESS) * i);
549 AbsoluteOffset = Offset + ArrayOffset;
550 Array = (UINT8 *) Subtable + ArrayOffset;
552 Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
553 Subtable->Length, AcpiDmTableInfoDbg2Addr);
554 if (ACPI_FAILURE (Status))
560 /* Dump the AddressSize array */
562 for (i = 0; i < Subtable->RegisterCount; i++)
564 ArrayOffset = Subtable->AddressSizeOffset +
565 (sizeof (UINT32) * i);
566 AbsoluteOffset = Offset + ArrayOffset;
567 Array = (UINT8 *) Subtable + ArrayOffset;
569 Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
570 Subtable->Length, AcpiDmTableInfoDbg2Size);
571 if (ACPI_FAILURE (Status))
577 /* Dump the Namestring (required) */
580 ArrayOffset = Subtable->NamepathOffset;
581 AbsoluteOffset = Offset + ArrayOffset;
582 Array = (UINT8 *) Subtable + ArrayOffset;
584 Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
585 Subtable->Length, AcpiDmTableInfoDbg2Name);
586 if (ACPI_FAILURE (Status))
591 /* Dump the OemData (optional) */
593 if (Subtable->OemDataOffset)
595 Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset,
596 Table, Subtable->OemDataLength,
597 AcpiDmTableInfoDbg2OemData);
598 if (ACPI_FAILURE (Status))
604 /* Point to next subtable */
606 Offset += Subtable->Length;
607 Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
613 /*******************************************************************************
615 * FUNCTION: AcpiDmDumpDmar
617 * PARAMETERS: Table - A DMAR table
621 * DESCRIPTION: Format the contents of a DMAR. This table type consists
622 * of an open-ended number of subtables.
624 ******************************************************************************/
628 ACPI_TABLE_HEADER *Table)
631 ACPI_DMAR_HEADER *Subtable;
632 UINT32 Length = Table->Length;
633 UINT32 Offset = sizeof (ACPI_TABLE_DMAR);
634 ACPI_DMTABLE_INFO *InfoTable;
635 ACPI_DMAR_DEVICE_SCOPE *ScopeTable;
643 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
644 if (ACPI_FAILURE (Status))
651 Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
652 while (Offset < Table->Length)
654 /* Common subtable header */
657 Status = AcpiDmDumpTable (Length, Offset, Subtable,
658 Subtable->Length, AcpiDmTableInfoDmarHdr);
659 if (ACPI_FAILURE (Status))
666 switch (Subtable->Type)
668 case ACPI_DMAR_TYPE_HARDWARE_UNIT:
670 InfoTable = AcpiDmTableInfoDmar0;
671 ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
674 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
676 InfoTable = AcpiDmTableInfoDmar1;
677 ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
680 case ACPI_DMAR_TYPE_ROOT_ATS:
682 InfoTable = AcpiDmTableInfoDmar2;
683 ScopeOffset = sizeof (ACPI_DMAR_ATSR);
686 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
688 InfoTable = AcpiDmTableInfoDmar3;
689 ScopeOffset = sizeof (ACPI_DMAR_RHSA);
692 case ACPI_DMAR_TYPE_NAMESPACE:
694 InfoTable = AcpiDmTableInfoDmar4;
695 ScopeOffset = sizeof (ACPI_DMAR_ANDD);
700 AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
705 Status = AcpiDmDumpTable (Length, Offset, Subtable,
706 Subtable->Length, InfoTable);
707 if (ACPI_FAILURE (Status))
713 * Dump the optional device scope entries
715 if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
716 (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
718 /* These types do not support device scopes */
723 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
724 while (ScopeOffset < Subtable->Length)
727 Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
728 ScopeTable->Length, AcpiDmTableInfoDmarScope);
729 if (ACPI_FAILURE (Status))
735 /* Dump the PCI Path entries for this device scope */
737 PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
739 PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
740 sizeof (ACPI_DMAR_DEVICE_SCOPE));
742 while (PathOffset < ScopeTable->Length)
744 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
746 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
748 /* Point to next PCI Path entry */
755 /* Point to next device scope entry */
757 ScopeOffset += ScopeTable->Length;
758 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
759 ScopeTable, ScopeTable->Length);
763 /* Point to next subtable */
765 Offset += Subtable->Length;
766 Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
772 /*******************************************************************************
774 * FUNCTION: AcpiDmDumpDrtm
776 * PARAMETERS: Table - A DRTM table
780 * DESCRIPTION: Format the contents of a DRTM.
782 ******************************************************************************/
786 ACPI_TABLE_HEADER *Table)
790 ACPI_DRTM_VTABLE_LIST *DrtmVtl;
791 ACPI_DRTM_RESOURCE_LIST *DrtmRl;
792 ACPI_DRTM_DPS_ID *DrtmDps;
798 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
799 AcpiDmTableInfoDrtm);
800 if (ACPI_FAILURE (Status))
805 Offset = sizeof (ACPI_TABLE_DRTM);
809 /* Dump ValidatedTable length */
811 DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
813 Status = AcpiDmDumpTable (Table->Length, Offset,
814 DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
815 AcpiDmTableInfoDrtm0);
816 if (ACPI_FAILURE (Status))
821 Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
823 /* Dump Validated table addresses */
826 while ((Offset < Table->Length) &&
827 (DrtmVtl->ValidatedTableCount > Count))
829 Status = AcpiDmDumpTable (Table->Length, Offset,
830 ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
831 AcpiDmTableInfoDrtm0a);
832 if (ACPI_FAILURE (Status))
837 Offset += sizeof (UINT64);
841 /* Dump ResourceList length */
843 DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
845 Status = AcpiDmDumpTable (Table->Length, Offset,
846 DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
847 AcpiDmTableInfoDrtm1);
848 if (ACPI_FAILURE (Status))
853 Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
855 /* Dump the Resource List */
858 while ((Offset < Table->Length) &&
859 (DrtmRl->ResourceCount > Count))
861 Status = AcpiDmDumpTable (Table->Length, Offset,
862 ACPI_ADD_PTR (void, Table, Offset),
863 sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
864 if (ACPI_FAILURE (Status))
869 Offset += sizeof (ACPI_DRTM_RESOURCE);
875 DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
877 (void) AcpiDmDumpTable (Table->Length, Offset,
878 DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
882 /*******************************************************************************
884 * FUNCTION: AcpiDmDumpEinj
886 * PARAMETERS: Table - A EINJ table
890 * DESCRIPTION: Format the contents of a EINJ. This table type consists
891 * of an open-ended number of subtables.
893 ******************************************************************************/
897 ACPI_TABLE_HEADER *Table)
900 ACPI_WHEA_HEADER *Subtable;
901 UINT32 Length = Table->Length;
902 UINT32 Offset = sizeof (ACPI_TABLE_EINJ);
907 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
908 if (ACPI_FAILURE (Status))
915 Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
916 while (Offset < Table->Length)
919 Status = AcpiDmDumpTable (Length, Offset, Subtable,
920 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
921 if (ACPI_FAILURE (Status))
926 /* Point to next subtable (each subtable is of fixed length) */
928 Offset += sizeof (ACPI_WHEA_HEADER);
929 Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
930 sizeof (ACPI_WHEA_HEADER));
935 /*******************************************************************************
937 * FUNCTION: AcpiDmDumpErst
939 * PARAMETERS: Table - A ERST table
943 * DESCRIPTION: Format the contents of a ERST. This table type consists
944 * of an open-ended number of subtables.
946 ******************************************************************************/
950 ACPI_TABLE_HEADER *Table)
953 ACPI_WHEA_HEADER *Subtable;
954 UINT32 Length = Table->Length;
955 UINT32 Offset = sizeof (ACPI_TABLE_ERST);
960 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
961 if (ACPI_FAILURE (Status))
968 Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
969 while (Offset < Table->Length)
972 Status = AcpiDmDumpTable (Length, Offset, Subtable,
973 sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
974 if (ACPI_FAILURE (Status))
979 /* Point to next subtable (each subtable is of fixed length) */
981 Offset += sizeof (ACPI_WHEA_HEADER);
982 Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
983 sizeof (ACPI_WHEA_HEADER));
988 /*******************************************************************************
990 * FUNCTION: AcpiDmDumpFpdt
992 * PARAMETERS: Table - A FPDT table
996 * DESCRIPTION: Format the contents of a FPDT. This table type consists
997 * of an open-ended number of subtables.
999 ******************************************************************************/
1003 ACPI_TABLE_HEADER *Table)
1006 ACPI_FPDT_HEADER *Subtable;
1007 UINT32 Length = Table->Length;
1008 UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
1009 ACPI_DMTABLE_INFO *InfoTable;
1012 /* There is no main table (other than the standard ACPI header) */
1016 Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
1017 while (Offset < Table->Length)
1019 /* Common subtable header */
1021 AcpiOsPrintf ("\n");
1022 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1023 Subtable->Length, AcpiDmTableInfoFpdtHdr);
1024 if (ACPI_FAILURE (Status))
1029 switch (Subtable->Type)
1031 case ACPI_FPDT_TYPE_BOOT:
1033 InfoTable = AcpiDmTableInfoFpdt0;
1036 case ACPI_FPDT_TYPE_S3PERF:
1038 InfoTable = AcpiDmTableInfoFpdt1;
1043 AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
1046 /* Attempt to continue */
1048 if (!Subtable->Length)
1050 AcpiOsPrintf ("Invalid zero length subtable\n");
1056 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1057 Subtable->Length, InfoTable);
1058 if (ACPI_FAILURE (Status))
1064 /* Point to next subtable */
1066 Offset += Subtable->Length;
1067 Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable,
1073 /*******************************************************************************
1075 * FUNCTION: AcpiDmDumpGtdt
1077 * PARAMETERS: Table - A GTDT table
1081 * DESCRIPTION: Format the contents of a GTDT. This table type consists
1082 * of an open-ended number of subtables.
1084 ******************************************************************************/
1088 ACPI_TABLE_HEADER *Table)
1091 ACPI_GTDT_HEADER *Subtable;
1092 UINT32 Length = Table->Length;
1093 UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
1094 ACPI_DMTABLE_INFO *InfoTable;
1095 UINT32 SubtableLength;
1097 ACPI_GTDT_TIMER_ENTRY *GtxTable;
1102 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
1103 if (ACPI_FAILURE (Status))
1110 Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
1112 if (Table->Revision > 2)
1114 SubtableLength = sizeof (ACPI_GTDT_EL2);
1115 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1116 SubtableLength, AcpiDmTableInfoGtdtEl2);
1117 if (ACPI_FAILURE (Status))
1121 Offset += SubtableLength;
1124 Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
1128 while (Offset < Table->Length)
1130 /* Common subtable header */
1132 AcpiOsPrintf ("\n");
1133 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1134 Subtable->Length, AcpiDmTableInfoGtdtHdr);
1135 if (ACPI_FAILURE (Status))
1141 switch (Subtable->Type)
1143 case ACPI_GTDT_TYPE_TIMER_BLOCK:
1145 SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
1146 GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
1147 Subtable))->TimerCount;
1149 InfoTable = AcpiDmTableInfoGtdt0;
1152 case ACPI_GTDT_TYPE_WATCHDOG:
1154 SubtableLength = sizeof (ACPI_GTDT_WATCHDOG);
1156 InfoTable = AcpiDmTableInfoGtdt1;
1161 /* Cannot continue on unknown type - no length */
1163 AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
1168 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1169 Subtable->Length, InfoTable);
1170 if (ACPI_FAILURE (Status))
1175 /* Point to end of current subtable (each subtable above is of fixed length) */
1177 Offset += SubtableLength;
1179 /* If there are any Gt Timer Blocks from above, dump them now */
1183 GtxTable = ACPI_ADD_PTR (
1184 ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength);
1185 SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
1189 AcpiOsPrintf ("\n");
1190 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
1191 sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
1192 if (ACPI_FAILURE (Status))
1196 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
1202 /* Point to next subtable */
1204 Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength);
1209 /*******************************************************************************
1211 * FUNCTION: AcpiDmDumpHest
1213 * PARAMETERS: Table - A HEST table
1217 * DESCRIPTION: Format the contents of a HEST. This table type consists
1218 * of an open-ended number of subtables.
1220 ******************************************************************************/
1224 ACPI_TABLE_HEADER *Table)
1227 ACPI_HEST_HEADER *Subtable;
1228 UINT32 Length = Table->Length;
1229 UINT32 Offset = sizeof (ACPI_TABLE_HEST);
1230 ACPI_DMTABLE_INFO *InfoTable;
1231 UINT32 SubtableLength;
1233 ACPI_HEST_IA_ERROR_BANK *BankTable;
1238 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
1239 if (ACPI_FAILURE (Status))
1246 Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
1247 while (Offset < Table->Length)
1250 switch (Subtable->Type)
1252 case ACPI_HEST_TYPE_IA32_CHECK:
1254 InfoTable = AcpiDmTableInfoHest0;
1255 SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
1256 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
1257 Subtable))->NumHardwareBanks;
1260 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1262 InfoTable = AcpiDmTableInfoHest1;
1263 SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED);
1264 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
1265 Subtable))->NumHardwareBanks;
1268 case ACPI_HEST_TYPE_IA32_NMI:
1270 InfoTable = AcpiDmTableInfoHest2;
1271 SubtableLength = sizeof (ACPI_HEST_IA_NMI);
1274 case ACPI_HEST_TYPE_AER_ROOT_PORT:
1276 InfoTable = AcpiDmTableInfoHest6;
1277 SubtableLength = sizeof (ACPI_HEST_AER_ROOT);
1280 case ACPI_HEST_TYPE_AER_ENDPOINT:
1282 InfoTable = AcpiDmTableInfoHest7;
1283 SubtableLength = sizeof (ACPI_HEST_AER);
1286 case ACPI_HEST_TYPE_AER_BRIDGE:
1288 InfoTable = AcpiDmTableInfoHest8;
1289 SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE);
1292 case ACPI_HEST_TYPE_GENERIC_ERROR:
1294 InfoTable = AcpiDmTableInfoHest9;
1295 SubtableLength = sizeof (ACPI_HEST_GENERIC);
1298 case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
1300 InfoTable = AcpiDmTableInfoHest10;
1301 SubtableLength = sizeof (ACPI_HEST_GENERIC_V2);
1304 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1306 InfoTable = AcpiDmTableInfoHest11;
1307 SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
1308 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
1309 Subtable))->NumHardwareBanks;
1314 /* Cannot continue on unknown type - no length */
1316 AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
1321 AcpiOsPrintf ("\n");
1322 Status = AcpiDmDumpTable (Length, Offset, Subtable,
1323 SubtableLength, InfoTable);
1324 if (ACPI_FAILURE (Status))
1329 /* Point to end of current subtable (each subtable above is of fixed length) */
1331 Offset += SubtableLength;
1333 /* If there are any (fixed-length) Error Banks from above, dump them now */
1337 BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable,
1339 SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
1343 AcpiOsPrintf ("\n");
1344 Status = AcpiDmDumpTable (Length, Offset, BankTable,
1345 sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
1346 if (ACPI_FAILURE (Status))
1351 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
1357 /* Point to next subtable */
1359 Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength);
1364 /*******************************************************************************
1366 * FUNCTION: AcpiDmDumpHmat
1368 * PARAMETERS: Table - A HMAT table
1372 * DESCRIPTION: Format the contents of a HMAT.
1374 ******************************************************************************/
1378 ACPI_TABLE_HEADER *Table)
1381 ACPI_HMAT_STRUCTURE *HmatStruct;
1382 ACPI_HMAT_LOCALITY *HmatLocality;
1383 ACPI_HMAT_CACHE *HmatCache;
1385 UINT32 SubtableOffset;
1387 ACPI_DMTABLE_INFO *InfoTable;
1393 Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
1394 if (ACPI_FAILURE (Status))
1398 Offset = sizeof (ACPI_TABLE_HMAT);
1400 while (Offset < Table->Length)
1402 AcpiOsPrintf ("\n");
1404 /* Dump HMAT structure header */
1406 HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
1407 if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
1409 AcpiOsPrintf ("Invalid HMAT structure length\n");
1412 Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
1413 HmatStruct->Length, AcpiDmTableInfoHmatHdr);
1414 if (ACPI_FAILURE (Status))
1419 switch (HmatStruct->Type)
1421 case ACPI_HMAT_TYPE_ADDRESS_RANGE:
1423 InfoTable = AcpiDmTableInfoHmat0;
1424 Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN);
1427 case ACPI_HMAT_TYPE_LOCALITY:
1429 InfoTable = AcpiDmTableInfoHmat1;
1430 Length = sizeof (ACPI_HMAT_LOCALITY);
1433 case ACPI_HMAT_TYPE_CACHE:
1435 InfoTable = AcpiDmTableInfoHmat2;
1436 Length = sizeof (ACPI_HMAT_CACHE);
1441 AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
1444 /* Attempt to continue */
1449 /* Dump HMAT structure body */
1451 if (HmatStruct->Length < Length)
1453 AcpiOsPrintf ("Invalid HMAT structure length\n");
1456 Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
1457 HmatStruct->Length, InfoTable);
1458 if (ACPI_FAILURE (Status))
1463 /* Dump HMAT structure additionals */
1465 switch (HmatStruct->Type)
1467 case ACPI_HMAT_TYPE_LOCALITY:
1469 HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
1470 SubtableOffset = sizeof (ACPI_HMAT_LOCALITY);
1472 /* Dump initiator proximity domains */
1474 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1475 (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
1477 AcpiOsPrintf ("Invalid initiator proximity domain number\n");
1480 for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
1482 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1483 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1484 4, AcpiDmTableInfoHmat1a);
1485 if (ACPI_FAILURE (Status))
1490 SubtableOffset += 4;
1493 /* Dump target proximity domains */
1495 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1496 (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
1498 AcpiOsPrintf ("Invalid target proximity domain number\n");
1501 for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
1503 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1504 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1505 4, AcpiDmTableInfoHmat1b);
1506 if (ACPI_FAILURE (Status))
1511 SubtableOffset += 4;
1514 /* Dump latency/bandwidth entris */
1516 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1517 (UINT32)(HmatLocality->NumberOfInitiatorPDs *
1518 HmatLocality->NumberOfTargetPDs * 2))
1520 AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
1523 for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
1525 for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
1527 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1528 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1529 2, AcpiDmTableInfoHmat1c);
1530 if (ACPI_FAILURE(Status))
1535 SubtableOffset += 2;
1540 case ACPI_HMAT_TYPE_CACHE:
1542 HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
1543 SubtableOffset = sizeof (ACPI_HMAT_CACHE);
1545 /* Dump SMBIOS handles */
1547 if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1548 (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
1550 AcpiOsPrintf ("Invalid SMBIOS handle number\n");
1553 for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
1555 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1556 ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1557 2, AcpiDmTableInfoHmat2a);
1558 if (ACPI_FAILURE (Status))
1563 SubtableOffset += 2;
1573 /* Point to next HMAT structure subtable */
1575 Offset += (HmatStruct->Length);