xref: /freebsd/sys/contrib/dev/acpica/common/dmtbdump.c (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1 /******************************************************************************
2  *
3  * Module Name: dmtbdump - Dump ACPI data tables that contain no AML code
4  *              $Revision: 1.15 $
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 
117 #include <contrib/dev/acpica/acpi.h>
118 #include <contrib/dev/acpica/acdisasm.h>
119 #include <contrib/dev/acpica/actables.h>
120 
121 /* This module used for application-level code only */
122 
123 #define _COMPONENT          ACPI_CA_DISASSEMBLER
124         ACPI_MODULE_NAME    ("dmtbdump")
125 
126 
127 /*******************************************************************************
128  *
129  * FUNCTION:    AcpiDmDumpRsdp
130  *
131  * PARAMETERS:  Table               - A RSDP
132  *
133  * RETURN:      Length of the table (there is no length field, use revision)
134  *
135  * DESCRIPTION: Format the contents of a RSDP
136  *
137  ******************************************************************************/
138 
139 UINT32
140 AcpiDmDumpRsdp (
141     ACPI_TABLE_HEADER       *Table)
142 {
143     UINT32                  Length = ACPI_RSDP_REV0_SIZE;
144 
145 
146     /* Dump the common ACPI 1.0 portion */
147 
148     AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
149 
150     /* ACPI 2.0+ contains more data and has a Length field */
151 
152     if (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Revision > 0)
153     {
154         Length = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Length;
155         AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
156     }
157 
158     return (Length);
159 }
160 
161 
162 /*******************************************************************************
163  *
164  * FUNCTION:    AcpiDmDumpRsdt
165  *
166  * PARAMETERS:  Table               - A RSDT
167  *
168  * RETURN:      None
169  *
170  * DESCRIPTION: Format the contents of a RSDT
171  *
172  ******************************************************************************/
173 
174 void
175 AcpiDmDumpRsdt (
176     ACPI_TABLE_HEADER       *Table)
177 {
178     UINT32                  *Array;
179     UINT32                  Entries;
180     UINT32                  Offset;
181     UINT32                  i;
182 
183 
184     /* Point to start of table pointer array */
185 
186     Array = ACPI_CAST_PTR (ACPI_TABLE_RSDT, Table)->TableOffsetEntry;
187     Offset = sizeof (ACPI_TABLE_HEADER);
188 
189     /* RSDT uses 32-bit pointers */
190 
191     Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
192 
193     for (i = 0; i < Entries; i++)
194     {
195         AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
196         AcpiOsPrintf ("%8.8X\n", Array[i]);
197         Offset += sizeof (UINT32);
198     }
199 }
200 
201 
202 /*******************************************************************************
203  *
204  * FUNCTION:    AcpiDmDumpXsdt
205  *
206  * PARAMETERS:  Table               - A XSDT
207  *
208  * RETURN:      None
209  *
210  * DESCRIPTION: Format the contents of a XSDT
211  *
212  ******************************************************************************/
213 
214 void
215 AcpiDmDumpXsdt (
216     ACPI_TABLE_HEADER       *Table)
217 {
218     UINT64                  *Array;
219     UINT32                  Entries;
220     UINT32                  Offset;
221     UINT32                  i;
222 
223 
224     /* Point to start of table pointer array */
225 
226     Array = ACPI_CAST_PTR (ACPI_TABLE_XSDT, Table)->TableOffsetEntry;
227     Offset = sizeof (ACPI_TABLE_HEADER);
228 
229     /* XSDT uses 64-bit pointers */
230 
231     Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
232 
233     for (i = 0; i < Entries; i++)
234     {
235         AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
236         AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
237         Offset += sizeof (UINT64);
238     }
239 }
240 
241 
242 /*******************************************************************************
243  *
244  * FUNCTION:    AcpiDmDumpFadt
245  *
246  * PARAMETERS:  Table               - A FADT
247  *
248  * RETURN:      None
249  *
250  * DESCRIPTION: Format the contents of a FADT
251  *
252  ******************************************************************************/
253 
254 void
255 AcpiDmDumpFadt (
256     ACPI_TABLE_HEADER       *Table)
257 {
258 
259     /* Common ACPI 1.0 portion of FADT */
260 
261     AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
262 
263     /* Check for ACPI 2.0+ extended data (cannot depend on Revision field) */
264 
265     if (Table->Length >= sizeof (ACPI_TABLE_FADT))
266     {
267         AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
268     }
269 
270     /* Validate various fields in the FADT, including length */
271 
272     AcpiTbCreateLocalFadt (Table, Table->Length);
273 }
274 
275 
276 /*******************************************************************************
277  *
278  * FUNCTION:    AcpiDmDumpAsf
279  *
280  * PARAMETERS:  Table               - A ASF table
281  *
282  * RETURN:      None
283  *
284  * DESCRIPTION: Format the contents of a ASF table
285  *
286  ******************************************************************************/
287 
288 void
289 AcpiDmDumpAsf (
290     ACPI_TABLE_HEADER       *Table)
291 {
292     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
293     ACPI_ASF_INFO           *SubTable;
294     ACPI_DMTABLE_INFO       *InfoTable;
295     ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
296     UINT8                   *DataTable = NULL;
297     ACPI_NATIVE_UINT        DataCount = 0;
298     ACPI_NATIVE_UINT        DataLength = 0;
299     ACPI_NATIVE_UINT        DataOffset = 0;
300     ACPI_NATIVE_UINT        i;
301 
302 
303     /* No main table, only sub-tables */
304 
305     SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
306     while (Offset < Table->Length)
307     {
308         /* Common sub-table header */
309 
310         AcpiDmDumpTable (Table->Length, Offset, SubTable, 0, AcpiDmTableInfoAsfHdr);
311 
312         switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
313         {
314         case ACPI_ASF_TYPE_INFO:
315             InfoTable = AcpiDmTableInfoAsf0;
316             break;
317 
318         case ACPI_ASF_TYPE_ALERT:
319             InfoTable = AcpiDmTableInfoAsf1;
320             DataInfoTable = AcpiDmTableInfoAsf1a;
321             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
322             DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts;
323             DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength;
324             DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
325             break;
326 
327         case ACPI_ASF_TYPE_CONTROL:
328             InfoTable = AcpiDmTableInfoAsf2;
329             DataInfoTable = AcpiDmTableInfoAsf2a;
330             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
331             DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls;
332             DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength;
333             DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
334             break;
335 
336         case ACPI_ASF_TYPE_BOOT:
337             InfoTable = AcpiDmTableInfoAsf3;
338             break;
339 
340         case ACPI_ASF_TYPE_ADDRESS:
341             InfoTable = AcpiDmTableInfoAsf4;
342             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
343             DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices;
344             DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
345             break;
346 
347         default:
348             AcpiOsPrintf ("\n**** Unknown ASF sub-table type %X\n", SubTable->Header.Type);
349             return;
350         }
351 
352         AcpiDmDumpTable (Table->Length, Offset, SubTable, SubTable->Header.Length, InfoTable);
353 
354 
355         /* Dump variable-length extra data */
356 
357         switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
358         {
359         case ACPI_ASF_TYPE_ALERT:
360         case ACPI_ASF_TYPE_CONTROL:
361 
362             for (i = 0; i < DataCount; i++)
363             {
364                 AcpiOsPrintf ("\n");
365                 AcpiDmDumpTable (Table->Length, DataOffset, DataTable, DataLength, DataInfoTable);
366 
367                 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
368                 DataOffset += DataLength;
369             }
370             break;
371 
372         case ACPI_ASF_TYPE_ADDRESS:
373 
374             for (i = 0; i < DataLength; i++)
375             {
376                 if (!(i % 16))
377                 {
378                     AcpiDmLineHeader (DataOffset, 1, "Addresses");
379                 }
380 
381                 AcpiOsPrintf ("%2.2X ", *DataTable);
382                 DataTable++;
383                 DataOffset++;
384             }
385 
386             AcpiOsPrintf ("\n");
387             break;
388         }
389 
390         AcpiOsPrintf ("\n");
391 
392         /* Point to next sub-table */
393 
394         Offset += SubTable->Header.Length;
395         SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubTable->Header.Length);
396     }
397 }
398 
399 
400 /*******************************************************************************
401  *
402  * FUNCTION:    AcpiDmDumpCpep
403  *
404  * PARAMETERS:  Table               - A CPEP table
405  *
406  * RETURN:      None
407  *
408  * DESCRIPTION: Format the contents of a CPEP. This table type consists
409  *              of an open-ended number of subtables.
410  *
411  ******************************************************************************/
412 
413 void
414 AcpiDmDumpCpep (
415     ACPI_TABLE_HEADER       *Table)
416 {
417     ACPI_CPEP_POLLING       *SubTable;
418     UINT32                  Length = Table->Length;
419     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
420 
421 
422     /* Main table */
423 
424     AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
425 
426     /* Sub-tables */
427 
428     SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
429     while (Offset < Table->Length)
430     {
431         AcpiOsPrintf ("\n");
432         AcpiDmDumpTable (Length, Offset, SubTable, SubTable->Length, AcpiDmTableInfoCpep0);
433 
434         /* Point to next sub-table */
435 
436         Offset += SubTable->Length;
437         SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, SubTable->Length);
438     }
439 }
440 
441 
442 /*******************************************************************************
443  *
444  * FUNCTION:    AcpiDmDumpDmar
445  *
446  * PARAMETERS:  Table               - A DMAR table
447  *
448  * RETURN:      None
449  *
450  * DESCRIPTION: Format the contents of a DMAR. This table type consists
451  *              of an open-ended number of subtables.
452  *
453  ******************************************************************************/
454 
455 void
456 AcpiDmDumpDmar (
457     ACPI_TABLE_HEADER       *Table)
458 {
459     ACPI_DMAR_HEADER        *SubTable;
460     UINT32                  Length = Table->Length;
461     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
462     ACPI_DMTABLE_INFO       *InfoTable;
463     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
464     UINT32                  ScopeOffset;
465     UINT8                   *PciPath;
466     UINT32                  PathOffset;
467 
468 
469     /* Main table */
470 
471     AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
472 
473     /* Sub-tables */
474 
475     SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
476     while (Offset < Table->Length)
477     {
478         /* Common sub-table header */
479 
480         AcpiOsPrintf ("\n");
481         AcpiDmDumpTable (Length, Offset, SubTable, 0, AcpiDmTableInfoDmarHdr);
482 
483         switch (SubTable->Type)
484         {
485         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
486             InfoTable = AcpiDmTableInfoDmar0;
487             ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
488             break;
489         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
490             InfoTable = AcpiDmTableInfoDmar1;
491             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
492             break;
493         default:
494             AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type);
495             return;
496         }
497 
498         AcpiDmDumpTable (Length, Offset, SubTable, SubTable->Length, InfoTable);
499 
500         /*
501          * Currently, a common flag indicates whether there are any
502          * device scope entries present at the end of the subtable.
503          */
504         if ((SubTable->Flags & ACPI_DMAR_INCLUDE_ALL) == 0)
505         {
506             /* Dump the device scope entries */
507 
508             ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
509             while (ScopeOffset < SubTable->Length)
510             {
511                 AcpiOsPrintf ("\n");
512                 AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
513                     ScopeTable->Length, AcpiDmTableInfoDmarScope);
514 
515                 /* Dump the PCI Path entries for this device scope */
516 
517                 PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
518 
519                 PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
520                     sizeof (ACPI_DMAR_DEVICE_SCOPE));
521 
522                 while (PathOffset < ScopeTable->Length)
523                 {
524                     AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
525                     AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
526 
527                     /* Point to next PCI Path entry */
528 
529                     PathOffset += 2;
530                     PciPath += 2;
531                 }
532 
533                 /* Point to next device scope entry */
534 
535                 ScopeOffset += ScopeTable->Length;
536                 ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
537                     ScopeTable, ScopeTable->Length);
538             }
539         }
540 
541         /* Point to next sub-table */
542 
543         Offset += SubTable->Length;
544         SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
545     }
546 }
547 
548 
549 /*******************************************************************************
550  *
551  * FUNCTION:    AcpiDmDumpMadt
552  *
553  * PARAMETERS:  Table               - A MADT table
554  *
555  * RETURN:      None
556  *
557  * DESCRIPTION: Format the contents of a MADT. This table type consists
558  *              of an open-ended number of subtables.
559  *
560  ******************************************************************************/
561 
562 void
563 AcpiDmDumpMadt (
564     ACPI_TABLE_HEADER       *Table)
565 {
566     ACPI_SUBTABLE_HEADER    *SubTable;
567     UINT32                  Length = Table->Length;
568     UINT32                  Offset = sizeof (ACPI_TABLE_MADT);
569     ACPI_DMTABLE_INFO       *InfoTable;
570 
571 
572     /* Main table */
573 
574     AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
575 
576     /* Sub-tables */
577 
578     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
579     while (Offset < Table->Length)
580     {
581         /* Common sub-table header */
582 
583         AcpiOsPrintf ("\n");
584         AcpiDmDumpTable (Length, Offset, SubTable, 0, AcpiDmTableInfoMadtHdr);
585 
586         switch (SubTable->Type)
587         {
588         case ACPI_MADT_TYPE_LOCAL_APIC:
589             InfoTable = AcpiDmTableInfoMadt0;
590             break;
591         case ACPI_MADT_TYPE_IO_APIC:
592             InfoTable = AcpiDmTableInfoMadt1;
593             break;
594         case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
595             InfoTable = AcpiDmTableInfoMadt2;
596             break;
597         case ACPI_MADT_TYPE_NMI_SOURCE:
598             InfoTable = AcpiDmTableInfoMadt3;
599             break;
600         case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
601             InfoTable = AcpiDmTableInfoMadt4;
602             break;
603         case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
604             InfoTable = AcpiDmTableInfoMadt5;
605             break;
606         case ACPI_MADT_TYPE_IO_SAPIC:
607             InfoTable = AcpiDmTableInfoMadt6;
608             break;
609         case ACPI_MADT_TYPE_LOCAL_SAPIC:
610             InfoTable = AcpiDmTableInfoMadt7;
611             break;
612         case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
613             InfoTable = AcpiDmTableInfoMadt8;
614             break;
615         default:
616             AcpiOsPrintf ("\n**** Unknown MADT sub-table type %X\n\n", SubTable->Type);
617             return;
618         }
619 
620         AcpiDmDumpTable (Length, Offset, SubTable, SubTable->Length, InfoTable);
621 
622         /* Point to next sub-table */
623 
624         Offset += SubTable->Length;
625         SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
626     }
627 }
628 
629 
630 /*******************************************************************************
631  *
632  * FUNCTION:    AcpiDmDumpMcfg
633  *
634  * PARAMETERS:  Table               - A MCFG Table
635  *
636  * RETURN:      None
637  *
638  * DESCRIPTION: Format the contents of a MCFG table
639  *
640  ******************************************************************************/
641 
642 void
643 AcpiDmDumpMcfg (
644     ACPI_TABLE_HEADER       *Table)
645 {
646     UINT32                  Offset = sizeof (ACPI_TABLE_MCFG);
647     ACPI_MCFG_ALLOCATION    *SubTable;
648 
649 
650     /* Main table */
651 
652     AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
653 
654     /* Sub-tables */
655 
656     SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
657     while (Offset < Table->Length)
658     {
659         if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
660         {
661             AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n",
662                 sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
663             return;
664         }
665 
666         AcpiOsPrintf ("\n");
667         AcpiDmDumpTable (Table->Length, Offset, SubTable, 0, AcpiDmTableInfoMcfg0);
668 
669         /* Point to next sub-table (each subtable is of fixed length) */
670 
671         Offset += sizeof (ACPI_MCFG_ALLOCATION);
672         SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
673                         sizeof (ACPI_MCFG_ALLOCATION));
674     }
675 }
676 
677 
678 /*******************************************************************************
679  *
680  * FUNCTION:    AcpiDmDumpSlit
681  *
682  * PARAMETERS:  Table               - An SLIT
683  *
684  * RETURN:      None
685  *
686  * DESCRIPTION: Format the contents of a SLIT
687  *
688  ******************************************************************************/
689 
690 void
691 AcpiDmDumpSlit (
692     ACPI_TABLE_HEADER       *Table)
693 {
694     UINT32                  Offset;
695     UINT8                   *Row;
696     UINT32                  Localities;
697     UINT32                  i;
698     UINT32                  j;
699 
700 
701     /* Main table */
702 
703     AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
704 
705     /* Display the Locality NxN Matrix */
706 
707     Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
708     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
709     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
710 
711     for (i = 0; i < Localities; i++)
712     {
713         /* Display one row of the matrix */
714 
715         AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
716         for  (j = 0; j < Localities; j++)
717         {
718             /* Check for beyond EOT */
719 
720             if (Offset >= Table->Length)
721             {
722                 AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
723                 return;
724             }
725 
726             AcpiOsPrintf ("%2.2X ", Row[j]);
727             Offset++;
728 
729             /* Display up to 16 bytes per output row */
730 
731             if (j && (((j+1) % 16) == 0) && ((j+1) < Localities))
732             {
733                 AcpiOsPrintf ("\n");
734                 AcpiDmLineHeader (Offset, 0, "");
735             }
736         }
737 
738         /* Point to next row */
739 
740         AcpiOsPrintf ("\n");
741         Row += Localities;
742     }
743 }
744 
745 
746 /*******************************************************************************
747  *
748  * FUNCTION:    AcpiDmDumpSrat
749  *
750  * PARAMETERS:  Table               - A SRAT table
751  *
752  * RETURN:      None
753  *
754  * DESCRIPTION: Format the contents of a SRAT
755  *
756  ******************************************************************************/
757 
758 void
759 AcpiDmDumpSrat (
760     ACPI_TABLE_HEADER       *Table)
761 {
762     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
763     ACPI_SUBTABLE_HEADER    *SubTable;
764     ACPI_DMTABLE_INFO       *InfoTable;
765 
766 
767     /* Main table */
768 
769     AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
770 
771     /* Sub-tables */
772 
773     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
774     while (Offset < Table->Length)
775     {
776         switch (SubTable->Type)
777         {
778         case ACPI_SRAT_TYPE_CPU_AFFINITY:
779             InfoTable = AcpiDmTableInfoSrat0;
780             break;
781         case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
782             InfoTable = AcpiDmTableInfoSrat1;
783             break;
784         default:
785             AcpiOsPrintf ("\n**** Unknown SRAT sub-table type %X\n", SubTable->Type);
786             return;
787         }
788 
789         AcpiOsPrintf ("\n");
790         AcpiDmDumpTable (Table->Length, Offset, SubTable, SubTable->Length, InfoTable);
791 
792         /* Point to next sub-table */
793 
794         Offset += SubTable->Length;
795         SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
796     }
797 }
798 
799