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