1 /******************************************************************************
3 * Module Name: dmtbdump - Dump ACPI data tables that contain no AML code
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
117 #include "accommon.h"
118 #include "acdisasm.h"
119 #include "actables.h"
121 /* This module used for application-level code only */
123 #define _COMPONENT ACPI_CA_DISASSEMBLER
124 ACPI_MODULE_NAME ("dmtbdump")
127 /* Local prototypes */
130 AcpiDmValidateFadtLength (
139 UINT32 AbsoluteOffset
,
143 /*******************************************************************************
145 * FUNCTION: AcpiDmDumpBuffer
147 * PARAMETERS: Table - ACPI Table or subtable
148 * BufferOffset - Offset of buffer from Table above
149 * Length - Length of the buffer
150 * AbsoluteOffset - Offset of buffer in the main ACPI table
151 * Header - Name of the buffer field (printed on the
156 * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
157 * disassembler output format.)
159 ******************************************************************************/
166 UINT32 AbsoluteOffset
,
178 Buffer
= ACPI_CAST_PTR (UINT8
, Table
) + BufferOffset
;
186 AcpiDmLineHeader (AbsoluteOffset
,
187 ((Length
- i
) > 16) ? 16 : (Length
- i
), Header
);
191 AcpiOsPrintf ("%.02X ", *Buffer
);
201 /*******************************************************************************
203 * FUNCTION: AcpiDmDumpRsdp
205 * PARAMETERS: Table - A RSDP
207 * RETURN: Length of the table (there is not always a length field,
208 * use revision or length if available (ACPI 2.0+))
210 * DESCRIPTION: Format the contents of a RSDP
212 ******************************************************************************/
216 ACPI_TABLE_HEADER
*Table
)
218 ACPI_TABLE_RSDP
*Rsdp
= ACPI_CAST_PTR (ACPI_TABLE_RSDP
, Table
);
219 UINT32 Length
= sizeof (ACPI_RSDP_COMMON
);
223 /* Dump the common ACPI 1.0 portion */
225 AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoRsdp1
);
227 /* Validate the first checksum */
229 Checksum
= AcpiDmGenerateChecksum (Rsdp
, sizeof (ACPI_RSDP_COMMON
),
231 if (Checksum
!= Rsdp
->Checksum
)
233 AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
237 /* The RSDP for ACPI 2.0+ contains more data and has a Length field */
239 if (Rsdp
->Revision
> 0)
241 Length
= Rsdp
->Length
;
242 AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoRsdp2
);
244 /* Validate the extended checksum over entire RSDP */
246 Checksum
= AcpiDmGenerateChecksum (Rsdp
, sizeof (ACPI_TABLE_RSDP
),
247 Rsdp
->ExtendedChecksum
);
248 if (Checksum
!= Rsdp
->ExtendedChecksum
)
251 "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n",
260 /*******************************************************************************
262 * FUNCTION: AcpiDmDumpRsdt
264 * PARAMETERS: Table - A RSDT
268 * DESCRIPTION: Format the contents of a RSDT
270 ******************************************************************************/
274 ACPI_TABLE_HEADER
*Table
)
282 /* Point to start of table pointer array */
284 Array
= ACPI_CAST_PTR (ACPI_TABLE_RSDT
, Table
)->TableOffsetEntry
;
285 Offset
= sizeof (ACPI_TABLE_HEADER
);
287 /* RSDT uses 32-bit pointers */
289 Entries
= (Table
->Length
- sizeof (ACPI_TABLE_HEADER
)) / sizeof (UINT32
);
291 for (i
= 0; i
< Entries
; i
++)
293 AcpiDmLineHeader2 (Offset
, sizeof (UINT32
), "ACPI Table Address", i
);
294 AcpiOsPrintf ("%8.8X\n", Array
[i
]);
295 Offset
+= sizeof (UINT32
);
300 /*******************************************************************************
302 * FUNCTION: AcpiDmDumpXsdt
304 * PARAMETERS: Table - A XSDT
308 * DESCRIPTION: Format the contents of a XSDT
310 ******************************************************************************/
314 ACPI_TABLE_HEADER
*Table
)
322 /* Point to start of table pointer array */
324 Array
= ACPI_CAST_PTR (ACPI_TABLE_XSDT
, Table
)->TableOffsetEntry
;
325 Offset
= sizeof (ACPI_TABLE_HEADER
);
327 /* XSDT uses 64-bit pointers */
329 Entries
= (Table
->Length
- sizeof (ACPI_TABLE_HEADER
)) / sizeof (UINT64
);
331 for (i
= 0; i
< Entries
; i
++)
333 AcpiDmLineHeader2 (Offset
, sizeof (UINT64
), "ACPI Table Address", i
);
334 AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array
[i
]));
335 Offset
+= sizeof (UINT64
);
340 /*******************************************************************************
342 * FUNCTION: AcpiDmDumpFadt
344 * PARAMETERS: Table - A FADT
348 * DESCRIPTION: Format the contents of a FADT
350 * NOTE: We cannot depend on the FADT version to indicate the actual
351 * contents of the FADT because of BIOS bugs. The table length
352 * is the only reliable indicator.
354 ******************************************************************************/
358 ACPI_TABLE_HEADER
*Table
)
361 /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
363 AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoFadt1
);
365 /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
367 if ((Table
->Length
> ACPI_FADT_V1_SIZE
) &&
368 (Table
->Length
<= ACPI_FADT_V2_SIZE
))
370 AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoFadt2
);
373 /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
375 else if (Table
->Length
> ACPI_FADT_V2_SIZE
)
377 AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoFadt3
);
379 /* Check for FADT revision 5 fields and up (ACPI 5.0+) */
381 if (Table
->Length
> ACPI_FADT_V3_SIZE
)
383 AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoFadt5
);
387 /* Validate various fields in the FADT, including length */
389 AcpiTbCreateLocalFadt (Table
, Table
->Length
);
391 /* Validate FADT length against the revision */
393 AcpiDmValidateFadtLength (Table
->Revision
, Table
->Length
);
397 /*******************************************************************************
399 * FUNCTION: AcpiDmValidateFadtLength
401 * PARAMETERS: Revision - FADT revision (Header->Revision)
402 * Length - FADT length (Header->Length
406 * DESCRIPTION: Check the FADT revision against the expected table length for
407 * that revision. Issue a warning if the length is not what was
408 * expected. This seems to be such a common BIOS bug that the
409 * FADT revision has been rendered virtually meaningless.
411 ******************************************************************************/
414 AcpiDmValidateFadtLength (
418 UINT32 ExpectedLength
;
425 AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n");
430 ExpectedLength
= ACPI_FADT_V1_SIZE
;
435 ExpectedLength
= ACPI_FADT_V2_SIZE
;
441 ExpectedLength
= ACPI_FADT_V3_SIZE
;
446 ExpectedLength
= ACPI_FADT_V5_SIZE
;
454 if (Length
== ExpectedLength
)
460 "\n// ACPI Warning: FADT revision %X does not match length: found %X expected %X\n",
461 Revision
, Length
, ExpectedLength
);
465 /*******************************************************************************
467 * FUNCTION: AcpiDmDumpAsf
469 * PARAMETERS: Table - A ASF table
473 * DESCRIPTION: Format the contents of a ASF table
475 ******************************************************************************/
479 ACPI_TABLE_HEADER
*Table
)
482 UINT32 Offset
= sizeof (ACPI_TABLE_HEADER
);
483 ACPI_ASF_INFO
*SubTable
;
484 ACPI_DMTABLE_INFO
*InfoTable
;
485 ACPI_DMTABLE_INFO
*DataInfoTable
= NULL
;
486 UINT8
*DataTable
= NULL
;
487 UINT32 DataCount
= 0;
488 UINT32 DataLength
= 0;
489 UINT32 DataOffset
= 0;
494 /* No main table, only subtables */
496 SubTable
= ACPI_ADD_PTR (ACPI_ASF_INFO
, Table
, Offset
);
497 while (Offset
< Table
->Length
)
499 /* Common subtable header */
501 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
502 SubTable
->Header
.Length
, AcpiDmTableInfoAsfHdr
);
503 if (ACPI_FAILURE (Status
))
508 /* The actual type is the lower 7 bits of Type */
510 Type
= (UINT8
) (SubTable
->Header
.Type
& 0x7F);
514 case ACPI_ASF_TYPE_INFO
:
516 InfoTable
= AcpiDmTableInfoAsf0
;
519 case ACPI_ASF_TYPE_ALERT
:
521 InfoTable
= AcpiDmTableInfoAsf1
;
522 DataInfoTable
= AcpiDmTableInfoAsf1a
;
523 DataTable
= ACPI_ADD_PTR (UINT8
, SubTable
, sizeof (ACPI_ASF_ALERT
));
524 DataCount
= ACPI_CAST_PTR (ACPI_ASF_ALERT
, SubTable
)->Alerts
;
525 DataLength
= ACPI_CAST_PTR (ACPI_ASF_ALERT
, SubTable
)->DataLength
;
526 DataOffset
= Offset
+ sizeof (ACPI_ASF_ALERT
);
529 case ACPI_ASF_TYPE_CONTROL
:
531 InfoTable
= AcpiDmTableInfoAsf2
;
532 DataInfoTable
= AcpiDmTableInfoAsf2a
;
533 DataTable
= ACPI_ADD_PTR (UINT8
, SubTable
, sizeof (ACPI_ASF_REMOTE
));
534 DataCount
= ACPI_CAST_PTR (ACPI_ASF_REMOTE
, SubTable
)->Controls
;
535 DataLength
= ACPI_CAST_PTR (ACPI_ASF_REMOTE
, SubTable
)->DataLength
;
536 DataOffset
= Offset
+ sizeof (ACPI_ASF_REMOTE
);
539 case ACPI_ASF_TYPE_BOOT
:
541 InfoTable
= AcpiDmTableInfoAsf3
;
544 case ACPI_ASF_TYPE_ADDRESS
:
546 InfoTable
= AcpiDmTableInfoAsf4
;
547 DataTable
= ACPI_ADD_PTR (UINT8
, SubTable
, sizeof (ACPI_ASF_ADDRESS
));
548 DataLength
= ACPI_CAST_PTR (ACPI_ASF_ADDRESS
, SubTable
)->Devices
;
549 DataOffset
= Offset
+ sizeof (ACPI_ASF_ADDRESS
);
554 AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable
->Header
.Type
);
558 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
559 SubTable
->Header
.Length
, InfoTable
);
560 if (ACPI_FAILURE (Status
))
565 /* Dump variable-length extra data */
569 case ACPI_ASF_TYPE_ALERT
:
570 case ACPI_ASF_TYPE_CONTROL
:
572 for (i
= 0; i
< DataCount
; i
++)
575 Status
= AcpiDmDumpTable (Table
->Length
, DataOffset
,
576 DataTable
, DataLength
, DataInfoTable
);
577 if (ACPI_FAILURE (Status
))
582 DataTable
= ACPI_ADD_PTR (UINT8
, DataTable
, DataLength
);
583 DataOffset
+= DataLength
;
587 case ACPI_ASF_TYPE_ADDRESS
:
589 for (i
= 0; i
< DataLength
; i
++)
593 AcpiDmLineHeader (DataOffset
, 1, "Addresses");
596 AcpiOsPrintf ("%2.2X ", *DataTable
);
599 if (DataOffset
> Table
->Length
)
601 AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
616 /* Point to next subtable */
618 if (!SubTable
->Header
.Length
)
620 AcpiOsPrintf ("Invalid zero subtable header length\n");
624 Offset
+= SubTable
->Header
.Length
;
625 SubTable
= ACPI_ADD_PTR (ACPI_ASF_INFO
, SubTable
, SubTable
->Header
.Length
);
630 /*******************************************************************************
632 * FUNCTION: AcpiDmDumpCpep
634 * PARAMETERS: Table - A CPEP table
638 * DESCRIPTION: Format the contents of a CPEP. This table type consists
639 * of an open-ended number of subtables.
641 ******************************************************************************/
645 ACPI_TABLE_HEADER
*Table
)
648 ACPI_CPEP_POLLING
*SubTable
;
649 UINT32 Length
= Table
->Length
;
650 UINT32 Offset
= sizeof (ACPI_TABLE_CPEP
);
655 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoCpep
);
656 if (ACPI_FAILURE (Status
))
663 SubTable
= ACPI_ADD_PTR (ACPI_CPEP_POLLING
, Table
, Offset
);
664 while (Offset
< Table
->Length
)
667 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
668 SubTable
->Header
.Length
, AcpiDmTableInfoCpep0
);
669 if (ACPI_FAILURE (Status
))
674 /* Point to next subtable */
676 Offset
+= SubTable
->Header
.Length
;
677 SubTable
= ACPI_ADD_PTR (ACPI_CPEP_POLLING
, SubTable
,
678 SubTable
->Header
.Length
);
683 /*******************************************************************************
685 * FUNCTION: AcpiDmDumpCsrt
687 * PARAMETERS: Table - A CSRT table
691 * DESCRIPTION: Format the contents of a CSRT. This table type consists
692 * of an open-ended number of subtables.
694 ******************************************************************************/
698 ACPI_TABLE_HEADER
*Table
)
701 ACPI_CSRT_GROUP
*SubTable
;
702 ACPI_CSRT_SHARED_INFO
*SharedInfoTable
;
703 ACPI_CSRT_DESCRIPTOR
*SubSubTable
;
704 UINT32 Length
= Table
->Length
;
705 UINT32 Offset
= sizeof (ACPI_TABLE_CSRT
);
711 /* The main table only contains the ACPI header, thus already handled */
713 /* Subtables (Resource Groups) */
715 SubTable
= ACPI_ADD_PTR (ACPI_CSRT_GROUP
, Table
, Offset
);
716 while (Offset
< Table
->Length
)
718 /* Resource group subtable */
721 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
722 SubTable
->Length
, AcpiDmTableInfoCsrt0
);
723 if (ACPI_FAILURE (Status
))
728 /* Shared info subtable (One per resource group) */
730 SubOffset
= sizeof (ACPI_CSRT_GROUP
);
731 SharedInfoTable
= ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO
, Table
,
735 Status
= AcpiDmDumpTable (Length
, Offset
+ SubOffset
, SharedInfoTable
,
736 sizeof (ACPI_CSRT_SHARED_INFO
), AcpiDmTableInfoCsrt1
);
737 if (ACPI_FAILURE (Status
))
742 SubOffset
+= SubTable
->SharedInfoLength
;
744 /* Sub-Subtables (Resource Descriptors) */
746 SubSubTable
= ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR
, Table
,
749 while ((SubOffset
< SubTable
->Length
) &&
750 ((Offset
+ SubOffset
) < Table
->Length
))
753 Status
= AcpiDmDumpTable (Length
, Offset
+ SubOffset
, SubSubTable
,
754 SubSubTable
->Length
, AcpiDmTableInfoCsrt2
);
755 if (ACPI_FAILURE (Status
))
760 SubSubOffset
= sizeof (ACPI_CSRT_DESCRIPTOR
);
762 /* Resource-specific info buffer */
764 InfoLength
= SubSubTable
->Length
- SubSubOffset
;
766 AcpiDmDumpBuffer (SubSubTable
, SubSubOffset
, InfoLength
,
767 Offset
+ SubOffset
+ SubSubOffset
, "ResourceInfo");
768 SubSubOffset
+= InfoLength
;
770 /* Point to next sub-subtable */
772 SubOffset
+= SubSubTable
->Length
;
773 SubSubTable
= ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR
, SubSubTable
,
774 SubSubTable
->Length
);
777 /* Point to next subtable */
779 Offset
+= SubTable
->Length
;
780 SubTable
= ACPI_ADD_PTR (ACPI_CSRT_GROUP
, SubTable
,
786 /*******************************************************************************
788 * FUNCTION: AcpiDmDumpDbg2
790 * PARAMETERS: Table - A DBG2 table
794 * DESCRIPTION: Format the contents of a DBG2. This table type consists
795 * of an open-ended number of subtables.
797 ******************************************************************************/
801 ACPI_TABLE_HEADER
*Table
)
804 ACPI_DBG2_DEVICE
*SubTable
;
805 UINT32 Length
= Table
->Length
;
806 UINT32 Offset
= sizeof (ACPI_TABLE_DBG2
);
809 UINT32 AbsoluteOffset
;
815 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoDbg2
);
816 if (ACPI_FAILURE (Status
))
823 SubTable
= ACPI_ADD_PTR (ACPI_DBG2_DEVICE
, Table
, Offset
);
824 while (Offset
< Table
->Length
)
827 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
828 SubTable
->Length
, AcpiDmTableInfoDbg2Device
);
829 if (ACPI_FAILURE (Status
))
834 /* Dump the BaseAddress array */
836 for (i
= 0; i
< SubTable
->RegisterCount
; i
++)
838 ArrayOffset
= SubTable
->BaseAddressOffset
+
839 (sizeof (ACPI_GENERIC_ADDRESS
) * i
);
840 AbsoluteOffset
= Offset
+ ArrayOffset
;
841 Array
= (UINT8
*) SubTable
+ ArrayOffset
;
843 Status
= AcpiDmDumpTable (Length
, AbsoluteOffset
, Array
,
844 SubTable
->Length
, AcpiDmTableInfoDbg2Addr
);
845 if (ACPI_FAILURE (Status
))
851 /* Dump the AddressSize array */
853 for (i
= 0; i
< SubTable
->RegisterCount
; i
++)
855 ArrayOffset
= SubTable
->AddressSizeOffset
+
856 (sizeof (UINT32
) * i
);
857 AbsoluteOffset
= Offset
+ ArrayOffset
;
858 Array
= (UINT8
*) SubTable
+ ArrayOffset
;
860 Status
= AcpiDmDumpTable (Length
, AbsoluteOffset
, Array
,
861 SubTable
->Length
, AcpiDmTableInfoDbg2Size
);
862 if (ACPI_FAILURE (Status
))
868 /* Dump the Namestring (required) */
871 ArrayOffset
= SubTable
->NamepathOffset
;
872 AbsoluteOffset
= Offset
+ ArrayOffset
;
873 Array
= (UINT8
*) SubTable
+ ArrayOffset
;
875 Status
= AcpiDmDumpTable (Length
, AbsoluteOffset
, Array
,
876 SubTable
->Length
, AcpiDmTableInfoDbg2Name
);
877 if (ACPI_FAILURE (Status
))
882 /* Dump the OemData (optional) */
884 if (SubTable
->OemDataOffset
)
886 AcpiDmDumpBuffer (SubTable
, SubTable
->OemDataOffset
, SubTable
->OemDataLength
,
887 Offset
+ SubTable
->OemDataOffset
, "OEM Data");
890 /* Point to next subtable */
892 Offset
+= SubTable
->Length
;
893 SubTable
= ACPI_ADD_PTR (ACPI_DBG2_DEVICE
, SubTable
,
899 /*******************************************************************************
901 * FUNCTION: AcpiDmDumpDmar
903 * PARAMETERS: Table - A DMAR table
907 * DESCRIPTION: Format the contents of a DMAR. This table type consists
908 * of an open-ended number of subtables.
910 ******************************************************************************/
915 ACPI_TABLE_HEADER
*Table
)
918 ACPI_DMAR_HEADER
*SubTable
;
919 UINT32 Length
= Table
->Length
;
920 UINT32 Offset
= sizeof (ACPI_TABLE_DMAR
);
921 ACPI_DMTABLE_INFO
*InfoTable
;
922 ACPI_DMAR_DEVICE_SCOPE
*ScopeTable
;
930 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoDmar
);
931 if (ACPI_FAILURE (Status
))
938 SubTable
= ACPI_ADD_PTR (ACPI_DMAR_HEADER
, Table
, Offset
);
939 while (Offset
< Table
->Length
)
941 /* Common subtable header */
944 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
945 SubTable
->Length
, AcpiDmTableInfoDmarHdr
);
946 if (ACPI_FAILURE (Status
))
952 switch (SubTable
->Type
)
954 case ACPI_DMAR_TYPE_HARDWARE_UNIT
:
956 InfoTable
= AcpiDmTableInfoDmar0
;
957 ScopeOffset
= sizeof (ACPI_DMAR_HARDWARE_UNIT
);
960 case ACPI_DMAR_TYPE_RESERVED_MEMORY
:
962 InfoTable
= AcpiDmTableInfoDmar1
;
963 ScopeOffset
= sizeof (ACPI_DMAR_RESERVED_MEMORY
);
966 case ACPI_DMAR_TYPE_ROOT_ATS
:
968 InfoTable
= AcpiDmTableInfoDmar2
;
969 ScopeOffset
= sizeof (ACPI_DMAR_ATSR
);
972 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY
:
974 InfoTable
= AcpiDmTableInfoDmar3
;
975 ScopeOffset
= sizeof (ACPI_DMAR_RHSA
);
978 case ACPI_DMAR_TYPE_NAMESPACE
:
980 InfoTable
= AcpiDmTableInfoDmar4
;
981 ScopeOffset
= sizeof (ACPI_DMAR_ANDD
);
986 AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable
->Type
);
990 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
991 SubTable
->Length
, InfoTable
);
992 if (ACPI_FAILURE (Status
))
998 * Dump the optional device scope entries
1000 if ((SubTable
->Type
== ACPI_DMAR_TYPE_HARDWARE_AFFINITY
) ||
1001 (SubTable
->Type
== ACPI_DMAR_TYPE_NAMESPACE
))
1003 /* These types do not support device scopes */
1008 ScopeTable
= ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE
, SubTable
, ScopeOffset
);
1009 while (ScopeOffset
< SubTable
->Length
)
1011 AcpiOsPrintf ("\n");
1012 Status
= AcpiDmDumpTable (Length
, Offset
+ ScopeOffset
, ScopeTable
,
1013 ScopeTable
->Length
, AcpiDmTableInfoDmarScope
);
1014 if (ACPI_FAILURE (Status
))
1018 AcpiOsPrintf ("\n");
1020 /* Dump the PCI Path entries for this device scope */
1022 PathOffset
= sizeof (ACPI_DMAR_DEVICE_SCOPE
); /* Path entries start at this offset */
1024 PciPath
= ACPI_ADD_PTR (UINT8
, ScopeTable
,
1025 sizeof (ACPI_DMAR_DEVICE_SCOPE
));
1027 while (PathOffset
< ScopeTable
->Length
)
1029 AcpiDmLineHeader ((PathOffset
+ ScopeOffset
+ Offset
), 2, "PCI Path");
1030 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath
[0], PciPath
[1]);
1032 /* Point to next PCI Path entry */
1036 AcpiOsPrintf ("\n");
1039 /* Point to next device scope entry */
1041 ScopeOffset
+= ScopeTable
->Length
;
1042 ScopeTable
= ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE
,
1043 ScopeTable
, ScopeTable
->Length
);
1047 /* Point to next subtable */
1049 Offset
+= SubTable
->Length
;
1050 SubTable
= ACPI_ADD_PTR (ACPI_DMAR_HEADER
, SubTable
, SubTable
->Length
);
1055 /*******************************************************************************
1057 * FUNCTION: AcpiDmDumpEinj
1059 * PARAMETERS: Table - A EINJ table
1063 * DESCRIPTION: Format the contents of a EINJ. This table type consists
1064 * of an open-ended number of subtables.
1066 ******************************************************************************/
1070 ACPI_TABLE_HEADER
*Table
)
1073 ACPI_WHEA_HEADER
*SubTable
;
1074 UINT32 Length
= Table
->Length
;
1075 UINT32 Offset
= sizeof (ACPI_TABLE_EINJ
);
1080 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoEinj
);
1081 if (ACPI_FAILURE (Status
))
1088 SubTable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, Table
, Offset
);
1089 while (Offset
< Table
->Length
)
1091 AcpiOsPrintf ("\n");
1092 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1093 sizeof (ACPI_WHEA_HEADER
), AcpiDmTableInfoEinj0
);
1094 if (ACPI_FAILURE (Status
))
1099 /* Point to next subtable (each subtable is of fixed length) */
1101 Offset
+= sizeof (ACPI_WHEA_HEADER
);
1102 SubTable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, SubTable
,
1103 sizeof (ACPI_WHEA_HEADER
));
1108 /*******************************************************************************
1110 * FUNCTION: AcpiDmDumpErst
1112 * PARAMETERS: Table - A ERST table
1116 * DESCRIPTION: Format the contents of a ERST. This table type consists
1117 * of an open-ended number of subtables.
1119 ******************************************************************************/
1123 ACPI_TABLE_HEADER
*Table
)
1126 ACPI_WHEA_HEADER
*SubTable
;
1127 UINT32 Length
= Table
->Length
;
1128 UINT32 Offset
= sizeof (ACPI_TABLE_ERST
);
1133 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoErst
);
1134 if (ACPI_FAILURE (Status
))
1141 SubTable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, Table
, Offset
);
1142 while (Offset
< Table
->Length
)
1144 AcpiOsPrintf ("\n");
1145 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1146 sizeof (ACPI_WHEA_HEADER
), AcpiDmTableInfoErst0
);
1147 if (ACPI_FAILURE (Status
))
1152 /* Point to next subtable (each subtable is of fixed length) */
1154 Offset
+= sizeof (ACPI_WHEA_HEADER
);
1155 SubTable
= ACPI_ADD_PTR (ACPI_WHEA_HEADER
, SubTable
,
1156 sizeof (ACPI_WHEA_HEADER
));
1161 /*******************************************************************************
1163 * FUNCTION: AcpiDmDumpFpdt
1165 * PARAMETERS: Table - A FPDT table
1169 * DESCRIPTION: Format the contents of a FPDT. This table type consists
1170 * of an open-ended number of subtables.
1172 ******************************************************************************/
1176 ACPI_TABLE_HEADER
*Table
)
1179 ACPI_FPDT_HEADER
*SubTable
;
1180 UINT32 Length
= Table
->Length
;
1181 UINT32 Offset
= sizeof (ACPI_TABLE_FPDT
);
1182 ACPI_DMTABLE_INFO
*InfoTable
;
1185 /* There is no main table (other than the standard ACPI header) */
1189 SubTable
= ACPI_ADD_PTR (ACPI_FPDT_HEADER
, Table
, Offset
);
1190 while (Offset
< Table
->Length
)
1192 /* Common subtable header */
1194 AcpiOsPrintf ("\n");
1195 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1196 SubTable
->Length
, AcpiDmTableInfoFpdtHdr
);
1197 if (ACPI_FAILURE (Status
))
1202 switch (SubTable
->Type
)
1204 case ACPI_FPDT_TYPE_BOOT
:
1206 InfoTable
= AcpiDmTableInfoFpdt0
;
1209 case ACPI_FPDT_TYPE_S3PERF
:
1211 InfoTable
= AcpiDmTableInfoFpdt1
;
1216 AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable
->Type
);
1218 /* Attempt to continue */
1220 if (!SubTable
->Length
)
1222 AcpiOsPrintf ("Invalid zero length subtable\n");
1228 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1229 SubTable
->Length
, InfoTable
);
1230 if (ACPI_FAILURE (Status
))
1236 /* Point to next subtable */
1238 Offset
+= SubTable
->Length
;
1239 SubTable
= ACPI_ADD_PTR (ACPI_FPDT_HEADER
, SubTable
, SubTable
->Length
);
1244 /*******************************************************************************
1246 * FUNCTION: AcpiDmDumpGtdt
1248 * PARAMETERS: Table - A GTDT table
1252 * DESCRIPTION: Format the contents of a GTDT. This table type consists
1253 * of an open-ended number of subtables.
1255 ******************************************************************************/
1259 ACPI_TABLE_HEADER
*Table
)
1262 ACPI_GTDT_HEADER
*SubTable
;
1263 UINT32 Length
= Table
->Length
;
1264 UINT32 Offset
= sizeof (ACPI_TABLE_GTDT
);
1265 ACPI_DMTABLE_INFO
*InfoTable
;
1266 UINT32 SubTableLength
;
1268 ACPI_GTDT_TIMER_ENTRY
*GtxTable
;
1273 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoGtdt
);
1274 if (ACPI_FAILURE (Status
))
1281 SubTable
= ACPI_ADD_PTR (ACPI_GTDT_HEADER
, Table
, Offset
);
1282 while (Offset
< Table
->Length
)
1284 /* Common subtable header */
1286 AcpiOsPrintf ("\n");
1287 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1288 SubTable
->Length
, AcpiDmTableInfoGtdtHdr
);
1289 if (ACPI_FAILURE (Status
))
1295 switch (SubTable
->Type
)
1297 case ACPI_GTDT_TYPE_TIMER_BLOCK
:
1299 SubTableLength
= sizeof (ACPI_GTDT_TIMER_BLOCK
);
1300 GtCount
= (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK
,
1301 SubTable
))->TimerCount
;
1303 InfoTable
= AcpiDmTableInfoGtdt0
;
1306 case ACPI_GTDT_TYPE_WATCHDOG
:
1308 SubTableLength
= sizeof (ACPI_GTDT_WATCHDOG
);
1310 InfoTable
= AcpiDmTableInfoGtdt1
;
1315 /* Cannot continue on unknown type - no length */
1317 AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable
->Type
);
1321 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1322 SubTable
->Length
, InfoTable
);
1323 if (ACPI_FAILURE (Status
))
1328 /* Point to end of current subtable (each subtable above is of fixed length) */
1330 Offset
+= SubTableLength
;
1332 /* If there are any Gt Timer Blocks from above, dump them now */
1336 GtxTable
= ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY
, SubTable
, SubTableLength
);
1337 SubTableLength
+= GtCount
* sizeof (ACPI_GTDT_TIMER_ENTRY
);
1341 AcpiOsPrintf ("\n");
1342 Status
= AcpiDmDumpTable (Length
, Offset
, GtxTable
,
1343 sizeof (ACPI_GTDT_TIMER_ENTRY
), AcpiDmTableInfoGtdt0a
);
1344 if (ACPI_FAILURE (Status
))
1348 Offset
+= sizeof (ACPI_GTDT_TIMER_ENTRY
);
1354 /* Point to next subtable */
1356 SubTable
= ACPI_ADD_PTR (ACPI_GTDT_HEADER
, SubTable
, SubTableLength
);
1361 /*******************************************************************************
1363 * FUNCTION: AcpiDmDumpHest
1365 * PARAMETERS: Table - A HEST table
1369 * DESCRIPTION: Format the contents of a HEST. This table type consists
1370 * of an open-ended number of subtables.
1372 ******************************************************************************/
1376 ACPI_TABLE_HEADER
*Table
)
1379 ACPI_HEST_HEADER
*SubTable
;
1380 UINT32 Length
= Table
->Length
;
1381 UINT32 Offset
= sizeof (ACPI_TABLE_HEST
);
1382 ACPI_DMTABLE_INFO
*InfoTable
;
1383 UINT32 SubTableLength
;
1385 ACPI_HEST_IA_ERROR_BANK
*BankTable
;
1390 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoHest
);
1391 if (ACPI_FAILURE (Status
))
1398 SubTable
= ACPI_ADD_PTR (ACPI_HEST_HEADER
, Table
, Offset
);
1399 while (Offset
< Table
->Length
)
1402 switch (SubTable
->Type
)
1404 case ACPI_HEST_TYPE_IA32_CHECK
:
1406 InfoTable
= AcpiDmTableInfoHest0
;
1407 SubTableLength
= sizeof (ACPI_HEST_IA_MACHINE_CHECK
);
1408 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK
,
1409 SubTable
))->NumHardwareBanks
;
1412 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
1414 InfoTable
= AcpiDmTableInfoHest1
;
1415 SubTableLength
= sizeof (ACPI_HEST_IA_CORRECTED
);
1416 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED
,
1417 SubTable
))->NumHardwareBanks
;
1420 case ACPI_HEST_TYPE_IA32_NMI
:
1422 InfoTable
= AcpiDmTableInfoHest2
;
1423 SubTableLength
= sizeof (ACPI_HEST_IA_NMI
);
1426 case ACPI_HEST_TYPE_AER_ROOT_PORT
:
1428 InfoTable
= AcpiDmTableInfoHest6
;
1429 SubTableLength
= sizeof (ACPI_HEST_AER_ROOT
);
1432 case ACPI_HEST_TYPE_AER_ENDPOINT
:
1434 InfoTable
= AcpiDmTableInfoHest7
;
1435 SubTableLength
= sizeof (ACPI_HEST_AER
);
1438 case ACPI_HEST_TYPE_AER_BRIDGE
:
1440 InfoTable
= AcpiDmTableInfoHest8
;
1441 SubTableLength
= sizeof (ACPI_HEST_AER_BRIDGE
);
1444 case ACPI_HEST_TYPE_GENERIC_ERROR
:
1446 InfoTable
= AcpiDmTableInfoHest9
;
1447 SubTableLength
= sizeof (ACPI_HEST_GENERIC
);
1452 /* Cannot continue on unknown type - no length */
1454 AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable
->Type
);
1458 AcpiOsPrintf ("\n");
1459 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1460 SubTableLength
, InfoTable
);
1461 if (ACPI_FAILURE (Status
))
1466 /* Point to end of current subtable (each subtable above is of fixed length) */
1468 Offset
+= SubTableLength
;
1470 /* If there are any (fixed-length) Error Banks from above, dump them now */
1474 BankTable
= ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK
, SubTable
, SubTableLength
);
1475 SubTableLength
+= BankCount
* sizeof (ACPI_HEST_IA_ERROR_BANK
);
1479 AcpiOsPrintf ("\n");
1480 Status
= AcpiDmDumpTable (Length
, Offset
, BankTable
,
1481 sizeof (ACPI_HEST_IA_ERROR_BANK
), AcpiDmTableInfoHestBank
);
1482 if (ACPI_FAILURE (Status
))
1486 Offset
+= sizeof (ACPI_HEST_IA_ERROR_BANK
);
1492 /* Point to next subtable */
1494 SubTable
= ACPI_ADD_PTR (ACPI_HEST_HEADER
, SubTable
, SubTableLength
);
1499 /*******************************************************************************
1501 * FUNCTION: AcpiDmDumpIvrs
1503 * PARAMETERS: Table - A IVRS table
1507 * DESCRIPTION: Format the contents of a IVRS
1509 ******************************************************************************/
1511 static UINT8 EntrySizes
[] = {4,8,16,32};
1515 ACPI_TABLE_HEADER
*Table
)
1518 UINT32 Offset
= sizeof (ACPI_TABLE_IVRS
);
1522 ACPI_IVRS_DE_HEADER
*DeviceEntry
;
1523 ACPI_IVRS_HEADER
*SubTable
;
1524 ACPI_DMTABLE_INFO
*InfoTable
;
1529 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoIvrs
);
1530 if (ACPI_FAILURE (Status
))
1537 SubTable
= ACPI_ADD_PTR (ACPI_IVRS_HEADER
, Table
, Offset
);
1538 while (Offset
< Table
->Length
)
1540 /* Common subtable header */
1542 AcpiOsPrintf ("\n");
1543 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1544 SubTable
->Length
, AcpiDmTableInfoIvrsHdr
);
1545 if (ACPI_FAILURE (Status
))
1550 switch (SubTable
->Type
)
1552 case ACPI_IVRS_TYPE_HARDWARE
:
1554 InfoTable
= AcpiDmTableInfoIvrs0
;
1557 case ACPI_IVRS_TYPE_MEMORY1
:
1558 case ACPI_IVRS_TYPE_MEMORY2
:
1559 case ACPI_IVRS_TYPE_MEMORY3
:
1561 InfoTable
= AcpiDmTableInfoIvrs1
;
1566 AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
1569 /* Attempt to continue */
1571 if (!SubTable
->Length
)
1573 AcpiOsPrintf ("Invalid zero length subtable\n");
1579 /* Dump the subtable */
1581 AcpiOsPrintf ("\n");
1582 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1583 SubTable
->Length
, InfoTable
);
1584 if (ACPI_FAILURE (Status
))
1589 /* The hardware subtable can contain multiple device entries */
1591 if (SubTable
->Type
== ACPI_IVRS_TYPE_HARDWARE
)
1593 EntryOffset
= Offset
+ sizeof (ACPI_IVRS_HARDWARE
);
1594 DeviceEntry
= ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER
, SubTable
,
1595 sizeof (ACPI_IVRS_HARDWARE
));
1597 while (EntryOffset
< (Offset
+ SubTable
->Length
))
1599 AcpiOsPrintf ("\n");
1601 * Upper 2 bits of Type encode the length of the device entry
1605 * 10 = 16 byte - currently no entries defined
1606 * 11 = 32 byte - currently no entries defined
1608 EntryType
= DeviceEntry
->Type
;
1609 EntryLength
= EntrySizes
[EntryType
>> 6];
1613 /* 4-byte device entries */
1615 case ACPI_IVRS_TYPE_PAD4
:
1616 case ACPI_IVRS_TYPE_ALL
:
1617 case ACPI_IVRS_TYPE_SELECT
:
1618 case ACPI_IVRS_TYPE_START
:
1619 case ACPI_IVRS_TYPE_END
:
1621 InfoTable
= AcpiDmTableInfoIvrs4
;
1624 /* 8-byte entries, type A */
1626 case ACPI_IVRS_TYPE_ALIAS_SELECT
:
1627 case ACPI_IVRS_TYPE_ALIAS_START
:
1629 InfoTable
= AcpiDmTableInfoIvrs8a
;
1632 /* 8-byte entries, type B */
1634 case ACPI_IVRS_TYPE_PAD8
:
1635 case ACPI_IVRS_TYPE_EXT_SELECT
:
1636 case ACPI_IVRS_TYPE_EXT_START
:
1638 InfoTable
= AcpiDmTableInfoIvrs8b
;
1641 /* 8-byte entries, type C */
1643 case ACPI_IVRS_TYPE_SPECIAL
:
1645 InfoTable
= AcpiDmTableInfoIvrs8c
;
1649 InfoTable
= AcpiDmTableInfoIvrs4
;
1651 "\n**** Unknown IVRS device entry type/length: "
1652 "0x%.2X/0x%X at offset 0x%.4X: (header below)\n",
1653 EntryType
, EntryLength
, EntryOffset
);
1657 /* Dump the Device Entry */
1659 Status
= AcpiDmDumpTable (Table
->Length
, EntryOffset
,
1660 DeviceEntry
, EntryLength
, InfoTable
);
1662 EntryOffset
+= EntryLength
;
1663 DeviceEntry
= ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER
, DeviceEntry
,
1669 /* Point to next subtable */
1671 Offset
+= SubTable
->Length
;
1672 SubTable
= ACPI_ADD_PTR (ACPI_IVRS_HEADER
, SubTable
, SubTable
->Length
);
1677 /*******************************************************************************
1679 * FUNCTION: AcpiDmDumpLpit
1681 * PARAMETERS: Table - A LPIT table
1685 * DESCRIPTION: Format the contents of a LPIT. This table type consists
1686 * of an open-ended number of subtables. Note: There are no
1687 * entries in the main table. An LPIT consists of the table
1688 * header and then subtables only.
1690 ******************************************************************************/
1694 ACPI_TABLE_HEADER
*Table
)
1697 ACPI_LPIT_HEADER
*SubTable
;
1698 UINT32 Length
= Table
->Length
;
1699 UINT32 Offset
= sizeof (ACPI_TABLE_LPIT
);
1700 ACPI_DMTABLE_INFO
*InfoTable
;
1701 UINT32 SubTableLength
;
1706 SubTable
= ACPI_ADD_PTR (ACPI_LPIT_HEADER
, Table
, Offset
);
1707 while (Offset
< Table
->Length
)
1709 /* Common subtable header */
1711 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1712 sizeof (ACPI_LPIT_HEADER
), AcpiDmTableInfoLpitHdr
);
1713 if (ACPI_FAILURE (Status
))
1718 switch (SubTable
->Type
)
1720 case ACPI_LPIT_TYPE_NATIVE_CSTATE
:
1722 InfoTable
= AcpiDmTableInfoLpit0
;
1723 SubTableLength
= sizeof (ACPI_LPIT_NATIVE
);
1726 case ACPI_LPIT_TYPE_SIMPLE_IO
:
1728 InfoTable
= AcpiDmTableInfoLpit1
;
1729 SubTableLength
= sizeof (ACPI_LPIT_IO
);
1734 /* Cannot continue on unknown type - no length */
1736 AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable
->Type
);
1740 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1741 SubTableLength
, InfoTable
);
1742 if (ACPI_FAILURE (Status
))
1746 AcpiOsPrintf ("\n");
1748 /* Point to next subtable */
1750 Offset
+= SubTableLength
;
1751 SubTable
= ACPI_ADD_PTR (ACPI_LPIT_HEADER
, SubTable
, SubTableLength
);
1756 /*******************************************************************************
1758 * FUNCTION: AcpiDmDumpMadt
1760 * PARAMETERS: Table - A MADT table
1764 * DESCRIPTION: Format the contents of a MADT. This table type consists
1765 * of an open-ended number of subtables.
1767 ******************************************************************************/
1771 ACPI_TABLE_HEADER
*Table
)
1774 ACPI_SUBTABLE_HEADER
*SubTable
;
1775 UINT32 Length
= Table
->Length
;
1776 UINT32 Offset
= sizeof (ACPI_TABLE_MADT
);
1777 ACPI_DMTABLE_INFO
*InfoTable
;
1782 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoMadt
);
1783 if (ACPI_FAILURE (Status
))
1790 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, Table
, Offset
);
1791 while (Offset
< Table
->Length
)
1793 /* Common subtable header */
1795 AcpiOsPrintf ("\n");
1796 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1797 SubTable
->Length
, AcpiDmTableInfoMadtHdr
);
1798 if (ACPI_FAILURE (Status
))
1803 switch (SubTable
->Type
)
1805 case ACPI_MADT_TYPE_LOCAL_APIC
:
1807 InfoTable
= AcpiDmTableInfoMadt0
;
1810 case ACPI_MADT_TYPE_IO_APIC
:
1812 InfoTable
= AcpiDmTableInfoMadt1
;
1815 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE
:
1817 InfoTable
= AcpiDmTableInfoMadt2
;
1820 case ACPI_MADT_TYPE_NMI_SOURCE
:
1822 InfoTable
= AcpiDmTableInfoMadt3
;
1825 case ACPI_MADT_TYPE_LOCAL_APIC_NMI
:
1827 InfoTable
= AcpiDmTableInfoMadt4
;
1830 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE
:
1832 InfoTable
= AcpiDmTableInfoMadt5
;
1835 case ACPI_MADT_TYPE_IO_SAPIC
:
1837 InfoTable
= AcpiDmTableInfoMadt6
;
1840 case ACPI_MADT_TYPE_LOCAL_SAPIC
:
1842 InfoTable
= AcpiDmTableInfoMadt7
;
1845 case ACPI_MADT_TYPE_INTERRUPT_SOURCE
:
1847 InfoTable
= AcpiDmTableInfoMadt8
;
1850 case ACPI_MADT_TYPE_LOCAL_X2APIC
:
1852 InfoTable
= AcpiDmTableInfoMadt9
;
1855 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI
:
1857 InfoTable
= AcpiDmTableInfoMadt10
;
1860 case ACPI_MADT_TYPE_GENERIC_INTERRUPT
:
1862 InfoTable
= AcpiDmTableInfoMadt11
;
1865 case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR
:
1867 InfoTable
= AcpiDmTableInfoMadt12
;
1870 case ACPI_MADT_TYPE_GENERIC_MSI_FRAME
:
1872 InfoTable
= AcpiDmTableInfoMadt13
;
1875 case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR
:
1877 InfoTable
= AcpiDmTableInfoMadt14
;
1882 AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable
->Type
);
1884 /* Attempt to continue */
1886 if (!SubTable
->Length
)
1888 AcpiOsPrintf ("Invalid zero length subtable\n");
1894 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
1895 SubTable
->Length
, InfoTable
);
1896 if (ACPI_FAILURE (Status
))
1902 /* Point to next subtable */
1904 Offset
+= SubTable
->Length
;
1905 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, SubTable
, SubTable
->Length
);
1910 /*******************************************************************************
1912 * FUNCTION: AcpiDmDumpMcfg
1914 * PARAMETERS: Table - A MCFG Table
1918 * DESCRIPTION: Format the contents of a MCFG table
1920 ******************************************************************************/
1924 ACPI_TABLE_HEADER
*Table
)
1927 UINT32 Offset
= sizeof (ACPI_TABLE_MCFG
);
1928 ACPI_MCFG_ALLOCATION
*SubTable
;
1933 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoMcfg
);
1934 if (ACPI_FAILURE (Status
))
1941 SubTable
= ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION
, Table
, Offset
);
1942 while (Offset
< Table
->Length
)
1944 if (Offset
+ sizeof (ACPI_MCFG_ALLOCATION
) > Table
->Length
)
1946 AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
1947 sizeof (ACPI_MCFG_ALLOCATION
) - (Offset
- Table
->Length
));
1951 AcpiOsPrintf ("\n");
1952 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
1953 sizeof (ACPI_MCFG_ALLOCATION
), AcpiDmTableInfoMcfg0
);
1954 if (ACPI_FAILURE (Status
))
1959 /* Point to next subtable (each subtable is of fixed length) */
1961 Offset
+= sizeof (ACPI_MCFG_ALLOCATION
);
1962 SubTable
= ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION
, SubTable
,
1963 sizeof (ACPI_MCFG_ALLOCATION
));
1968 /*******************************************************************************
1970 * FUNCTION: AcpiDmDumpMpst
1972 * PARAMETERS: Table - A MPST Table
1976 * DESCRIPTION: Format the contents of a MPST table
1978 ******************************************************************************/
1982 ACPI_TABLE_HEADER
*Table
)
1985 UINT32 Offset
= sizeof (ACPI_TABLE_MPST
);
1986 ACPI_MPST_POWER_NODE
*SubTable0
;
1987 ACPI_MPST_POWER_STATE
*SubTable0A
;
1988 ACPI_MPST_COMPONENT
*SubTable0B
;
1989 ACPI_MPST_DATA_HDR
*SubTable1
;
1990 ACPI_MPST_POWER_DATA
*SubTable2
;
1991 UINT16 SubtableCount
;
1992 UINT32 PowerStateCount
;
1993 UINT32 ComponentCount
;
1998 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoMpst
);
1999 if (ACPI_FAILURE (Status
))
2004 /* Subtable: Memory Power Node(s) */
2006 SubtableCount
= (ACPI_CAST_PTR (ACPI_TABLE_MPST
, Table
))->PowerNodeCount
;
2007 SubTable0
= ACPI_ADD_PTR (ACPI_MPST_POWER_NODE
, Table
, Offset
);
2009 while ((Offset
< Table
->Length
) && SubtableCount
)
2011 AcpiOsPrintf ("\n");
2012 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable0
,
2013 sizeof (ACPI_MPST_POWER_NODE
), AcpiDmTableInfoMpst0
);
2014 if (ACPI_FAILURE (Status
))
2019 /* Extract the sub-subtable counts */
2021 PowerStateCount
= SubTable0
->NumPowerStates
;
2022 ComponentCount
= SubTable0
->NumPhysicalComponents
;
2023 Offset
+= sizeof (ACPI_MPST_POWER_NODE
);
2025 /* Sub-subtables - Memory Power State Structure(s) */
2027 SubTable0A
= ACPI_ADD_PTR (ACPI_MPST_POWER_STATE
, SubTable0
,
2028 sizeof (ACPI_MPST_POWER_NODE
));
2030 while (PowerStateCount
)
2032 AcpiOsPrintf ("\n");
2033 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable0A
,
2034 sizeof (ACPI_MPST_POWER_STATE
), AcpiDmTableInfoMpst0A
);
2035 if (ACPI_FAILURE (Status
))
2042 Offset
+= sizeof (ACPI_MPST_POWER_STATE
);
2045 /* Sub-subtables - Physical Component ID Structure(s) */
2047 SubTable0B
= ACPI_CAST_PTR (ACPI_MPST_COMPONENT
, SubTable0A
);
2051 AcpiOsPrintf ("\n");
2054 while (ComponentCount
)
2056 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable0B
,
2057 sizeof (ACPI_MPST_COMPONENT
), AcpiDmTableInfoMpst0B
);
2058 if (ACPI_FAILURE (Status
))
2065 Offset
+= sizeof (ACPI_MPST_COMPONENT
);
2068 /* Point to next Memory Power Node subtable */
2071 SubTable0
= ACPI_ADD_PTR (ACPI_MPST_POWER_NODE
, SubTable0
,
2072 sizeof (ACPI_MPST_POWER_NODE
) +
2073 (sizeof (ACPI_MPST_POWER_STATE
) * SubTable0
->NumPowerStates
) +
2074 (sizeof (ACPI_MPST_COMPONENT
) * SubTable0
->NumPhysicalComponents
));
2077 /* Subtable: Count of Memory Power State Characteristic structures */
2079 AcpiOsPrintf ("\n");
2080 SubTable1
= ACPI_CAST_PTR (ACPI_MPST_DATA_HDR
, SubTable0
);
2081 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable1
,
2082 sizeof (ACPI_MPST_DATA_HDR
), AcpiDmTableInfoMpst1
);
2083 if (ACPI_FAILURE (Status
))
2088 SubtableCount
= SubTable1
->CharacteristicsCount
;
2089 Offset
+= sizeof (ACPI_MPST_DATA_HDR
);
2091 /* Subtable: Memory Power State Characteristics structure(s) */
2093 SubTable2
= ACPI_ADD_PTR (ACPI_MPST_POWER_DATA
, SubTable1
, sizeof (ACPI_MPST_DATA_HDR
));
2095 while ((Offset
< Table
->Length
) && SubtableCount
)
2097 AcpiOsPrintf ("\n");
2098 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable2
,
2099 sizeof (ACPI_MPST_POWER_DATA
), AcpiDmTableInfoMpst2
);
2100 if (ACPI_FAILURE (Status
))
2107 Offset
+= sizeof (ACPI_MPST_POWER_DATA
);
2112 /*******************************************************************************
2114 * FUNCTION: AcpiDmDumpMsct
2116 * PARAMETERS: Table - A MSCT table
2120 * DESCRIPTION: Format the contents of a MSCT
2122 ******************************************************************************/
2126 ACPI_TABLE_HEADER
*Table
)
2129 UINT32 Offset
= sizeof (ACPI_TABLE_MSCT
);
2130 ACPI_MSCT_PROXIMITY
*SubTable
;
2135 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoMsct
);
2136 if (ACPI_FAILURE (Status
))
2143 SubTable
= ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY
, Table
, Offset
);
2144 while (Offset
< Table
->Length
)
2146 /* Common subtable header */
2148 AcpiOsPrintf ("\n");
2149 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2150 sizeof (ACPI_MSCT_PROXIMITY
), AcpiDmTableInfoMsct0
);
2151 if (ACPI_FAILURE (Status
))
2156 /* Point to next subtable */
2158 Offset
+= sizeof (ACPI_MSCT_PROXIMITY
);
2159 SubTable
= ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY
, SubTable
, sizeof (ACPI_MSCT_PROXIMITY
));
2164 /*******************************************************************************
2166 * FUNCTION: AcpiDmDumpMtmr
2168 * PARAMETERS: Table - A MTMR table
2172 * DESCRIPTION: Format the contents of a MTMR
2174 ******************************************************************************/
2178 ACPI_TABLE_HEADER
*Table
)
2181 UINT32 Offset
= sizeof (ACPI_TABLE_MTMR
);
2182 ACPI_MTMR_ENTRY
*SubTable
;
2187 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoMtmr
);
2188 if (ACPI_FAILURE (Status
))
2195 SubTable
= ACPI_ADD_PTR (ACPI_MTMR_ENTRY
, Table
, Offset
);
2196 while (Offset
< Table
->Length
)
2198 /* Common subtable header */
2200 AcpiOsPrintf ("\n");
2201 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2202 sizeof (ACPI_MTMR_ENTRY
), AcpiDmTableInfoMtmr0
);
2203 if (ACPI_FAILURE (Status
))
2208 /* Point to next subtable */
2210 Offset
+= sizeof (ACPI_MTMR_ENTRY
);
2211 SubTable
= ACPI_ADD_PTR (ACPI_MTMR_ENTRY
, SubTable
, sizeof (ACPI_MTMR_ENTRY
));
2216 /*******************************************************************************
2218 * FUNCTION: AcpiDmDumpPcct
2220 * PARAMETERS: Table - A PCCT table
2224 * DESCRIPTION: Format the contents of a PCCT. This table type consists
2225 * of an open-ended number of subtables.
2227 ******************************************************************************/
2231 ACPI_TABLE_HEADER
*Table
)
2234 ACPI_PCCT_SUBSPACE
*SubTable
;
2235 ACPI_DMTABLE_INFO
*InfoTable
;
2236 UINT32 Length
= Table
->Length
;
2237 UINT32 Offset
= sizeof (ACPI_TABLE_PCCT
);
2242 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoPcct
);
2243 if (ACPI_FAILURE (Status
))
2250 SubTable
= ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE
, Table
, Offset
);
2251 while (Offset
< Table
->Length
)
2253 /* Common subtable header */
2255 AcpiOsPrintf ("\n");
2256 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
2257 SubTable
->Header
.Length
, AcpiDmTableInfoPcctHdr
);
2258 if (ACPI_FAILURE (Status
))
2263 switch (SubTable
->Header
.Type
)
2265 case ACPI_PCCT_TYPE_GENERIC_SUBSPACE
:
2267 InfoTable
= AcpiDmTableInfoPcct0
;
2270 case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE
:
2272 InfoTable
= AcpiDmTableInfoPcct1
;
2278 "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
2279 SubTable
->Header
.Type
);
2283 AcpiOsPrintf ("\n");
2284 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
2285 SubTable
->Header
.Length
, InfoTable
);
2286 if (ACPI_FAILURE (Status
))
2291 /* Point to next subtable */
2293 Offset
+= SubTable
->Header
.Length
;
2294 SubTable
= ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE
, SubTable
,
2295 SubTable
->Header
.Length
);
2300 /*******************************************************************************
2302 * FUNCTION: AcpiDmDumpPmtt
2304 * PARAMETERS: Table - A PMTT table
2308 * DESCRIPTION: Format the contents of a PMTT. This table type consists
2309 * of an open-ended number of subtables.
2311 ******************************************************************************/
2315 ACPI_TABLE_HEADER
*Table
)
2318 ACPI_PMTT_HEADER
*SubTable
;
2319 ACPI_PMTT_HEADER
*MemSubTable
;
2320 ACPI_PMTT_HEADER
*DimmSubTable
;
2321 ACPI_PMTT_DOMAIN
*DomainArray
;
2322 UINT32 Length
= Table
->Length
;
2323 UINT32 Offset
= sizeof (ACPI_TABLE_PMTT
);
2326 UINT32 DomainOffset
;
2332 Status
= AcpiDmDumpTable (Length
, 0, Table
, 0, AcpiDmTableInfoPmtt
);
2333 if (ACPI_FAILURE (Status
))
2340 SubTable
= ACPI_ADD_PTR (ACPI_PMTT_HEADER
, Table
, Offset
);
2341 while (Offset
< Table
->Length
)
2343 /* Common subtable header */
2345 AcpiOsPrintf ("\n");
2346 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
2347 SubTable
->Length
, AcpiDmTableInfoPmttHdr
);
2348 if (ACPI_FAILURE (Status
))
2353 /* Only Socket subtables are expected at this level */
2355 if (SubTable
->Type
!= ACPI_PMTT_TYPE_SOCKET
)
2358 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
2363 /* Dump the fixed-length portion of the subtable */
2365 Status
= AcpiDmDumpTable (Length
, Offset
, SubTable
,
2366 SubTable
->Length
, AcpiDmTableInfoPmtt0
);
2367 if (ACPI_FAILURE (Status
))
2372 /* Walk the memory controller subtables */
2374 MemOffset
= sizeof (ACPI_PMTT_SOCKET
);
2375 MemSubTable
= ACPI_ADD_PTR (ACPI_PMTT_HEADER
, SubTable
,
2376 sizeof (ACPI_PMTT_SOCKET
));
2378 while (((Offset
+ MemOffset
) < Table
->Length
) &&
2379 (MemOffset
< SubTable
->Length
))
2381 /* Common subtable header */
2383 AcpiOsPrintf ("\n");
2384 Status
= AcpiDmDumpTable (Length
,
2385 Offset
+ MemOffset
, MemSubTable
,
2386 MemSubTable
->Length
, AcpiDmTableInfoPmttHdr
);
2387 if (ACPI_FAILURE (Status
))
2392 /* Only memory controller subtables are expected at this level */
2394 if (MemSubTable
->Type
!= ACPI_PMTT_TYPE_CONTROLLER
)
2397 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
2402 /* Dump the fixed-length portion of the controller subtable */
2404 Status
= AcpiDmDumpTable (Length
,
2405 Offset
+ MemOffset
, MemSubTable
,
2406 MemSubTable
->Length
, AcpiDmTableInfoPmtt1
);
2407 if (ACPI_FAILURE (Status
))
2412 /* Walk the variable count of proximity domains */
2414 DomainCount
= ((ACPI_PMTT_CONTROLLER
*) MemSubTable
)->DomainCount
;
2415 DomainOffset
= sizeof (ACPI_PMTT_CONTROLLER
);
2416 DomainArray
= ACPI_ADD_PTR (ACPI_PMTT_DOMAIN
, MemSubTable
,
2417 sizeof (ACPI_PMTT_CONTROLLER
));
2419 while (((Offset
+ MemOffset
+ DomainOffset
) < Table
->Length
) &&
2420 ((MemOffset
+ DomainOffset
) < SubTable
->Length
) &&
2423 Status
= AcpiDmDumpTable (Length
,
2424 Offset
+ MemOffset
+ DomainOffset
, DomainArray
,
2425 sizeof (ACPI_PMTT_DOMAIN
), AcpiDmTableInfoPmtt1a
);
2426 if (ACPI_FAILURE (Status
))
2431 DomainOffset
+= sizeof (ACPI_PMTT_DOMAIN
);
2439 "\n**** DomainCount exceeds subtable length\n\n");
2442 /* Walk the physical component (DIMM) subtables */
2444 DimmOffset
= DomainOffset
;
2445 DimmSubTable
= ACPI_ADD_PTR (ACPI_PMTT_HEADER
, MemSubTable
,
2448 while (((Offset
+ MemOffset
+ DimmOffset
) < Table
->Length
) &&
2449 (DimmOffset
< MemSubTable
->Length
))
2451 /* Common subtable header */
2453 AcpiOsPrintf ("\n");
2454 Status
= AcpiDmDumpTable (Length
,
2455 Offset
+ MemOffset
+ DimmOffset
, DimmSubTable
,
2456 DimmSubTable
->Length
, AcpiDmTableInfoPmttHdr
);
2457 if (ACPI_FAILURE (Status
))
2462 /* Only DIMM subtables are expected at this level */
2464 if (DimmSubTable
->Type
!= ACPI_PMTT_TYPE_DIMM
)
2467 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
2468 DimmSubTable
->Type
);
2472 /* Dump the fixed-length DIMM subtable */
2474 Status
= AcpiDmDumpTable (Length
,
2475 Offset
+ MemOffset
+ DimmOffset
, DimmSubTable
,
2476 DimmSubTable
->Length
, AcpiDmTableInfoPmtt2
);
2477 if (ACPI_FAILURE (Status
))
2482 /* Point to next DIMM subtable */
2484 DimmOffset
+= DimmSubTable
->Length
;
2485 DimmSubTable
= ACPI_ADD_PTR (ACPI_PMTT_HEADER
,
2486 DimmSubTable
, DimmSubTable
->Length
);
2489 /* Point to next Controller subtable */
2491 MemOffset
+= MemSubTable
->Length
;
2492 MemSubTable
= ACPI_ADD_PTR (ACPI_PMTT_HEADER
,
2493 MemSubTable
, MemSubTable
->Length
);
2496 /* Point to next Socket subtable */
2498 Offset
+= SubTable
->Length
;
2499 SubTable
= ACPI_ADD_PTR (ACPI_PMTT_HEADER
,
2500 SubTable
, SubTable
->Length
);
2505 /*******************************************************************************
2507 * FUNCTION: AcpiDmDumpS3pt
2509 * PARAMETERS: Table - A S3PT table
2511 * RETURN: Length of the table
2513 * DESCRIPTION: Format the contents of a S3PT
2515 ******************************************************************************/
2519 ACPI_TABLE_HEADER
*Tables
)
2522 UINT32 Offset
= sizeof (ACPI_TABLE_S3PT
);
2523 ACPI_S3PT_HEADER
*SubTable
;
2524 ACPI_DMTABLE_INFO
*InfoTable
;
2525 ACPI_TABLE_S3PT
*S3ptTable
= ACPI_CAST_PTR (ACPI_TABLE_S3PT
, Tables
);
2530 Status
= AcpiDmDumpTable (Offset
, 0, S3ptTable
, 0, AcpiDmTableInfoS3pt
);
2531 if (ACPI_FAILURE (Status
))
2536 SubTable
= ACPI_ADD_PTR (ACPI_S3PT_HEADER
, S3ptTable
, Offset
);
2537 while (Offset
< S3ptTable
->Length
)
2539 /* Common subtable header */
2541 AcpiOsPrintf ("\n");
2542 Status
= AcpiDmDumpTable (S3ptTable
->Length
, Offset
, SubTable
,
2543 SubTable
->Length
, AcpiDmTableInfoS3ptHdr
);
2544 if (ACPI_FAILURE (Status
))
2549 switch (SubTable
->Type
)
2551 case ACPI_S3PT_TYPE_RESUME
:
2553 InfoTable
= AcpiDmTableInfoS3pt0
;
2556 case ACPI_S3PT_TYPE_SUSPEND
:
2558 InfoTable
= AcpiDmTableInfoS3pt1
;
2563 AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable
->Type
);
2565 /* Attempt to continue */
2567 if (!SubTable
->Length
)
2569 AcpiOsPrintf ("Invalid zero length subtable\n");
2575 AcpiOsPrintf ("\n");
2576 Status
= AcpiDmDumpTable (S3ptTable
->Length
, Offset
, SubTable
,
2577 SubTable
->Length
, InfoTable
);
2578 if (ACPI_FAILURE (Status
))
2584 /* Point to next subtable */
2586 Offset
+= SubTable
->Length
;
2587 SubTable
= ACPI_ADD_PTR (ACPI_S3PT_HEADER
, SubTable
, SubTable
->Length
);
2590 return (S3ptTable
->Length
);
2594 /*******************************************************************************
2596 * FUNCTION: AcpiDmDumpSlic
2598 * PARAMETERS: Table - A SLIC table
2602 * DESCRIPTION: Format the contents of a SLIC
2604 ******************************************************************************/
2608 ACPI_TABLE_HEADER
*Table
)
2611 UINT32 Offset
= sizeof (ACPI_TABLE_SLIC
);
2612 ACPI_SLIC_HEADER
*SubTable
;
2613 ACPI_DMTABLE_INFO
*InfoTable
;
2616 /* There is no main SLIC table, only subtables */
2618 SubTable
= ACPI_ADD_PTR (ACPI_SLIC_HEADER
, Table
, Offset
);
2619 while (Offset
< Table
->Length
)
2621 /* Common subtable header */
2623 AcpiOsPrintf ("\n");
2624 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2625 SubTable
->Length
, AcpiDmTableInfoSlicHdr
);
2626 if (ACPI_FAILURE (Status
))
2631 switch (SubTable
->Type
)
2633 case ACPI_SLIC_TYPE_PUBLIC_KEY
:
2635 InfoTable
= AcpiDmTableInfoSlic0
;
2638 case ACPI_SLIC_TYPE_WINDOWS_MARKER
:
2640 InfoTable
= AcpiDmTableInfoSlic1
;
2645 AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable
->Type
);
2647 /* Attempt to continue */
2649 if (!SubTable
->Length
)
2651 AcpiOsPrintf ("Invalid zero length subtable\n");
2657 AcpiOsPrintf ("\n");
2658 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2659 SubTable
->Length
, InfoTable
);
2660 if (ACPI_FAILURE (Status
))
2666 /* Point to next subtable */
2668 Offset
+= SubTable
->Length
;
2669 SubTable
= ACPI_ADD_PTR (ACPI_SLIC_HEADER
, SubTable
, SubTable
->Length
);
2674 /*******************************************************************************
2676 * FUNCTION: AcpiDmDumpSlit
2678 * PARAMETERS: Table - An SLIT
2682 * DESCRIPTION: Format the contents of a SLIT
2684 ******************************************************************************/
2688 ACPI_TABLE_HEADER
*Table
)
2700 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoSlit
);
2701 if (ACPI_FAILURE (Status
))
2706 /* Display the Locality NxN Matrix */
2708 Localities
= (UINT32
) ACPI_CAST_PTR (ACPI_TABLE_SLIT
, Table
)->LocalityCount
;
2709 Offset
= ACPI_OFFSET (ACPI_TABLE_SLIT
, Entry
[0]);
2710 Row
= (UINT8
*) ACPI_CAST_PTR (ACPI_TABLE_SLIT
, Table
)->Entry
;
2712 for (i
= 0; i
< Localities
; i
++)
2714 /* Display one row of the matrix */
2716 AcpiDmLineHeader2 (Offset
, Localities
, "Locality", i
);
2717 for (j
= 0; j
< Localities
; j
++)
2719 /* Check for beyond EOT */
2721 if (Offset
>= Table
->Length
)
2723 AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
2727 AcpiOsPrintf ("%2.2X", Row
[j
]);
2730 /* Display up to 16 bytes per output row */
2732 if ((j
+1) < Localities
)
2736 if (j
&& (((j
+1) % 16) == 0))
2738 AcpiOsPrintf ("\\\n"); /* With line continuation char */
2739 AcpiDmLineHeader (Offset
, 0, NULL
);
2744 /* Point to next row */
2746 AcpiOsPrintf ("\n");
2752 /*******************************************************************************
2754 * FUNCTION: AcpiDmDumpSrat
2756 * PARAMETERS: Table - A SRAT table
2760 * DESCRIPTION: Format the contents of a SRAT
2762 ******************************************************************************/
2766 ACPI_TABLE_HEADER
*Table
)
2769 UINT32 Offset
= sizeof (ACPI_TABLE_SRAT
);
2770 ACPI_SUBTABLE_HEADER
*SubTable
;
2771 ACPI_DMTABLE_INFO
*InfoTable
;
2776 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoSrat
);
2777 if (ACPI_FAILURE (Status
))
2784 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, Table
, Offset
);
2785 while (Offset
< Table
->Length
)
2787 /* Common subtable header */
2789 AcpiOsPrintf ("\n");
2790 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2791 SubTable
->Length
, AcpiDmTableInfoSratHdr
);
2792 if (ACPI_FAILURE (Status
))
2797 switch (SubTable
->Type
)
2799 case ACPI_SRAT_TYPE_CPU_AFFINITY
:
2801 InfoTable
= AcpiDmTableInfoSrat0
;
2804 case ACPI_SRAT_TYPE_MEMORY_AFFINITY
:
2806 InfoTable
= AcpiDmTableInfoSrat1
;
2809 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY
:
2811 InfoTable
= AcpiDmTableInfoSrat2
;
2815 AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable
->Type
);
2817 /* Attempt to continue */
2819 if (!SubTable
->Length
)
2821 AcpiOsPrintf ("Invalid zero length subtable\n");
2827 AcpiOsPrintf ("\n");
2828 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2829 SubTable
->Length
, InfoTable
);
2830 if (ACPI_FAILURE (Status
))
2836 /* Point to next subtable */
2838 Offset
+= SubTable
->Length
;
2839 SubTable
= ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER
, SubTable
, SubTable
->Length
);
2844 /*******************************************************************************
2846 * FUNCTION: AcpiDmDumpVrtc
2848 * PARAMETERS: Table - A VRTC table
2852 * DESCRIPTION: Format the contents of a VRTC
2854 ******************************************************************************/
2858 ACPI_TABLE_HEADER
*Table
)
2861 UINT32 Offset
= sizeof (ACPI_TABLE_VRTC
);
2862 ACPI_VRTC_ENTRY
*SubTable
;
2867 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoVrtc
);
2868 if (ACPI_FAILURE (Status
))
2875 SubTable
= ACPI_ADD_PTR (ACPI_VRTC_ENTRY
, Table
, Offset
);
2876 while (Offset
< Table
->Length
)
2878 /* Common subtable header */
2880 AcpiOsPrintf ("\n");
2881 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2882 sizeof (ACPI_VRTC_ENTRY
), AcpiDmTableInfoVrtc0
);
2883 if (ACPI_FAILURE (Status
))
2888 /* Point to next subtable */
2890 Offset
+= sizeof (ACPI_VRTC_ENTRY
);
2891 SubTable
= ACPI_ADD_PTR (ACPI_VRTC_ENTRY
, SubTable
, sizeof (ACPI_VRTC_ENTRY
));
2896 /*******************************************************************************
2898 * FUNCTION: AcpiDmDumpWdat
2900 * PARAMETERS: Table - A WDAT table
2904 * DESCRIPTION: Format the contents of a WDAT
2906 ******************************************************************************/
2910 ACPI_TABLE_HEADER
*Table
)
2913 UINT32 Offset
= sizeof (ACPI_TABLE_WDAT
);
2914 ACPI_WDAT_ENTRY
*SubTable
;
2919 Status
= AcpiDmDumpTable (Table
->Length
, 0, Table
, 0, AcpiDmTableInfoWdat
);
2920 if (ACPI_FAILURE (Status
))
2927 SubTable
= ACPI_ADD_PTR (ACPI_WDAT_ENTRY
, Table
, Offset
);
2928 while (Offset
< Table
->Length
)
2930 /* Common subtable header */
2932 AcpiOsPrintf ("\n");
2933 Status
= AcpiDmDumpTable (Table
->Length
, Offset
, SubTable
,
2934 sizeof (ACPI_WDAT_ENTRY
), AcpiDmTableInfoWdat0
);
2935 if (ACPI_FAILURE (Status
))
2940 /* Point to next subtable */
2942 Offset
+= sizeof (ACPI_WDAT_ENTRY
);
2943 SubTable
= ACPI_ADD_PTR (ACPI_WDAT_ENTRY
, SubTable
, sizeof (ACPI_WDAT_ENTRY
));