xref: /freebsd/sys/contrib/dev/acpica/common/dmtbdump2.c (revision 130d950cafcd29c6a32cf5357bf600dcd9c1d998)
1 /******************************************************************************
2  *
3  * Module Name: dmtbdump2 - Dump ACPI data tables that contain no AML code
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
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
19  * property rights.
20  *
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
27  *
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;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
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.
53  *
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
64  * make.
65  *
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
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
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.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
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
88  * PARTICULAR PURPOSE.
89  *
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
97  * LIMITED REMEDY.
98  *
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.
113  *
114  *****************************************************************************
115  *
116  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #include <contrib/dev/acpica/include/acpi.h>
153 #include <contrib/dev/acpica/include/accommon.h>
154 #include <contrib/dev/acpica/include/acdisasm.h>
155 #include <contrib/dev/acpica/include/actables.h>
156 
157 /* This module used for application-level code only */
158 
159 #define _COMPONENT          ACPI_CA_DISASSEMBLER
160         ACPI_MODULE_NAME    ("dmtbdump2")
161 
162 
163 /*******************************************************************************
164  *
165  * FUNCTION:    AcpiDmDumpIort
166  *
167  * PARAMETERS:  Table               - A IORT table
168  *
169  * RETURN:      None
170  *
171  * DESCRIPTION: Format the contents of a IORT
172  *
173  ******************************************************************************/
174 
175 void
176 AcpiDmDumpIort (
177     ACPI_TABLE_HEADER       *Table)
178 {
179     ACPI_STATUS             Status;
180     ACPI_TABLE_IORT         *Iort;
181     ACPI_IORT_NODE          *IortNode;
182     ACPI_IORT_ITS_GROUP     *IortItsGroup = NULL;
183     ACPI_IORT_SMMU          *IortSmmu = NULL;
184     UINT32                  Offset;
185     UINT32                  NodeOffset;
186     UINT32                  Length;
187     ACPI_DMTABLE_INFO       *InfoTable;
188     char                    *String;
189     UINT32                  i;
190     UINT32                  MappingByteLength;
191 
192 
193     /* Main table */
194 
195     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort);
196     if (ACPI_FAILURE (Status))
197     {
198         return;
199     }
200 
201     Iort = ACPI_CAST_PTR (ACPI_TABLE_IORT, Table);
202     Offset = sizeof (ACPI_TABLE_IORT);
203 
204     /* Dump the OptionalPadding (optional) */
205 
206     if (Iort->NodeOffset > Offset)
207     {
208         Status = AcpiDmDumpTable (Table->Length, Offset, Table,
209             Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
210         if (ACPI_FAILURE (Status))
211         {
212             return;
213         }
214     }
215 
216     Offset = Iort->NodeOffset;
217     while (Offset < Table->Length)
218     {
219         /* Common subtable header */
220 
221         IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, Table, Offset);
222         AcpiOsPrintf ("\n");
223         Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
224         Status = AcpiDmDumpTable (Table->Length, Offset,
225             IortNode, Length, AcpiDmTableInfoIortHdr);
226         if (ACPI_FAILURE (Status))
227         {
228             return;
229         }
230 
231         NodeOffset = Length;
232 
233         switch (IortNode->Type)
234         {
235         case ACPI_IORT_NODE_ITS_GROUP:
236 
237             InfoTable = AcpiDmTableInfoIort0;
238             Length = ACPI_OFFSET (ACPI_IORT_ITS_GROUP, Identifiers);
239             IortItsGroup = ACPI_ADD_PTR (ACPI_IORT_ITS_GROUP, IortNode, NodeOffset);
240             break;
241 
242         case ACPI_IORT_NODE_NAMED_COMPONENT:
243 
244             InfoTable = AcpiDmTableInfoIort1;
245             Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName);
246             String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length);
247             Length += strlen (String) + 1;
248             break;
249 
250         case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
251 
252             InfoTable = AcpiDmTableInfoIort2;
253             Length = IortNode->Length - NodeOffset;
254             break;
255 
256         case ACPI_IORT_NODE_SMMU:
257 
258             InfoTable = AcpiDmTableInfoIort3;
259             Length = ACPI_OFFSET (ACPI_IORT_SMMU, Interrupts);
260             IortSmmu = ACPI_ADD_PTR (ACPI_IORT_SMMU, IortNode, NodeOffset);
261             break;
262 
263         case ACPI_IORT_NODE_SMMU_V3:
264 
265             InfoTable = AcpiDmTableInfoIort4;
266             Length = IortNode->Length - NodeOffset;
267             break;
268 
269         case ACPI_IORT_NODE_PMCG:
270 
271             InfoTable = AcpiDmTableInfoIort5;
272             Length = IortNode->Length - NodeOffset;
273             break;
274 
275         default:
276 
277             AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n",
278                 IortNode->Type);
279 
280             /* Attempt to continue */
281 
282             if (!IortNode->Length)
283             {
284                 AcpiOsPrintf ("Invalid zero length IORT node\n");
285                 return;
286             }
287             goto NextSubtable;
288         }
289 
290         /* Dump the node subtable header */
291 
292         AcpiOsPrintf ("\n");
293         Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
294             ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
295             Length, InfoTable);
296         if (ACPI_FAILURE (Status))
297         {
298             return;
299         }
300 
301         NodeOffset += Length;
302 
303         /* Dump the node specific data */
304 
305         switch (IortNode->Type)
306         {
307         case ACPI_IORT_NODE_ITS_GROUP:
308 
309             /* Validate IortItsGroup to avoid compiler warnings */
310 
311             if (IortItsGroup)
312             {
313                 for (i = 0; i < IortItsGroup->ItsCount; i++)
314                 {
315                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
316                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
317                         4, AcpiDmTableInfoIort0a);
318                     if (ACPI_FAILURE (Status))
319                     {
320                         return;
321                     }
322 
323                     NodeOffset += 4;
324                 }
325             }
326             break;
327 
328         case ACPI_IORT_NODE_NAMED_COMPONENT:
329 
330             /* Dump the Padding (optional) */
331 
332             if (IortNode->Length > NodeOffset)
333             {
334                 MappingByteLength =
335                     IortNode->MappingCount * sizeof (ACPI_IORT_ID_MAPPING);
336                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
337                     Table, IortNode->Length - NodeOffset - MappingByteLength,
338                     AcpiDmTableInfoIort1a);
339                 if (ACPI_FAILURE (Status))
340                 {
341                     return;
342                 }
343             }
344             break;
345 
346         case ACPI_IORT_NODE_SMMU:
347 
348             AcpiOsPrintf ("\n");
349 
350             /* Validate IortSmmu to avoid compiler warnings */
351 
352             if (IortSmmu)
353             {
354                 Length = 2 * sizeof (UINT64);
355                 NodeOffset = IortSmmu->GlobalInterruptOffset;
356                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
357                     ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
358                     Length, AcpiDmTableInfoIort3a);
359                 if (ACPI_FAILURE (Status))
360                 {
361                     return;
362                 }
363 
364                 NodeOffset = IortSmmu->ContextInterruptOffset;
365                 for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
366                 {
367                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
368                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
369                         8, AcpiDmTableInfoIort3b);
370                     if (ACPI_FAILURE (Status))
371                     {
372                         return;
373                     }
374 
375                     NodeOffset += 8;
376                 }
377 
378                 NodeOffset = IortSmmu->PmuInterruptOffset;
379                 for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
380                 {
381                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
382                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
383                         8, AcpiDmTableInfoIort3c);
384                     if (ACPI_FAILURE (Status))
385                     {
386                         return;
387                     }
388 
389                     NodeOffset += 8;
390                 }
391             }
392             break;
393 
394         default:
395 
396             break;
397         }
398 
399         /* Dump the ID mappings */
400 
401         NodeOffset = IortNode->MappingOffset;
402         for (i = 0; i < IortNode->MappingCount; i++)
403         {
404             AcpiOsPrintf ("\n");
405             Length = sizeof (ACPI_IORT_ID_MAPPING);
406             Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
407                 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
408                 Length, AcpiDmTableInfoIortMap);
409             if (ACPI_FAILURE (Status))
410             {
411                 return;
412             }
413 
414             NodeOffset += Length;
415         }
416 
417 NextSubtable:
418         /* Point to next node subtable */
419 
420         Offset += IortNode->Length;
421     }
422 }
423 
424 
425 /*******************************************************************************
426  *
427  * FUNCTION:    AcpiDmDumpIvrs
428  *
429  * PARAMETERS:  Table               - A IVRS table
430  *
431  * RETURN:      None
432  *
433  * DESCRIPTION: Format the contents of a IVRS
434  *
435  ******************************************************************************/
436 
437 static UINT8 EntrySizes[] = {4,8,16,32};
438 
439 void
440 AcpiDmDumpIvrs (
441     ACPI_TABLE_HEADER       *Table)
442 {
443     ACPI_STATUS             Status;
444     UINT32                  Offset = sizeof (ACPI_TABLE_IVRS);
445     UINT32                  EntryOffset;
446     UINT32                  EntryLength;
447     UINT32                  EntryType;
448     ACPI_IVRS_DE_HEADER     *DeviceEntry;
449     ACPI_IVRS_HEADER        *Subtable;
450     ACPI_DMTABLE_INFO       *InfoTable;
451 
452 
453     /* Main table */
454 
455     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
456     if (ACPI_FAILURE (Status))
457     {
458         return;
459     }
460 
461     /* Subtables */
462 
463     Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
464     while (Offset < Table->Length)
465     {
466         /* Common subtable header */
467 
468         AcpiOsPrintf ("\n");
469         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
470             Subtable->Length, AcpiDmTableInfoIvrsHdr);
471         if (ACPI_FAILURE (Status))
472         {
473             return;
474         }
475 
476         switch (Subtable->Type)
477         {
478         case ACPI_IVRS_TYPE_HARDWARE1:
479 
480             InfoTable = AcpiDmTableInfoIvrs0;
481             break;
482 
483         case ACPI_IVRS_TYPE_HARDWARE2:
484 
485             InfoTable = AcpiDmTableInfoIvrs01;
486             break;
487 
488         case ACPI_IVRS_TYPE_MEMORY1:
489         case ACPI_IVRS_TYPE_MEMORY2:
490         case ACPI_IVRS_TYPE_MEMORY3:
491 
492             InfoTable = AcpiDmTableInfoIvrs1;
493             break;
494 
495         default:
496 
497             AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
498                 Subtable->Type);
499 
500             /* Attempt to continue */
501 
502             if (!Subtable->Length)
503             {
504                 AcpiOsPrintf ("Invalid zero length subtable\n");
505                 return;
506             }
507             goto NextSubtable;
508         }
509 
510         /* Dump the subtable */
511 
512         AcpiOsPrintf ("\n");
513         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
514             Subtable->Length, InfoTable);
515         if (ACPI_FAILURE (Status))
516         {
517             return;
518         }
519 
520         /* The hardware subtable can contain multiple device entries */
521 
522         if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE1 ||
523             Subtable->Type == ACPI_IVRS_TYPE_HARDWARE2)
524         {
525             if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE1)
526             {
527                 EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE1);
528                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
529                     sizeof (ACPI_IVRS_HARDWARE1));
530             }
531             else if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE2)
532             {
533                 EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE2);
534                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
535                     sizeof (ACPI_IVRS_HARDWARE2));
536             }
537 
538             while (EntryOffset < (Offset + Subtable->Length))
539             {
540                 AcpiOsPrintf ("\n");
541                 /*
542                  * Upper 2 bits of Type encode the length of the device entry
543                  *
544                  * 00 = 4 byte
545                  * 01 = 8 byte
546                  * 10 = 16 byte - currently no entries defined
547                  * 11 = 32 byte - currently no entries defined
548                  */
549                 EntryType = DeviceEntry->Type;
550                 EntryLength = EntrySizes [EntryType >> 6];
551 
552                 switch (EntryType)
553                 {
554                 /* 4-byte device entries */
555 
556                 case ACPI_IVRS_TYPE_PAD4:
557                 case ACPI_IVRS_TYPE_ALL:
558                 case ACPI_IVRS_TYPE_SELECT:
559                 case ACPI_IVRS_TYPE_START:
560                 case ACPI_IVRS_TYPE_END:
561 
562                     InfoTable = AcpiDmTableInfoIvrs4;
563                     break;
564 
565                 /* 8-byte entries, type A */
566 
567                 case ACPI_IVRS_TYPE_ALIAS_SELECT:
568                 case ACPI_IVRS_TYPE_ALIAS_START:
569 
570                     InfoTable = AcpiDmTableInfoIvrs8a;
571                     break;
572 
573                 /* 8-byte entries, type B */
574 
575                 case ACPI_IVRS_TYPE_PAD8:
576                 case ACPI_IVRS_TYPE_EXT_SELECT:
577                 case ACPI_IVRS_TYPE_EXT_START:
578 
579                     InfoTable = AcpiDmTableInfoIvrs8b;
580                     break;
581 
582                 /* 8-byte entries, type C */
583 
584                 case ACPI_IVRS_TYPE_SPECIAL:
585 
586                     InfoTable = AcpiDmTableInfoIvrs8c;
587                     break;
588 
589                 default:
590                     InfoTable = AcpiDmTableInfoIvrs4;
591                     AcpiOsPrintf (
592                         "\n**** Unknown IVRS device entry type/length: "
593                         "0x%.2X/0x%X at offset 0x%.4X: (header below)\n",
594                         EntryType, EntryLength, EntryOffset);
595                     break;
596                 }
597 
598                 /* Dump the Device Entry */
599 
600                 Status = AcpiDmDumpTable (Table->Length, EntryOffset,
601                     DeviceEntry, EntryLength, InfoTable);
602                 if (ACPI_FAILURE (Status))
603                 {
604                     return;
605                 }
606 
607                 EntryOffset += EntryLength;
608                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
609                     EntryLength);
610             }
611         }
612 
613 NextSubtable:
614         /* Point to next subtable */
615 
616         Offset += Subtable->Length;
617         Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, Subtable->Length);
618     }
619 }
620 
621 
622 /*******************************************************************************
623  *
624  * FUNCTION:    AcpiDmDumpLpit
625  *
626  * PARAMETERS:  Table               - A LPIT table
627  *
628  * RETURN:      None
629  *
630  * DESCRIPTION: Format the contents of a LPIT. This table type consists
631  *              of an open-ended number of subtables. Note: There are no
632  *              entries in the main table. An LPIT consists of the table
633  *              header and then subtables only.
634  *
635  ******************************************************************************/
636 
637 void
638 AcpiDmDumpLpit (
639     ACPI_TABLE_HEADER       *Table)
640 {
641     ACPI_STATUS             Status;
642     ACPI_LPIT_HEADER        *Subtable;
643     UINT32                  Length = Table->Length;
644     UINT32                  Offset = sizeof (ACPI_TABLE_LPIT);
645     ACPI_DMTABLE_INFO       *InfoTable;
646     UINT32                  SubtableLength;
647 
648 
649     /* Subtables */
650 
651     Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
652     while (Offset < Table->Length)
653     {
654         /* Common subtable header */
655 
656         Status = AcpiDmDumpTable (Length, Offset, Subtable,
657             sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
658         if (ACPI_FAILURE (Status))
659         {
660             return;
661         }
662 
663         switch (Subtable->Type)
664         {
665         case ACPI_LPIT_TYPE_NATIVE_CSTATE:
666 
667             InfoTable = AcpiDmTableInfoLpit0;
668             SubtableLength = sizeof (ACPI_LPIT_NATIVE);
669             break;
670 
671         default:
672 
673             /* Cannot continue on unknown type - no length */
674 
675             AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n",
676                 Subtable->Type);
677             return;
678         }
679 
680         Status = AcpiDmDumpTable (Length, Offset, Subtable,
681             SubtableLength, InfoTable);
682         if (ACPI_FAILURE (Status))
683         {
684             return;
685         }
686 
687         AcpiOsPrintf ("\n");
688 
689         /* Point to next subtable */
690 
691         Offset += SubtableLength;
692         Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Subtable, SubtableLength);
693     }
694 }
695 
696 
697 /*******************************************************************************
698  *
699  * FUNCTION:    AcpiDmDumpMadt
700  *
701  * PARAMETERS:  Table               - A MADT table
702  *
703  * RETURN:      None
704  *
705  * DESCRIPTION: Format the contents of a MADT. This table type consists
706  *              of an open-ended number of subtables.
707  *
708  ******************************************************************************/
709 
710 void
711 AcpiDmDumpMadt (
712     ACPI_TABLE_HEADER       *Table)
713 {
714     ACPI_STATUS             Status;
715     ACPI_SUBTABLE_HEADER    *Subtable;
716     UINT32                  Length = Table->Length;
717     UINT32                  Offset = sizeof (ACPI_TABLE_MADT);
718     ACPI_DMTABLE_INFO       *InfoTable;
719 
720 
721     /* Main table */
722 
723     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
724     if (ACPI_FAILURE (Status))
725     {
726         return;
727     }
728 
729     /* Subtables */
730 
731     Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
732     while (Offset < Table->Length)
733     {
734         /* Common subtable header */
735 
736         AcpiOsPrintf ("\n");
737         Status = AcpiDmDumpTable (Length, Offset, Subtable,
738             Subtable->Length, AcpiDmTableInfoMadtHdr);
739         if (ACPI_FAILURE (Status))
740         {
741             return;
742         }
743 
744         switch (Subtable->Type)
745         {
746         case ACPI_MADT_TYPE_LOCAL_APIC:
747 
748             InfoTable = AcpiDmTableInfoMadt0;
749             break;
750 
751         case ACPI_MADT_TYPE_IO_APIC:
752 
753             InfoTable = AcpiDmTableInfoMadt1;
754             break;
755 
756         case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
757 
758             InfoTable = AcpiDmTableInfoMadt2;
759             break;
760 
761         case ACPI_MADT_TYPE_NMI_SOURCE:
762 
763             InfoTable = AcpiDmTableInfoMadt3;
764             break;
765 
766         case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
767 
768             InfoTable = AcpiDmTableInfoMadt4;
769             break;
770 
771         case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
772 
773             InfoTable = AcpiDmTableInfoMadt5;
774             break;
775 
776         case ACPI_MADT_TYPE_IO_SAPIC:
777 
778             InfoTable = AcpiDmTableInfoMadt6;
779             break;
780 
781         case ACPI_MADT_TYPE_LOCAL_SAPIC:
782 
783             InfoTable = AcpiDmTableInfoMadt7;
784             break;
785 
786         case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
787 
788             InfoTable = AcpiDmTableInfoMadt8;
789             break;
790 
791         case ACPI_MADT_TYPE_LOCAL_X2APIC:
792 
793             InfoTable = AcpiDmTableInfoMadt9;
794             break;
795 
796         case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
797 
798             InfoTable = AcpiDmTableInfoMadt10;
799             break;
800 
801         case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
802 
803             InfoTable = AcpiDmTableInfoMadt11;
804             break;
805 
806         case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
807 
808             InfoTable = AcpiDmTableInfoMadt12;
809             break;
810 
811         case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
812 
813             InfoTable = AcpiDmTableInfoMadt13;
814             break;
815 
816         case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
817 
818             InfoTable = AcpiDmTableInfoMadt14;
819             break;
820 
821         case ACPI_MADT_TYPE_GENERIC_TRANSLATOR:
822 
823             InfoTable = AcpiDmTableInfoMadt15;
824             break;
825 
826         default:
827 
828             AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n",
829                 Subtable->Type);
830 
831             /* Attempt to continue */
832 
833             if (!Subtable->Length)
834             {
835                 AcpiOsPrintf ("Invalid zero length subtable\n");
836                 return;
837             }
838 
839             goto NextSubtable;
840         }
841 
842         Status = AcpiDmDumpTable (Length, Offset, Subtable,
843             Subtable->Length, InfoTable);
844         if (ACPI_FAILURE (Status))
845         {
846             return;
847         }
848 
849 NextSubtable:
850         /* Point to next subtable */
851 
852         Offset += Subtable->Length;
853         Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable,
854             Subtable->Length);
855     }
856 }
857 
858 
859 /*******************************************************************************
860  *
861  * FUNCTION:    AcpiDmDumpMcfg
862  *
863  * PARAMETERS:  Table               - A MCFG Table
864  *
865  * RETURN:      None
866  *
867  * DESCRIPTION: Format the contents of a MCFG table
868  *
869  ******************************************************************************/
870 
871 void
872 AcpiDmDumpMcfg (
873     ACPI_TABLE_HEADER       *Table)
874 {
875     ACPI_STATUS             Status;
876     UINT32                  Offset = sizeof (ACPI_TABLE_MCFG);
877     ACPI_MCFG_ALLOCATION    *Subtable;
878 
879 
880     /* Main table */
881 
882     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
883     if (ACPI_FAILURE (Status))
884     {
885         return;
886     }
887 
888     /* Subtables */
889 
890     Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
891     while (Offset < Table->Length)
892     {
893         if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
894         {
895             AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
896                 (UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
897             return;
898         }
899 
900         AcpiOsPrintf ("\n");
901         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
902             sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
903         if (ACPI_FAILURE (Status))
904         {
905             return;
906         }
907 
908         /* Point to next subtable (each subtable is of fixed length) */
909 
910         Offset += sizeof (ACPI_MCFG_ALLOCATION);
911         Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Subtable,
912             sizeof (ACPI_MCFG_ALLOCATION));
913     }
914 }
915 
916 
917 /*******************************************************************************
918  *
919  * FUNCTION:    AcpiDmDumpMpst
920  *
921  * PARAMETERS:  Table               - A MPST Table
922  *
923  * RETURN:      None
924  *
925  * DESCRIPTION: Format the contents of a MPST table
926  *
927  ******************************************************************************/
928 
929 void
930 AcpiDmDumpMpst (
931     ACPI_TABLE_HEADER       *Table)
932 {
933     ACPI_STATUS             Status;
934     UINT32                  Offset = sizeof (ACPI_TABLE_MPST);
935     ACPI_MPST_POWER_NODE    *Subtable0;
936     ACPI_MPST_POWER_STATE   *Subtable0A;
937     ACPI_MPST_COMPONENT     *Subtable0B;
938     ACPI_MPST_DATA_HDR      *Subtable1;
939     ACPI_MPST_POWER_DATA    *Subtable2;
940     UINT16                  SubtableCount;
941     UINT32                  PowerStateCount;
942     UINT32                  ComponentCount;
943 
944 
945     /* Main table */
946 
947     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
948     if (ACPI_FAILURE (Status))
949     {
950         return;
951     }
952 
953     /* Subtable: Memory Power Node(s) */
954 
955     SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
956     Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
957 
958     while ((Offset < Table->Length) && SubtableCount)
959     {
960         AcpiOsPrintf ("\n");
961         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0,
962             sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
963         if (ACPI_FAILURE (Status))
964         {
965             return;
966         }
967 
968         /* Extract the sub-subtable counts */
969 
970         PowerStateCount = Subtable0->NumPowerStates;
971         ComponentCount = Subtable0->NumPhysicalComponents;
972         Offset += sizeof (ACPI_MPST_POWER_NODE);
973 
974         /* Sub-subtables - Memory Power State Structure(s) */
975 
976         Subtable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, Subtable0,
977             sizeof (ACPI_MPST_POWER_NODE));
978 
979         while (PowerStateCount)
980         {
981             AcpiOsPrintf ("\n");
982             Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0A,
983                 sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
984             if (ACPI_FAILURE (Status))
985             {
986                 return;
987             }
988 
989             Subtable0A++;
990             PowerStateCount--;
991             Offset += sizeof (ACPI_MPST_POWER_STATE);
992        }
993 
994         /* Sub-subtables - Physical Component ID Structure(s) */
995 
996         Subtable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, Subtable0A);
997 
998         if (ComponentCount)
999         {
1000             AcpiOsPrintf ("\n");
1001         }
1002 
1003         while (ComponentCount)
1004         {
1005             Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0B,
1006                 sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
1007             if (ACPI_FAILURE (Status))
1008             {
1009                 return;
1010             }
1011 
1012             Subtable0B++;
1013             ComponentCount--;
1014             Offset += sizeof (ACPI_MPST_COMPONENT);
1015         }
1016 
1017         /* Point to next Memory Power Node subtable */
1018 
1019         SubtableCount--;
1020         Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Subtable0,
1021             sizeof (ACPI_MPST_POWER_NODE) +
1022             (sizeof (ACPI_MPST_POWER_STATE) * Subtable0->NumPowerStates) +
1023             (sizeof (ACPI_MPST_COMPONENT) * Subtable0->NumPhysicalComponents));
1024     }
1025 
1026     /* Subtable: Count of Memory Power State Characteristic structures */
1027 
1028     AcpiOsPrintf ("\n");
1029     Subtable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable0);
1030     Status = AcpiDmDumpTable (Table->Length, Offset, Subtable1,
1031         sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
1032     if (ACPI_FAILURE (Status))
1033     {
1034         return;
1035     }
1036 
1037     SubtableCount = Subtable1->CharacteristicsCount;
1038     Offset += sizeof (ACPI_MPST_DATA_HDR);
1039 
1040     /* Subtable: Memory Power State Characteristics structure(s) */
1041 
1042     Subtable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, Subtable1,
1043         sizeof (ACPI_MPST_DATA_HDR));
1044 
1045     while ((Offset < Table->Length) && SubtableCount)
1046     {
1047         AcpiOsPrintf ("\n");
1048         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable2,
1049             sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
1050         if (ACPI_FAILURE (Status))
1051         {
1052             return;
1053         }
1054 
1055         Subtable2++;
1056         SubtableCount--;
1057         Offset += sizeof (ACPI_MPST_POWER_DATA);
1058     }
1059 }
1060 
1061 
1062 /*******************************************************************************
1063  *
1064  * FUNCTION:    AcpiDmDumpMsct
1065  *
1066  * PARAMETERS:  Table               - A MSCT table
1067  *
1068  * RETURN:      None
1069  *
1070  * DESCRIPTION: Format the contents of a MSCT
1071  *
1072  ******************************************************************************/
1073 
1074 void
1075 AcpiDmDumpMsct (
1076     ACPI_TABLE_HEADER       *Table)
1077 {
1078     ACPI_STATUS             Status;
1079     UINT32                  Offset = sizeof (ACPI_TABLE_MSCT);
1080     ACPI_MSCT_PROXIMITY     *Subtable;
1081 
1082 
1083     /* Main table */
1084 
1085     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
1086     if (ACPI_FAILURE (Status))
1087     {
1088         return;
1089     }
1090 
1091     /* Subtables */
1092 
1093     Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
1094     while (Offset < Table->Length)
1095     {
1096         /* Common subtable header */
1097 
1098         AcpiOsPrintf ("\n");
1099         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1100             sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
1101         if (ACPI_FAILURE (Status))
1102         {
1103             return;
1104         }
1105 
1106         /* Point to next subtable */
1107 
1108         Offset += sizeof (ACPI_MSCT_PROXIMITY);
1109         Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Subtable,
1110             sizeof (ACPI_MSCT_PROXIMITY));
1111     }
1112 }
1113 
1114 
1115 /*******************************************************************************
1116  *
1117  * FUNCTION:    AcpiDmDumpMtmr
1118  *
1119  * PARAMETERS:  Table               - A MTMR table
1120  *
1121  * RETURN:      None
1122  *
1123  * DESCRIPTION: Format the contents of a MTMR
1124  *
1125  ******************************************************************************/
1126 
1127 void
1128 AcpiDmDumpMtmr (
1129     ACPI_TABLE_HEADER       *Table)
1130 {
1131     ACPI_STATUS             Status;
1132     UINT32                  Offset = sizeof (ACPI_TABLE_MTMR);
1133     ACPI_MTMR_ENTRY         *Subtable;
1134 
1135 
1136     /* Main table */
1137 
1138     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
1139     if (ACPI_FAILURE (Status))
1140     {
1141         return;
1142     }
1143 
1144     /* Subtables */
1145 
1146     Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
1147     while (Offset < Table->Length)
1148     {
1149         /* Common subtable header */
1150 
1151         AcpiOsPrintf ("\n");
1152         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1153             sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
1154         if (ACPI_FAILURE (Status))
1155         {
1156             return;
1157         }
1158 
1159         /* Point to next subtable */
1160 
1161         Offset += sizeof (ACPI_MTMR_ENTRY);
1162         Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Subtable,
1163             sizeof (ACPI_MTMR_ENTRY));
1164     }
1165 }
1166 
1167 
1168 /*******************************************************************************
1169  *
1170  * FUNCTION:    AcpiDmDumpNfit
1171  *
1172  * PARAMETERS:  Table               - A NFIT table
1173  *
1174  * RETURN:      None
1175  *
1176  * DESCRIPTION: Format the contents of an NFIT.
1177  *
1178  ******************************************************************************/
1179 
1180 void
1181 AcpiDmDumpNfit (
1182     ACPI_TABLE_HEADER       *Table)
1183 {
1184     ACPI_STATUS             Status;
1185     UINT32                  Offset = sizeof (ACPI_TABLE_NFIT);
1186     UINT32                  FieldOffset = 0;
1187     UINT32                  Length;
1188     ACPI_NFIT_HEADER        *Subtable;
1189     ACPI_DMTABLE_INFO       *InfoTable;
1190     ACPI_NFIT_INTERLEAVE    *Interleave = NULL;
1191     ACPI_NFIT_SMBIOS        *SmbiosInfo = NULL;
1192     ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
1193     UINT32                  i;
1194 
1195 
1196     /* Main table */
1197 
1198     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit);
1199     if (ACPI_FAILURE (Status))
1200     {
1201         return;
1202     }
1203 
1204     /* Subtables */
1205 
1206     Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset);
1207     while (Offset < Table->Length)
1208     {
1209         /* NFIT subtable header */
1210 
1211         AcpiOsPrintf ("\n");
1212         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1213             Subtable->Length, AcpiDmTableInfoNfitHdr);
1214         if (ACPI_FAILURE (Status))
1215         {
1216             return;
1217         }
1218 
1219         switch (Subtable->Type)
1220         {
1221         case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
1222 
1223             InfoTable = AcpiDmTableInfoNfit0;
1224             break;
1225 
1226         case ACPI_NFIT_TYPE_MEMORY_MAP:
1227 
1228             InfoTable = AcpiDmTableInfoNfit1;
1229             break;
1230 
1231         case ACPI_NFIT_TYPE_INTERLEAVE:
1232 
1233             /* Has a variable number of 32-bit values at the end */
1234 
1235             InfoTable = AcpiDmTableInfoNfit2;
1236             FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE);
1237             break;
1238 
1239         case ACPI_NFIT_TYPE_SMBIOS:
1240 
1241             SmbiosInfo = ACPI_CAST_PTR (ACPI_NFIT_SMBIOS, Subtable);
1242             InfoTable = AcpiDmTableInfoNfit3;
1243             break;
1244 
1245         case ACPI_NFIT_TYPE_CONTROL_REGION:
1246 
1247             InfoTable = AcpiDmTableInfoNfit4;
1248             break;
1249 
1250         case ACPI_NFIT_TYPE_DATA_REGION:
1251 
1252             InfoTable = AcpiDmTableInfoNfit5;
1253             break;
1254 
1255         case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
1256 
1257             /* Has a variable number of 64-bit addresses at the end */
1258 
1259             InfoTable = AcpiDmTableInfoNfit6;
1260             FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64);
1261             break;
1262 
1263         case ACPI_NFIT_TYPE_CAPABILITIES:    /* ACPI 6.0A */
1264 
1265             InfoTable = AcpiDmTableInfoNfit7;
1266             break;
1267 
1268         default:
1269             AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
1270                 Subtable->Type);
1271 
1272             /* Attempt to continue */
1273 
1274             if (!Subtable->Length)
1275             {
1276                 AcpiOsPrintf ("Invalid zero length subtable\n");
1277                 return;
1278             }
1279             goto NextSubtable;
1280         }
1281 
1282         AcpiOsPrintf ("\n");
1283         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1284             Subtable->Length, InfoTable);
1285         if (ACPI_FAILURE (Status))
1286         {
1287             return;
1288         }
1289 
1290         /* Per-subtable variable-length fields */
1291 
1292         switch (Subtable->Type)
1293         {
1294         case ACPI_NFIT_TYPE_INTERLEAVE:
1295 
1296             Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable);
1297             for (i = 0; i < Interleave->LineCount; i++)
1298             {
1299                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
1300                     &Interleave->LineOffset[i],
1301                     sizeof (UINT32), AcpiDmTableInfoNfit2a);
1302                 if (ACPI_FAILURE (Status))
1303                 {
1304                     return;
1305                 }
1306 
1307                 FieldOffset += sizeof (UINT32);
1308             }
1309             break;
1310 
1311         case ACPI_NFIT_TYPE_SMBIOS:
1312 
1313             Length = Subtable->Length -
1314                 sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
1315 
1316             if (Length)
1317             {
1318                 Status = AcpiDmDumpTable (Table->Length,
1319                     sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
1320                     SmbiosInfo,
1321                     Length, AcpiDmTableInfoNfit3a);
1322                 if (ACPI_FAILURE (Status))
1323                 {
1324                     return;
1325                 }
1326             }
1327 
1328             break;
1329 
1330         case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
1331 
1332             Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable);
1333             for (i = 0; i < Hint->HintCount; i++)
1334             {
1335                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
1336                     &Hint->HintAddress[i],
1337                     sizeof (UINT64), AcpiDmTableInfoNfit6a);
1338                 if (ACPI_FAILURE (Status))
1339                 {
1340                     return;
1341                 }
1342 
1343                 FieldOffset += sizeof (UINT64);
1344             }
1345             break;
1346 
1347         default:
1348             break;
1349         }
1350 
1351 NextSubtable:
1352         /* Point to next subtable */
1353 
1354         Offset += Subtable->Length;
1355         Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, Subtable->Length);
1356     }
1357 }
1358 
1359 
1360 /*******************************************************************************
1361  *
1362  * FUNCTION:    AcpiDmDumpPcct
1363  *
1364  * PARAMETERS:  Table               - A PCCT table
1365  *
1366  * RETURN:      None
1367  *
1368  * DESCRIPTION: Format the contents of a PCCT. This table type consists
1369  *              of an open-ended number of subtables.
1370  *
1371  ******************************************************************************/
1372 
1373 void
1374 AcpiDmDumpPcct (
1375     ACPI_TABLE_HEADER       *Table)
1376 {
1377     ACPI_STATUS             Status;
1378     ACPI_PCCT_SUBSPACE      *Subtable;
1379     ACPI_DMTABLE_INFO       *InfoTable;
1380     UINT32                  Length = Table->Length;
1381     UINT32                  Offset = sizeof (ACPI_TABLE_PCCT);
1382 
1383 
1384     /* Main table */
1385 
1386     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
1387     if (ACPI_FAILURE (Status))
1388     {
1389         return;
1390     }
1391 
1392     /* Subtables */
1393 
1394     Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
1395     while (Offset < Table->Length)
1396     {
1397         /* Common subtable header */
1398 
1399         AcpiOsPrintf ("\n");
1400         Status = AcpiDmDumpTable (Length, Offset, Subtable,
1401             Subtable->Header.Length, AcpiDmTableInfoPcctHdr);
1402         if (ACPI_FAILURE (Status))
1403         {
1404             return;
1405         }
1406 
1407         switch (Subtable->Header.Type)
1408         {
1409         case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
1410 
1411             InfoTable = AcpiDmTableInfoPcct0;
1412             break;
1413 
1414         case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
1415 
1416             InfoTable = AcpiDmTableInfoPcct1;
1417             break;
1418 
1419         case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2:
1420 
1421             InfoTable = AcpiDmTableInfoPcct2;
1422             break;
1423 
1424         case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE:
1425 
1426             InfoTable = AcpiDmTableInfoPcct3;
1427             break;
1428 
1429         case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE:
1430 
1431             InfoTable = AcpiDmTableInfoPcct4;
1432             break;
1433 
1434         default:
1435 
1436             AcpiOsPrintf (
1437                 "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
1438                 Subtable->Header.Type);
1439             return;
1440         }
1441 
1442         AcpiOsPrintf ("\n");
1443         Status = AcpiDmDumpTable (Length, Offset, Subtable,
1444             Subtable->Header.Length, InfoTable);
1445         if (ACPI_FAILURE (Status))
1446         {
1447             return;
1448         }
1449 
1450         /* Point to next subtable */
1451 
1452         Offset += Subtable->Header.Length;
1453         Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Subtable,
1454             Subtable->Header.Length);
1455     }
1456 }
1457 
1458 
1459 /*******************************************************************************
1460  *
1461  * FUNCTION:    AcpiDmDumpPdtt
1462  *
1463  * PARAMETERS:  Table               - A PDTT table
1464  *
1465  * RETURN:      None
1466  *
1467  * DESCRIPTION: Format the contents of a Pdtt. This is a variable-length
1468  *              table that contains an open-ended number of IDs
1469  *              at the end of the table.
1470  *
1471  ******************************************************************************/
1472 
1473 void
1474 AcpiDmDumpPdtt (
1475     ACPI_TABLE_HEADER       *Table)
1476 {
1477     ACPI_STATUS             Status;
1478     ACPI_PDTT_CHANNEL       *Subtable;
1479     UINT32                  Length = Table->Length;
1480     UINT32                  Offset = sizeof (ACPI_TABLE_PDTT);
1481 
1482 
1483     /* Main table */
1484 
1485     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPdtt);
1486     if (ACPI_FAILURE (Status))
1487     {
1488         return;
1489     }
1490 
1491     /* Subtables. Currently there is only one type, but can be multiples */
1492 
1493     Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Table, Offset);
1494     while (Offset < Table->Length)
1495     {
1496         AcpiOsPrintf ("\n");
1497         Status = AcpiDmDumpTable (Length, Offset, Subtable,
1498             sizeof (ACPI_PDTT_CHANNEL), AcpiDmTableInfoPdtt0);
1499         if (ACPI_FAILURE (Status))
1500         {
1501             return;
1502         }
1503 
1504         /* Point to next subtable */
1505 
1506         Offset += sizeof (ACPI_PDTT_CHANNEL);
1507         Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Subtable,
1508             sizeof (ACPI_PDTT_CHANNEL));
1509     }
1510 }
1511 
1512 
1513 /*******************************************************************************
1514  *
1515  * FUNCTION:    AcpiDmDumpPmtt
1516  *
1517  * PARAMETERS:  Table               - A PMTT table
1518  *
1519  * RETURN:      None
1520  *
1521  * DESCRIPTION: Format the contents of a PMTT. This table type consists
1522  *              of an open-ended number of subtables.
1523  *
1524  ******************************************************************************/
1525 
1526 void
1527 AcpiDmDumpPmtt (
1528     ACPI_TABLE_HEADER       *Table)
1529 {
1530     ACPI_STATUS             Status;
1531     ACPI_PMTT_HEADER        *Subtable;
1532     ACPI_PMTT_HEADER        *MemSubtable;
1533     ACPI_PMTT_HEADER        *DimmSubtable;
1534     ACPI_PMTT_DOMAIN        *DomainArray;
1535     UINT32                  Length = Table->Length;
1536     UINT32                  Offset = sizeof (ACPI_TABLE_PMTT);
1537     UINT32                  MemOffset;
1538     UINT32                  DimmOffset;
1539     UINT32                  DomainOffset;
1540     UINT32                  DomainCount;
1541 
1542 
1543     /* Main table */
1544 
1545     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
1546     if (ACPI_FAILURE (Status))
1547     {
1548         return;
1549     }
1550 
1551     /* Subtables */
1552 
1553     Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
1554     while (Offset < Table->Length)
1555     {
1556         /* Common subtable header */
1557 
1558         AcpiOsPrintf ("\n");
1559         Status = AcpiDmDumpTable (Length, Offset, Subtable,
1560             Subtable->Length, AcpiDmTableInfoPmttHdr);
1561         if (ACPI_FAILURE (Status))
1562         {
1563             return;
1564         }
1565 
1566         /* Only Socket subtables are expected at this level */
1567 
1568         if (Subtable->Type != ACPI_PMTT_TYPE_SOCKET)
1569         {
1570             AcpiOsPrintf (
1571                 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
1572                 Subtable->Type);
1573             return;
1574         }
1575 
1576         /* Dump the fixed-length portion of the subtable */
1577 
1578         Status = AcpiDmDumpTable (Length, Offset, Subtable,
1579             Subtable->Length, AcpiDmTableInfoPmtt0);
1580         if (ACPI_FAILURE (Status))
1581         {
1582             return;
1583         }
1584 
1585         /* Walk the memory controller subtables */
1586 
1587         MemOffset = sizeof (ACPI_PMTT_SOCKET);
1588         MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Subtable,
1589             sizeof (ACPI_PMTT_SOCKET));
1590 
1591         while (((Offset + MemOffset) < Table->Length) &&
1592             (MemOffset < Subtable->Length))
1593         {
1594             /* Common subtable header */
1595 
1596             AcpiOsPrintf ("\n");
1597             Status = AcpiDmDumpTable (Length,
1598                 Offset + MemOffset, MemSubtable,
1599                 MemSubtable->Length, AcpiDmTableInfoPmttHdr);
1600             if (ACPI_FAILURE (Status))
1601             {
1602                 return;
1603             }
1604 
1605             /* Only memory controller subtables are expected at this level */
1606 
1607             if (MemSubtable->Type != ACPI_PMTT_TYPE_CONTROLLER)
1608             {
1609                 AcpiOsPrintf (
1610                     "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
1611                     MemSubtable->Type);
1612                 return;
1613             }
1614 
1615             /* Dump the fixed-length portion of the controller subtable */
1616 
1617             Status = AcpiDmDumpTable (Length,
1618                 Offset + MemOffset, MemSubtable,
1619                 MemSubtable->Length, AcpiDmTableInfoPmtt1);
1620             if (ACPI_FAILURE (Status))
1621             {
1622                 return;
1623             }
1624 
1625             /* Walk the variable count of proximity domains */
1626 
1627             DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubtable)->DomainCount;
1628             DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
1629             DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubtable,
1630                 sizeof (ACPI_PMTT_CONTROLLER));
1631 
1632             while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
1633                 ((MemOffset + DomainOffset) < Subtable->Length) &&
1634                 DomainCount)
1635             {
1636                 Status = AcpiDmDumpTable (Length,
1637                     Offset + MemOffset + DomainOffset, DomainArray,
1638                     sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
1639                 if (ACPI_FAILURE (Status))
1640                 {
1641                     return;
1642                 }
1643 
1644                 DomainOffset += sizeof (ACPI_PMTT_DOMAIN);
1645                 DomainArray++;
1646                 DomainCount--;
1647             }
1648 
1649             if (DomainCount)
1650             {
1651                 AcpiOsPrintf (
1652                     "\n**** DomainCount exceeds subtable length\n\n");
1653             }
1654 
1655             /* Walk the physical component (DIMM) subtables */
1656 
1657             DimmOffset = DomainOffset;
1658             DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubtable,
1659                 DomainOffset);
1660 
1661             while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
1662                 (DimmOffset < MemSubtable->Length))
1663             {
1664                 /* Common subtable header */
1665 
1666                 AcpiOsPrintf ("\n");
1667                 Status = AcpiDmDumpTable (Length,
1668                     Offset + MemOffset + DimmOffset, DimmSubtable,
1669                     DimmSubtable->Length, AcpiDmTableInfoPmttHdr);
1670                 if (ACPI_FAILURE (Status))
1671                 {
1672                     return;
1673                 }
1674 
1675                 /* Only DIMM subtables are expected at this level */
1676 
1677                 if (DimmSubtable->Type != ACPI_PMTT_TYPE_DIMM)
1678                 {
1679                     AcpiOsPrintf (
1680                         "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
1681                         DimmSubtable->Type);
1682                     return;
1683                 }
1684 
1685                 /* Dump the fixed-length DIMM subtable */
1686 
1687                 Status = AcpiDmDumpTable (Length,
1688                     Offset + MemOffset + DimmOffset, DimmSubtable,
1689                     DimmSubtable->Length, AcpiDmTableInfoPmtt2);
1690                 if (ACPI_FAILURE (Status))
1691                 {
1692                     return;
1693                 }
1694 
1695                 /* Point to next DIMM subtable */
1696 
1697                 DimmOffset += DimmSubtable->Length;
1698                 DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
1699                     DimmSubtable, DimmSubtable->Length);
1700             }
1701 
1702             /* Point to next Controller subtable */
1703 
1704             MemOffset += MemSubtable->Length;
1705             MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
1706                 MemSubtable, MemSubtable->Length);
1707         }
1708 
1709         /* Point to next Socket subtable */
1710 
1711         Offset += Subtable->Length;
1712         Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
1713             Subtable, Subtable->Length);
1714     }
1715 }
1716 
1717 
1718 /*******************************************************************************
1719  *
1720  * FUNCTION:    AcpiDmDumpPptt
1721  *
1722  * PARAMETERS:  Table               - A PMTT table
1723  *
1724  * RETURN:      None
1725  *
1726  * DESCRIPTION: Format the contents of a PPTT. This table type consists
1727  *              of an open-ended number of subtables.
1728  *
1729  ******************************************************************************/
1730 
1731 void
1732 AcpiDmDumpPptt (
1733     ACPI_TABLE_HEADER       *Table)
1734 {
1735     ACPI_STATUS             Status;
1736     ACPI_SUBTABLE_HEADER    *Subtable;
1737     ACPI_PPTT_PROCESSOR     *PpttProcessor;
1738     UINT8                   Length;
1739     UINT8                   SubtableOffset;
1740     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
1741     ACPI_DMTABLE_INFO       *InfoTable;
1742     UINT32                  i;
1743 
1744 
1745     /* There is no main table (other than the standard ACPI header) */
1746 
1747     /* Subtables */
1748 
1749     Offset = sizeof (ACPI_TABLE_HEADER);
1750     while (Offset < Table->Length)
1751     {
1752         AcpiOsPrintf ("\n");
1753 
1754         /* Common subtable header */
1755 
1756         Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
1757         if (Subtable->Length < sizeof (ACPI_SUBTABLE_HEADER))
1758         {
1759             AcpiOsPrintf ("Invalid subtable length\n");
1760             return;
1761         }
1762         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1763             Subtable->Length, AcpiDmTableInfoPpttHdr);
1764         if (ACPI_FAILURE (Status))
1765         {
1766             return;
1767         }
1768 
1769         switch (Subtable->Type)
1770         {
1771         case ACPI_PPTT_TYPE_PROCESSOR:
1772 
1773             InfoTable = AcpiDmTableInfoPptt0;
1774             Length = sizeof (ACPI_PPTT_PROCESSOR);
1775             break;
1776 
1777         case ACPI_PPTT_TYPE_CACHE:
1778 
1779             InfoTable = AcpiDmTableInfoPptt1;
1780             Length = sizeof (ACPI_PPTT_CACHE);
1781             break;
1782 
1783         case ACPI_PPTT_TYPE_ID:
1784 
1785             InfoTable = AcpiDmTableInfoPptt2;
1786             Length = sizeof (ACPI_PPTT_ID);
1787             break;
1788 
1789         default:
1790 
1791             AcpiOsPrintf ("\n**** Unknown PPTT subtable type 0x%X\n\n",
1792                 Subtable->Type);
1793 
1794             /* Attempt to continue */
1795 
1796             goto NextSubtable;
1797         }
1798 
1799         if (Subtable->Length < Length)
1800         {
1801             AcpiOsPrintf ("Invalid subtable length\n");
1802             return;
1803         }
1804         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1805             Subtable->Length, InfoTable);
1806         if (ACPI_FAILURE (Status))
1807         {
1808             return;
1809         }
1810         SubtableOffset = Length;
1811 
1812         switch (Subtable->Type)
1813         {
1814         case ACPI_PPTT_TYPE_PROCESSOR:
1815 
1816             PpttProcessor = ACPI_CAST_PTR (ACPI_PPTT_PROCESSOR, Subtable);
1817 
1818             /* Dump SMBIOS handles */
1819 
1820             if ((UINT8)(Subtable->Length - SubtableOffset) <
1821                 (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
1822             {
1823                 AcpiOsPrintf ("Invalid private resource number\n");
1824                 return;
1825             }
1826             for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++)
1827             {
1828                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1829                     ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
1830                     4, AcpiDmTableInfoPptt0a);
1831                 if (ACPI_FAILURE (Status))
1832                 {
1833                     return;
1834                 }
1835 
1836                 SubtableOffset += 4;
1837             }
1838             break;
1839 
1840         default:
1841 
1842             break;
1843         }
1844 
1845 NextSubtable:
1846         /* Point to next subtable */
1847 
1848         Offset += Subtable->Length;
1849     }
1850 }
1851 
1852 
1853 /*******************************************************************************
1854  *
1855  * FUNCTION:    AcpiDmDumpS3pt
1856  *
1857  * PARAMETERS:  Table               - A S3PT table
1858  *
1859  * RETURN:      Length of the table
1860  *
1861  * DESCRIPTION: Format the contents of a S3PT
1862  *
1863  ******************************************************************************/
1864 
1865 UINT32
1866 AcpiDmDumpS3pt (
1867     ACPI_TABLE_HEADER       *Tables)
1868 {
1869     ACPI_STATUS             Status;
1870     UINT32                  Offset = sizeof (ACPI_TABLE_S3PT);
1871     ACPI_FPDT_HEADER        *Subtable;
1872     ACPI_DMTABLE_INFO       *InfoTable;
1873     ACPI_TABLE_S3PT         *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
1874 
1875 
1876     /* Main table */
1877 
1878     Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt);
1879     if (ACPI_FAILURE (Status))
1880     {
1881         return 0;
1882     }
1883 
1884     Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
1885     while (Offset < S3ptTable->Length)
1886     {
1887         /* Common subtable header */
1888 
1889         AcpiOsPrintf ("\n");
1890         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
1891             Subtable->Length, AcpiDmTableInfoS3ptHdr);
1892         if (ACPI_FAILURE (Status))
1893         {
1894             return 0;
1895         }
1896 
1897         switch (Subtable->Type)
1898         {
1899         case ACPI_S3PT_TYPE_RESUME:
1900 
1901             InfoTable = AcpiDmTableInfoS3pt0;
1902             break;
1903 
1904         case ACPI_S3PT_TYPE_SUSPEND:
1905 
1906             InfoTable = AcpiDmTableInfoS3pt1;
1907             break;
1908 
1909         default:
1910 
1911             AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
1912                 Subtable->Type);
1913 
1914             /* Attempt to continue */
1915 
1916             if (!Subtable->Length)
1917             {
1918                 AcpiOsPrintf ("Invalid zero length subtable\n");
1919                 return 0;
1920             }
1921             goto NextSubtable;
1922         }
1923 
1924         AcpiOsPrintf ("\n");
1925         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable,
1926             Subtable->Length, InfoTable);
1927         if (ACPI_FAILURE (Status))
1928         {
1929             return 0;
1930         }
1931 
1932 NextSubtable:
1933         /* Point to next subtable */
1934 
1935         Offset += Subtable->Length;
1936         Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length);
1937     }
1938 
1939     return (S3ptTable->Length);
1940 }
1941 
1942 
1943 /*******************************************************************************
1944  *
1945  * FUNCTION:    AcpiDmDumpSdev
1946  *
1947  * PARAMETERS:  Table               - A SDEV table
1948  *
1949  * RETURN:      None
1950  *
1951  * DESCRIPTION: Format the contents of a SDEV. This is a variable-length
1952  *              table that contains variable strings and vendor data.
1953  *
1954  ******************************************************************************/
1955 
1956 void
1957 AcpiDmDumpSdev (
1958     ACPI_TABLE_HEADER       *Table)
1959 {
1960     ACPI_STATUS             Status;
1961     ACPI_SDEV_HEADER        *Subtable;
1962     ACPI_SDEV_PCIE          *Pcie;
1963     ACPI_SDEV_NAMESPACE     *Namesp;
1964     ACPI_DMTABLE_INFO       *InfoTable;
1965     UINT32                  Length = Table->Length;
1966     UINT32                  Offset = sizeof (ACPI_TABLE_SDEV);
1967     UINT16                  PathOffset;
1968     UINT16                  PathLength;
1969     UINT16                  VendorDataOffset;
1970     UINT16                  VendorDataLength;
1971 
1972 
1973     /* Main table */
1974 
1975     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSdev);
1976     if (ACPI_FAILURE (Status))
1977     {
1978         return;
1979     }
1980 
1981     /* Subtables */
1982 
1983     Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Table, Offset);
1984     while (Offset < Table->Length)
1985     {
1986         /* Common subtable header */
1987 
1988         AcpiOsPrintf ("\n");
1989         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
1990             Subtable->Length, AcpiDmTableInfoSdevHdr);
1991         if (ACPI_FAILURE (Status))
1992         {
1993             return;
1994         }
1995 
1996         switch (Subtable->Type)
1997         {
1998         case ACPI_SDEV_TYPE_NAMESPACE_DEVICE:
1999 
2000             InfoTable = AcpiDmTableInfoSdev0;
2001             break;
2002 
2003         case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
2004 
2005             InfoTable = AcpiDmTableInfoSdev1;
2006             break;
2007 
2008         default:
2009             goto NextSubtable;
2010         }
2011 
2012         AcpiOsPrintf ("\n");
2013         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
2014             Subtable->Length, InfoTable);
2015         if (ACPI_FAILURE (Status))
2016         {
2017             return;
2018         }
2019 
2020         switch (Subtable->Type)
2021         {
2022         case ACPI_SDEV_TYPE_NAMESPACE_DEVICE:
2023 
2024             /* Dump the PCIe device ID(s) */
2025 
2026             Namesp = ACPI_CAST_PTR (ACPI_SDEV_NAMESPACE, Subtable);
2027             PathOffset = Namesp->DeviceIdOffset;
2028             PathLength = Namesp->DeviceIdLength;
2029 
2030             if (PathLength)
2031             {
2032                 Status = AcpiDmDumpTable (Table->Length, 0,
2033                     ACPI_ADD_PTR (UINT8, Namesp, PathOffset),
2034                     PathLength, AcpiDmTableInfoSdev0a);
2035                 if (ACPI_FAILURE (Status))
2036                 {
2037                     return;
2038                 }
2039             }
2040 
2041             /* Dump the vendor-specific data */
2042 
2043             VendorDataLength =
2044                 Namesp->VendorDataLength;
2045             VendorDataOffset =
2046                 Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
2047 
2048             if (VendorDataLength)
2049             {
2050                 Status = AcpiDmDumpTable (Table->Length, 0,
2051                     ACPI_ADD_PTR (UINT8, Namesp, VendorDataOffset),
2052                     VendorDataLength, AcpiDmTableInfoSdev1b);
2053                 if (ACPI_FAILURE (Status))
2054                 {
2055                     return;
2056                 }
2057             }
2058             break;
2059 
2060         case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
2061 
2062             /* PCI path substructures */
2063 
2064             Pcie = ACPI_CAST_PTR (ACPI_SDEV_PCIE, Subtable);
2065             PathOffset = Pcie->PathOffset;
2066             PathLength = Pcie->PathLength;
2067 
2068             while (PathLength)
2069             {
2070                 Status = AcpiDmDumpTable (Table->Length,
2071                     PathOffset + Offset,
2072                     ACPI_ADD_PTR (UINT8, Pcie, PathOffset),
2073                     sizeof (ACPI_SDEV_PCIE_PATH), AcpiDmTableInfoSdev1a);
2074                 if (ACPI_FAILURE (Status))
2075                 {
2076                     return;
2077                 }
2078 
2079                 PathOffset += sizeof (ACPI_SDEV_PCIE_PATH);
2080                 PathLength -= sizeof (ACPI_SDEV_PCIE_PATH);
2081             }
2082 
2083             /* VendorData */
2084 
2085             VendorDataLength = Pcie->VendorDataLength;
2086             VendorDataOffset = Pcie->PathOffset + Pcie->PathLength;
2087 
2088             if (VendorDataLength)
2089             {
2090                 Status = AcpiDmDumpTable (Table->Length, 0,
2091                     ACPI_ADD_PTR (UINT8, Pcie, VendorDataOffset),
2092                     VendorDataLength, AcpiDmTableInfoSdev1b);
2093                 if (ACPI_FAILURE (Status))
2094                 {
2095                     return;
2096                 }
2097             }
2098             break;
2099 
2100         default:
2101             goto NextSubtable;
2102         }
2103 
2104 NextSubtable:
2105         /* Point to next subtable */
2106 
2107         Offset += Subtable->Length;
2108         Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Subtable,
2109             Subtable->Length);
2110     }
2111 }
2112