xref: /illumos-gate/usr/src/cmd/acpi/common/dmtable.c (revision 35786f68)
1bc36eafdSMike Gerdts /******************************************************************************
2bc36eafdSMike Gerdts  *
3bc36eafdSMike Gerdts  * Module Name: dmtable - Support for ACPI tables that contain no AML code
4bc36eafdSMike Gerdts  *
5bc36eafdSMike Gerdts  *****************************************************************************/
6bc36eafdSMike Gerdts 
7*35786f68SRobert Mustacchi /******************************************************************************
8*35786f68SRobert Mustacchi  *
9*35786f68SRobert Mustacchi  * 1. Copyright Notice
10*35786f68SRobert Mustacchi  *
11*35786f68SRobert Mustacchi  * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12bc36eafdSMike Gerdts  * All rights reserved.
13bc36eafdSMike Gerdts  *
14*35786f68SRobert Mustacchi  * 2. License
15*35786f68SRobert Mustacchi  *
16*35786f68SRobert Mustacchi  * 2.1. This is your license from Intel Corp. under its intellectual property
17*35786f68SRobert Mustacchi  * rights. You may have additional license terms from the party that provided
18*35786f68SRobert Mustacchi  * you this software, covering your right to use that party's intellectual
19*35786f68SRobert Mustacchi  * property rights.
20*35786f68SRobert Mustacchi  *
21*35786f68SRobert Mustacchi  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22*35786f68SRobert Mustacchi  * copy of the source code appearing in this file ("Covered Code") an
23*35786f68SRobert Mustacchi  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24*35786f68SRobert Mustacchi  * base code distributed originally by Intel ("Original Intel Code") to copy,
25*35786f68SRobert Mustacchi  * make derivatives, distribute, use and display any portion of the Covered
26*35786f68SRobert Mustacchi  * Code in any form, with the right to sublicense such rights; and
27*35786f68SRobert Mustacchi  *
28*35786f68SRobert Mustacchi  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29*35786f68SRobert Mustacchi  * license (with the right to sublicense), under only those claims of Intel
30*35786f68SRobert Mustacchi  * patents that are infringed by the Original Intel Code, to make, use, sell,
31*35786f68SRobert Mustacchi  * offer to sell, and import the Covered Code and derivative works thereof
32*35786f68SRobert Mustacchi  * solely to the minimum extent necessary to exercise the above copyright
33*35786f68SRobert Mustacchi  * license, and in no event shall the patent license extend to any additions
34*35786f68SRobert Mustacchi  * to or modifications of the Original Intel Code. No other license or right
35*35786f68SRobert Mustacchi  * is granted directly or by implication, estoppel or otherwise;
36*35786f68SRobert Mustacchi  *
37*35786f68SRobert Mustacchi  * The above copyright and patent license is granted only if the following
38*35786f68SRobert Mustacchi  * conditions are met:
39*35786f68SRobert Mustacchi  *
40*35786f68SRobert Mustacchi  * 3. Conditions
41*35786f68SRobert Mustacchi  *
42*35786f68SRobert Mustacchi  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43*35786f68SRobert Mustacchi  * Redistribution of source code of any substantial portion of the Covered
44*35786f68SRobert Mustacchi  * Code or modification with rights to further distribute source must include
45*35786f68SRobert Mustacchi  * the above Copyright Notice, the above License, this list of Conditions,
46*35786f68SRobert Mustacchi  * and the following Disclaimer and Export Compliance provision. In addition,
47*35786f68SRobert Mustacchi  * Licensee must cause all Covered Code to which Licensee contributes to
48*35786f68SRobert Mustacchi  * contain a file documenting the changes Licensee made to create that Covered
49*35786f68SRobert Mustacchi  * Code and the date of any change. Licensee must include in that file the
50*35786f68SRobert Mustacchi  * documentation of any changes made by any predecessor Licensee. Licensee
51*35786f68SRobert Mustacchi  * must include a prominent statement that the modification is derived,
52*35786f68SRobert Mustacchi  * directly or indirectly, from Original Intel Code.
53*35786f68SRobert Mustacchi  *
54*35786f68SRobert Mustacchi  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55*35786f68SRobert Mustacchi  * Redistribution of source code of any substantial portion of the Covered
56*35786f68SRobert Mustacchi  * Code or modification without rights to further distribute source must
57*35786f68SRobert Mustacchi  * include the following Disclaimer and Export Compliance provision in the
58*35786f68SRobert Mustacchi  * documentation and/or other materials provided with distribution. In
59*35786f68SRobert Mustacchi  * addition, Licensee may not authorize further sublicense of source of any
60*35786f68SRobert Mustacchi  * portion of the Covered Code, and must include terms to the effect that the
61*35786f68SRobert Mustacchi  * license from Licensee to its licensee is limited to the intellectual
62*35786f68SRobert Mustacchi  * property embodied in the software Licensee provides to its licensee, and
63*35786f68SRobert Mustacchi  * not to intellectual property embodied in modifications its licensee may
64*35786f68SRobert Mustacchi  * make.
65*35786f68SRobert Mustacchi  *
66*35786f68SRobert Mustacchi  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67*35786f68SRobert Mustacchi  * substantial portion of the Covered Code or modification must reproduce the
68*35786f68SRobert Mustacchi  * above Copyright Notice, and the following Disclaimer and Export Compliance
69*35786f68SRobert Mustacchi  * provision in the documentation and/or other materials provided with the
70*35786f68SRobert Mustacchi  * distribution.
71*35786f68SRobert Mustacchi  *
72*35786f68SRobert Mustacchi  * 3.4. Intel retains all right, title, and interest in and to the Original
73*35786f68SRobert Mustacchi  * Intel Code.
74*35786f68SRobert Mustacchi  *
75*35786f68SRobert Mustacchi  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76*35786f68SRobert Mustacchi  * Intel shall be used in advertising or otherwise to promote the sale, use or
77*35786f68SRobert Mustacchi  * other dealings in products derived from or relating to the Covered Code
78*35786f68SRobert Mustacchi  * without prior written authorization from Intel.
79*35786f68SRobert Mustacchi  *
80*35786f68SRobert Mustacchi  * 4. Disclaimer and Export Compliance
81*35786f68SRobert Mustacchi  *
82*35786f68SRobert Mustacchi  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83*35786f68SRobert Mustacchi  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84*35786f68SRobert Mustacchi  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85*35786f68SRobert Mustacchi  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86*35786f68SRobert Mustacchi  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87*35786f68SRobert Mustacchi  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88*35786f68SRobert Mustacchi  * PARTICULAR PURPOSE.
89*35786f68SRobert Mustacchi  *
90*35786f68SRobert Mustacchi  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91*35786f68SRobert Mustacchi  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92*35786f68SRobert Mustacchi  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93*35786f68SRobert Mustacchi  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94*35786f68SRobert Mustacchi  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95*35786f68SRobert Mustacchi  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96*35786f68SRobert Mustacchi  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97*35786f68SRobert Mustacchi  * LIMITED REMEDY.
98*35786f68SRobert Mustacchi  *
99*35786f68SRobert Mustacchi  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100*35786f68SRobert Mustacchi  * software or system incorporating such software without first obtaining any
101*35786f68SRobert Mustacchi  * required license or other approval from the U. S. Department of Commerce or
102*35786f68SRobert Mustacchi  * any other agency or department of the United States Government. In the
103*35786f68SRobert Mustacchi  * event Licensee exports any such software from the United States or
104*35786f68SRobert Mustacchi  * re-exports any such software from a foreign destination, Licensee shall
105*35786f68SRobert Mustacchi  * ensure that the distribution and export/re-export of the software is in
106*35786f68SRobert Mustacchi  * compliance with all laws, regulations, orders, or other restrictions of the
107*35786f68SRobert Mustacchi  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108*35786f68SRobert Mustacchi  * any of its subsidiaries will export/re-export any technical data, process,
109*35786f68SRobert Mustacchi  * software, or service, directly or indirectly, to any country for which the
110*35786f68SRobert Mustacchi  * United States government or any agency thereof requires an export license,
111*35786f68SRobert Mustacchi  * other governmental approval, or letter of assurance, without first obtaining
112*35786f68SRobert Mustacchi  * such license, approval or letter.
113*35786f68SRobert Mustacchi  *
114*35786f68SRobert Mustacchi  *****************************************************************************
115*35786f68SRobert Mustacchi  *
116*35786f68SRobert Mustacchi  * Alternatively, you may choose to be licensed under the terms of the
117*35786f68SRobert Mustacchi  * following license:
118*35786f68SRobert Mustacchi  *
119bc36eafdSMike Gerdts  * Redistribution and use in source and binary forms, with or without
120bc36eafdSMike Gerdts  * modification, are permitted provided that the following conditions
121bc36eafdSMike Gerdts  * are met:
122bc36eafdSMike Gerdts  * 1. Redistributions of source code must retain the above copyright
123bc36eafdSMike Gerdts  *    notice, this list of conditions, and the following disclaimer,
124bc36eafdSMike Gerdts  *    without modification.
125bc36eafdSMike Gerdts  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126bc36eafdSMike Gerdts  *    substantially similar to the "NO WARRANTY" disclaimer below
127bc36eafdSMike Gerdts  *    ("Disclaimer") and any redistribution must be conditioned upon
128bc36eafdSMike Gerdts  *    including a substantially similar Disclaimer requirement for further
129bc36eafdSMike Gerdts  *    binary redistribution.
130bc36eafdSMike Gerdts  * 3. Neither the names of the above-listed copyright holders nor the names
131bc36eafdSMike Gerdts  *    of any contributors may be used to endorse or promote products derived
132bc36eafdSMike Gerdts  *    from this software without specific prior written permission.
133bc36eafdSMike Gerdts  *
134bc36eafdSMike Gerdts  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135bc36eafdSMike Gerdts  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136*35786f68SRobert Mustacchi  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137bc36eafdSMike Gerdts  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138*35786f68SRobert Mustacchi  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139*35786f68SRobert Mustacchi  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140*35786f68SRobert Mustacchi  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141*35786f68SRobert Mustacchi  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142*35786f68SRobert Mustacchi  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143*35786f68SRobert Mustacchi  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144*35786f68SRobert Mustacchi  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145*35786f68SRobert Mustacchi  *
146*35786f68SRobert Mustacchi  * Alternatively, you may choose to be licensed under the terms of the
147*35786f68SRobert Mustacchi  * GNU General Public License ("GPL") version 2 as published by the Free
148*35786f68SRobert Mustacchi  * Software Foundation.
149*35786f68SRobert Mustacchi  *
150*35786f68SRobert Mustacchi  *****************************************************************************/
151bc36eafdSMike Gerdts 
152bc36eafdSMike Gerdts #include "acpi.h"
153bc36eafdSMike Gerdts #include "accommon.h"
154bc36eafdSMike Gerdts #include "acdisasm.h"
155bc36eafdSMike Gerdts #include "actables.h"
156bc36eafdSMike Gerdts #include "aslcompiler.h"
157bc36eafdSMike Gerdts 
158bc36eafdSMike Gerdts /* This module used for application-level code only */
159bc36eafdSMike Gerdts 
160bc36eafdSMike Gerdts #define _COMPONENT          ACPI_CA_DISASSEMBLER
161bc36eafdSMike Gerdts         ACPI_MODULE_NAME    ("dmtable")
162bc36eafdSMike Gerdts 
163bc36eafdSMike Gerdts const AH_TABLE *
164bc36eafdSMike Gerdts AcpiAhGetTableInfo (
165bc36eafdSMike Gerdts     char                    *Signature);
166bc36eafdSMike Gerdts 
167bc36eafdSMike Gerdts 
168bc36eafdSMike Gerdts /* Common format strings for commented values */
169bc36eafdSMike Gerdts 
170bc36eafdSMike Gerdts #define UINT8_FORMAT        "%2.2X [%s]\n"
171bc36eafdSMike Gerdts #define UINT16_FORMAT       "%4.4X [%s]\n"
172bc36eafdSMike Gerdts #define UINT32_FORMAT       "%8.8X [%s]\n"
173bc36eafdSMike Gerdts #define STRING_FORMAT       "[%s]\n"
174bc36eafdSMike Gerdts 
175bc36eafdSMike Gerdts /* These tables map a subtable type to a description string */
176bc36eafdSMike Gerdts 
177bc36eafdSMike Gerdts static const char           *AcpiDmAsfSubnames[] =
178bc36eafdSMike Gerdts {
179bc36eafdSMike Gerdts     "ASF Information",
180bc36eafdSMike Gerdts     "ASF Alerts",
181bc36eafdSMike Gerdts     "ASF Remote Control",
182bc36eafdSMike Gerdts     "ASF RMCP Boot Options",
183bc36eafdSMike Gerdts     "ASF Address",
184bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
185bc36eafdSMike Gerdts };
186bc36eafdSMike Gerdts 
187bc36eafdSMike Gerdts static const char           *AcpiDmDmarSubnames[] =
188bc36eafdSMike Gerdts {
189bc36eafdSMike Gerdts     "Hardware Unit Definition",
190bc36eafdSMike Gerdts     "Reserved Memory Region",
191bc36eafdSMike Gerdts     "Root Port ATS Capability",
192bc36eafdSMike Gerdts     "Remapping Hardware Static Affinity",
193bc36eafdSMike Gerdts     "ACPI Namespace Device Declaration",
194bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
195bc36eafdSMike Gerdts };
196bc36eafdSMike Gerdts 
197bc36eafdSMike Gerdts static const char           *AcpiDmDmarScope[] =
198bc36eafdSMike Gerdts {
199bc36eafdSMike Gerdts     "Reserved value",
200bc36eafdSMike Gerdts     "PCI Endpoint Device",
201bc36eafdSMike Gerdts     "PCI Bridge Device",
202bc36eafdSMike Gerdts     "IOAPIC Device",
203bc36eafdSMike Gerdts     "Message-capable HPET Device",
204bc36eafdSMike Gerdts     "Namespace Device",
205bc36eafdSMike Gerdts     "Unknown Scope Type"            /* Reserved */
206bc36eafdSMike Gerdts };
207bc36eafdSMike Gerdts 
208bc36eafdSMike Gerdts static const char           *AcpiDmEinjActions[] =
209bc36eafdSMike Gerdts {
210bc36eafdSMike Gerdts     "Begin Operation",
211bc36eafdSMike Gerdts     "Get Trigger Table",
212bc36eafdSMike Gerdts     "Set Error Type",
213bc36eafdSMike Gerdts     "Get Error Type",
214bc36eafdSMike Gerdts     "End Operation",
215bc36eafdSMike Gerdts     "Execute Operation",
216bc36eafdSMike Gerdts     "Check Busy Status",
217bc36eafdSMike Gerdts     "Get Command Status",
218bc36eafdSMike Gerdts     "Set Error Type With Address",
219bc36eafdSMike Gerdts     "Get Execute Timings",
220bc36eafdSMike Gerdts     "Unknown Action"
221bc36eafdSMike Gerdts };
222bc36eafdSMike Gerdts 
223bc36eafdSMike Gerdts static const char           *AcpiDmEinjInstructions[] =
224bc36eafdSMike Gerdts {
225bc36eafdSMike Gerdts     "Read Register",
226bc36eafdSMike Gerdts     "Read Register Value",
227bc36eafdSMike Gerdts     "Write Register",
228bc36eafdSMike Gerdts     "Write Register Value",
229bc36eafdSMike Gerdts     "Noop",
230bc36eafdSMike Gerdts     "Flush Cacheline",
231bc36eafdSMike Gerdts     "Unknown Instruction"
232bc36eafdSMike Gerdts };
233bc36eafdSMike Gerdts 
234bc36eafdSMike Gerdts static const char           *AcpiDmErstActions[] =
235bc36eafdSMike Gerdts {
236bc36eafdSMike Gerdts     "Begin Write Operation",
237bc36eafdSMike Gerdts     "Begin Read Operation",
238bc36eafdSMike Gerdts     "Begin Clear Operation",
239bc36eafdSMike Gerdts     "End Operation",
240bc36eafdSMike Gerdts     "Set Record Offset",
241bc36eafdSMike Gerdts     "Execute Operation",
242bc36eafdSMike Gerdts     "Check Busy Status",
243bc36eafdSMike Gerdts     "Get Command Status",
244bc36eafdSMike Gerdts     "Get Record Identifier",
245bc36eafdSMike Gerdts     "Set Record Identifier",
246bc36eafdSMike Gerdts     "Get Record Count",
247bc36eafdSMike Gerdts     "Begin Dummy Write",
248bc36eafdSMike Gerdts     "Unused/Unknown Action",
249bc36eafdSMike Gerdts     "Get Error Address Range",
250bc36eafdSMike Gerdts     "Get Error Address Length",
251bc36eafdSMike Gerdts     "Get Error Attributes",
252bc36eafdSMike Gerdts     "Execute Timings",
253bc36eafdSMike Gerdts     "Unknown Action"
254bc36eafdSMike Gerdts };
255bc36eafdSMike Gerdts 
256bc36eafdSMike Gerdts static const char           *AcpiDmErstInstructions[] =
257bc36eafdSMike Gerdts {
258bc36eafdSMike Gerdts     "Read Register",
259bc36eafdSMike Gerdts     "Read Register Value",
260bc36eafdSMike Gerdts     "Write Register",
261bc36eafdSMike Gerdts     "Write Register Value",
262bc36eafdSMike Gerdts     "Noop",
263bc36eafdSMike Gerdts     "Load Var1",
264bc36eafdSMike Gerdts     "Load Var2",
265bc36eafdSMike Gerdts     "Store Var1",
266bc36eafdSMike Gerdts     "Add",
267bc36eafdSMike Gerdts     "Subtract",
268bc36eafdSMike Gerdts     "Add Value",
269bc36eafdSMike Gerdts     "Subtract Value",
270bc36eafdSMike Gerdts     "Stall",
271bc36eafdSMike Gerdts     "Stall While True",
272bc36eafdSMike Gerdts     "Skip Next If True",
273bc36eafdSMike Gerdts     "GoTo",
274bc36eafdSMike Gerdts     "Set Source Address",
275bc36eafdSMike Gerdts     "Set Destination Address",
276bc36eafdSMike Gerdts     "Move Data",
277bc36eafdSMike Gerdts     "Unknown Instruction"
278bc36eafdSMike Gerdts };
279bc36eafdSMike Gerdts 
280bc36eafdSMike Gerdts static const char           *AcpiDmGtdtSubnames[] =
281bc36eafdSMike Gerdts {
282bc36eafdSMike Gerdts     "Generic Timer Block",
283bc36eafdSMike Gerdts     "Generic Watchdog Timer",
284bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
285bc36eafdSMike Gerdts };
286bc36eafdSMike Gerdts 
287bc36eafdSMike Gerdts static const char           *AcpiDmHestSubnames[] =
288bc36eafdSMike Gerdts {
289bc36eafdSMike Gerdts     "IA-32 Machine Check Exception",
290bc36eafdSMike Gerdts     "IA-32 Corrected Machine Check",
291bc36eafdSMike Gerdts     "IA-32 Non-Maskable Interrupt",
292*35786f68SRobert Mustacchi     "Unknown Subtable Type",        /* 3 - Reserved */
293*35786f68SRobert Mustacchi     "Unknown Subtable Type",        /* 4 - Reserved */
294*35786f68SRobert Mustacchi     "Unknown Subtable Type",        /* 5 - Reserved */
295bc36eafdSMike Gerdts     "PCI Express Root Port AER",
296bc36eafdSMike Gerdts     "PCI Express AER (AER Endpoint)",
297bc36eafdSMike Gerdts     "PCI Express/PCI-X Bridge AER",
298bc36eafdSMike Gerdts     "Generic Hardware Error Source",
299bc36eafdSMike Gerdts     "Generic Hardware Error Source V2",
300*35786f68SRobert Mustacchi     "IA-32 Deferred Machine Check",
301bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
302bc36eafdSMike Gerdts };
303bc36eafdSMike Gerdts 
304bc36eafdSMike Gerdts static const char           *AcpiDmHestNotifySubnames[] =
305bc36eafdSMike Gerdts {
306bc36eafdSMike Gerdts     "Polled",
307bc36eafdSMike Gerdts     "External Interrupt",
308bc36eafdSMike Gerdts     "Local Interrupt",
309bc36eafdSMike Gerdts     "SCI",
310bc36eafdSMike Gerdts     "NMI",
311bc36eafdSMike Gerdts     "CMCI",                         /* ACPI 5.0 */
312bc36eafdSMike Gerdts     "MCE",                          /* ACPI 5.0 */
313bc36eafdSMike Gerdts     "GPIO",                         /* ACPI 6.0 */
314bc36eafdSMike Gerdts     "SEA",                          /* ACPI 6.1 */
315bc36eafdSMike Gerdts     "SEI",                          /* ACPI 6.1 */
316bc36eafdSMike Gerdts     "GSIV",                         /* ACPI 6.1 */
317*35786f68SRobert Mustacchi     "Software Delegated Exception", /* ACPI 6.2 */
318bc36eafdSMike Gerdts     "Unknown Notify Type"           /* Reserved */
319bc36eafdSMike Gerdts };
320bc36eafdSMike Gerdts 
321*35786f68SRobert Mustacchi static const char           *AcpiDmHmatSubnames[] =
322*35786f68SRobert Mustacchi {
323*35786f68SRobert Mustacchi     "Memory Subystem Address Range",
324*35786f68SRobert Mustacchi     "System Locality Latency and Bandwidth Information",
325*35786f68SRobert Mustacchi     "Memory Side Cache Information",
326*35786f68SRobert Mustacchi     "Unknown Structure Type"         /* Reserved */
327*35786f68SRobert Mustacchi };
328*35786f68SRobert Mustacchi 
329bc36eafdSMike Gerdts static const char           *AcpiDmMadtSubnames[] =
330bc36eafdSMike Gerdts {
331bc36eafdSMike Gerdts     "Processor Local APIC",             /* ACPI_MADT_TYPE_LOCAL_APIC */
332bc36eafdSMike Gerdts     "I/O APIC",                         /* ACPI_MADT_TYPE_IO_APIC */
333bc36eafdSMike Gerdts     "Interrupt Source Override",        /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
334bc36eafdSMike Gerdts     "NMI Source",                       /* ACPI_MADT_TYPE_NMI_SOURCE */
335bc36eafdSMike Gerdts     "Local APIC NMI",                   /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
336bc36eafdSMike Gerdts     "Local APIC Address Override",      /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
337bc36eafdSMike Gerdts     "I/O SAPIC",                        /* ACPI_MADT_TYPE_IO_SAPIC */
338bc36eafdSMike Gerdts     "Local SAPIC",                      /* ACPI_MADT_TYPE_LOCAL_SAPIC */
339bc36eafdSMike Gerdts     "Platform Interrupt Sources",       /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
340bc36eafdSMike Gerdts     "Processor Local x2APIC",           /* ACPI_MADT_TYPE_LOCAL_X2APIC */
341bc36eafdSMike Gerdts     "Local x2APIC NMI",                 /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
342bc36eafdSMike Gerdts     "Generic Interrupt Controller",     /* ACPI_MADT_GENERIC_INTERRUPT */
343bc36eafdSMike Gerdts     "Generic Interrupt Distributor",    /* ACPI_MADT_GENERIC_DISTRIBUTOR */
344bc36eafdSMike Gerdts     "Generic MSI Frame",                /* ACPI_MADT_GENERIC_MSI_FRAME */
345bc36eafdSMike Gerdts     "Generic Interrupt Redistributor",  /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
346bc36eafdSMike Gerdts     "Generic Interrupt Translator",     /* ACPI_MADT_GENERIC_TRANSLATOR */
347bc36eafdSMike Gerdts     "Unknown Subtable Type"             /* Reserved */
348bc36eafdSMike Gerdts };
349bc36eafdSMike Gerdts 
350bc36eafdSMike Gerdts static const char           *AcpiDmNfitSubnames[] =
351bc36eafdSMike Gerdts {
352bc36eafdSMike Gerdts     "System Physical Address Range",    /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */
353bc36eafdSMike Gerdts     "Memory Range Map",                 /* ACPI_NFIT_TYPE_MEMORY_MAP */
354bc36eafdSMike Gerdts     "Interleave Info",                  /* ACPI_NFIT_TYPE_INTERLEAVE */
355bc36eafdSMike Gerdts     "SMBIOS Information",               /* ACPI_NFIT_TYPE_SMBIOS */
356bc36eafdSMike Gerdts     "NVDIMM Control Region",            /* ACPI_NFIT_TYPE_CONTROL_REGION */
357bc36eafdSMike Gerdts     "NVDIMM Block Data Window Region",  /* ACPI_NFIT_TYPE_DATA_REGION */
358bc36eafdSMike Gerdts     "Flush Hint Address",               /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */
359*35786f68SRobert Mustacchi     "Platform Capabilities",            /* ACPI_NFIT_TYPE_CAPABILITIES */
360bc36eafdSMike Gerdts     "Unknown Subtable Type"             /* Reserved */
361bc36eafdSMike Gerdts };
362bc36eafdSMike Gerdts 
363bc36eafdSMike Gerdts static const char           *AcpiDmPcctSubnames[] =
364bc36eafdSMike Gerdts {
365bc36eafdSMike Gerdts     "Generic Communications Subspace",  /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
366bc36eafdSMike Gerdts     "HW-Reduced Comm Subspace",         /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
367bc36eafdSMike Gerdts     "HW-Reduced Comm Subspace Type2",   /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */
368*35786f68SRobert Mustacchi     "Extended PCC Master Subspace",     /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */
369*35786f68SRobert Mustacchi     "Extended PCC Slave Subspace",      /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */
370bc36eafdSMike Gerdts     "Unknown Subtable Type"             /* Reserved */
371bc36eafdSMike Gerdts };
372bc36eafdSMike Gerdts 
373bc36eafdSMike Gerdts static const char           *AcpiDmPmttSubnames[] =
374bc36eafdSMike Gerdts {
375bc36eafdSMike Gerdts     "Socket",                       /* ACPI_PMTT_TYPE_SOCKET */
376bc36eafdSMike Gerdts     "Memory Controller",            /* ACPI_PMTT_TYPE_CONTROLLER */
377*35786f68SRobert Mustacchi     "Physical Component (DIMM)",    /* ACPI_PMTT_TYPE_DIMM */
378*35786f68SRobert Mustacchi     "Unknown Subtable Type"         /* Reserved */
379*35786f68SRobert Mustacchi };
380*35786f68SRobert Mustacchi 
381*35786f68SRobert Mustacchi static const char           *AcpiDmPpttSubnames[] =
382*35786f68SRobert Mustacchi {
383*35786f68SRobert Mustacchi     "Processor Hierarchy Node",     /* ACPI_PPTT_TYPE_PROCESSOR */
384*35786f68SRobert Mustacchi     "Cache Type",                   /* ACPI_PPTT_TYPE_CACHE */
385*35786f68SRobert Mustacchi     "ID",                           /* ACPI_PPTT_TYPE_ID */
386*35786f68SRobert Mustacchi     "Unknown Subtable Type"         /* Reserved */
387*35786f68SRobert Mustacchi };
388*35786f68SRobert Mustacchi 
389*35786f68SRobert Mustacchi static const char           *AcpiDmSdevSubnames[] =
390*35786f68SRobert Mustacchi {
391*35786f68SRobert Mustacchi     "Namespace Device",             /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */
392*35786f68SRobert Mustacchi     "PCIe Endpoint Device",         /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */
393bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
394bc36eafdSMike Gerdts };
395bc36eafdSMike Gerdts 
396bc36eafdSMike Gerdts static const char           *AcpiDmSratSubnames[] =
397bc36eafdSMike Gerdts {
398bc36eafdSMike Gerdts     "Processor Local APIC/SAPIC Affinity",
399bc36eafdSMike Gerdts     "Memory Affinity",
400bc36eafdSMike Gerdts     "Processor Local x2APIC Affinity",
401bc36eafdSMike Gerdts     "GICC Affinity",
402*35786f68SRobert Mustacchi     "GIC ITS Affinity",             /* Acpi 6.2 */
403*35786f68SRobert Mustacchi     "Unknown Subtable Type"         /* Reserved */
404*35786f68SRobert Mustacchi };
405*35786f68SRobert Mustacchi 
406*35786f68SRobert Mustacchi static const char           *AcpiDmTpm2Subnames[] =
407*35786f68SRobert Mustacchi {
408*35786f68SRobert Mustacchi     "Illegal Start Method value",
409*35786f68SRobert Mustacchi     "Reserved",
410*35786f68SRobert Mustacchi     "ACPI Start Method",
411*35786f68SRobert Mustacchi     "Reserved",
412*35786f68SRobert Mustacchi     "Reserved",
413*35786f68SRobert Mustacchi     "Reserved",
414*35786f68SRobert Mustacchi     "Memory Mapped I/O",
415*35786f68SRobert Mustacchi     "Command Response Buffer",
416*35786f68SRobert Mustacchi     "Command Response Buffer with ACPI Start Method",
417*35786f68SRobert Mustacchi     "Reserved",
418*35786f68SRobert Mustacchi     "Reserved",
419*35786f68SRobert Mustacchi     "Command Response Buffer with ARM SMC",
420bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
421bc36eafdSMike Gerdts };
422bc36eafdSMike Gerdts 
423bc36eafdSMike Gerdts static const char           *AcpiDmIvrsSubnames[] =
424bc36eafdSMike Gerdts {
425bc36eafdSMike Gerdts     "Hardware Definition Block",
426bc36eafdSMike Gerdts     "Memory Definition Block",
427bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
428bc36eafdSMike Gerdts };
429bc36eafdSMike Gerdts 
430bc36eafdSMike Gerdts static const char           *AcpiDmLpitSubnames[] =
431bc36eafdSMike Gerdts {
432bc36eafdSMike Gerdts     "Native C-state Idle Structure",
433bc36eafdSMike Gerdts     "Unknown Subtable Type"         /* Reserved */
434bc36eafdSMike Gerdts };
435bc36eafdSMike Gerdts 
436bc36eafdSMike Gerdts #define ACPI_FADT_PM_RESERVED       9
437bc36eafdSMike Gerdts 
438bc36eafdSMike Gerdts static const char           *AcpiDmFadtProfiles[] =
439bc36eafdSMike Gerdts {
440bc36eafdSMike Gerdts     "Unspecified",
441bc36eafdSMike Gerdts     "Desktop",
442bc36eafdSMike Gerdts     "Mobile",
443bc36eafdSMike Gerdts     "Workstation",
444bc36eafdSMike Gerdts     "Enterprise Server",
445bc36eafdSMike Gerdts     "SOHO Server",
446bc36eafdSMike Gerdts     "Appliance PC",
447bc36eafdSMike Gerdts     "Performance Server",
448bc36eafdSMike Gerdts     "Tablet",
449bc36eafdSMike Gerdts     "Unknown Profile Type"
450bc36eafdSMike Gerdts };
451bc36eafdSMike Gerdts 
452bc36eafdSMike Gerdts #define ACPI_GAS_WIDTH_RESERVED     5
453bc36eafdSMike Gerdts 
454bc36eafdSMike Gerdts static const char           *AcpiDmGasAccessWidth[] =
455bc36eafdSMike Gerdts {
456bc36eafdSMike Gerdts     "Undefined/Legacy",
457bc36eafdSMike Gerdts     "Byte Access:8",
458bc36eafdSMike Gerdts     "Word Access:16",
459bc36eafdSMike Gerdts     "DWord Access:32",
460bc36eafdSMike Gerdts     "QWord Access:64",
461bc36eafdSMike Gerdts     "Unknown Width Encoding"
462bc36eafdSMike Gerdts };
463bc36eafdSMike Gerdts 
464bc36eafdSMike Gerdts 
465bc36eafdSMike Gerdts /*******************************************************************************
466bc36eafdSMike Gerdts  *
467bc36eafdSMike Gerdts  * ACPI Table Data, indexed by signature.
468bc36eafdSMike Gerdts  *
469bc36eafdSMike Gerdts  * Each entry contains: Signature, Table Info, Handler, DtHandler,
470bc36eafdSMike Gerdts  *  Template, Description
471bc36eafdSMike Gerdts  *
472bc36eafdSMike Gerdts  * Simple tables have only a TableInfo structure, complex tables have a
473bc36eafdSMike Gerdts  * handler. This table must be NULL terminated. RSDP and FACS are
474bc36eafdSMike Gerdts  * special-cased elsewhere.
475bc36eafdSMike Gerdts  *
476bc36eafdSMike Gerdts  * Note: Any tables added here should be duplicated within AcpiSupportedTables
477bc36eafdSMike Gerdts  * in the file common/ahtable.c
478bc36eafdSMike Gerdts  *
479bc36eafdSMike Gerdts  ******************************************************************************/
480bc36eafdSMike Gerdts 
481bc36eafdSMike Gerdts const ACPI_DMTABLE_DATA     AcpiDmTableData[] =
482bc36eafdSMike Gerdts {
483bc36eafdSMike Gerdts     {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf},
484bc36eafdSMike Gerdts     {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert},
485bc36eafdSMike Gerdts     {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt},
486bc36eafdSMike Gerdts     {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot},
487bc36eafdSMike Gerdts     {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep},
488bc36eafdSMike Gerdts     {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt},
489bc36eafdSMike Gerdts     {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2,    AcpiDmDumpDbg2, DtCompileDbg2,  TemplateDbg2},
490bc36eafdSMike Gerdts     {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp},
491bc36eafdSMike Gerdts     {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar},
492bc36eafdSMike Gerdts     {ACPI_SIG_DRTM, NULL,                   AcpiDmDumpDrtm, DtCompileDrtm,  TemplateDrtm},
493bc36eafdSMike Gerdts     {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt},
494bc36eafdSMike Gerdts     {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj},
495bc36eafdSMike Gerdts     {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst},
496bc36eafdSMike Gerdts     {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt},
497bc36eafdSMike Gerdts     {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt},
498bc36eafdSMike Gerdts     {ACPI_SIG_GTDT, NULL,                   AcpiDmDumpGtdt, DtCompileGtdt,  TemplateGtdt},
499bc36eafdSMike Gerdts     {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest},
500*35786f68SRobert Mustacchi     {ACPI_SIG_HMAT, NULL,                   AcpiDmDumpHmat, DtCompileHmat,  TemplateHmat},
501bc36eafdSMike Gerdts     {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet},
502bc36eafdSMike Gerdts     {ACPI_SIG_IORT, NULL,                   AcpiDmDumpIort, DtCompileIort,  TemplateIort},
503bc36eafdSMike Gerdts     {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs},
504bc36eafdSMike Gerdts     {ACPI_SIG_LPIT, NULL,                   AcpiDmDumpLpit, DtCompileLpit,  TemplateLpit},
505bc36eafdSMike Gerdts     {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt},
506bc36eafdSMike Gerdts     {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg},
507bc36eafdSMike Gerdts     {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi},
508bc36eafdSMike Gerdts     {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst},
509bc36eafdSMike Gerdts     {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct},
510bc36eafdSMike Gerdts     {ACPI_SIG_MSDM, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateMsdm},
511bc36eafdSMike Gerdts     {ACPI_SIG_MTMR, NULL,                   AcpiDmDumpMtmr, DtCompileMtmr,  TemplateMtmr},
512bc36eafdSMike Gerdts     {ACPI_SIG_NFIT, AcpiDmTableInfoNfit,    AcpiDmDumpNfit, DtCompileNfit,  TemplateNfit},
513bc36eafdSMike Gerdts     {ACPI_SIG_PCCT, AcpiDmTableInfoPcct,    AcpiDmDumpPcct, DtCompilePcct,  TemplatePcct},
514*35786f68SRobert Mustacchi     {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt,    AcpiDmDumpPdtt, DtCompilePdtt,  TemplatePdtt},
515bc36eafdSMike Gerdts     {ACPI_SIG_PMTT, NULL,                   AcpiDmDumpPmtt, DtCompilePmtt,  TemplatePmtt},
516*35786f68SRobert Mustacchi     {ACPI_SIG_PPTT, NULL,                   AcpiDmDumpPptt, DtCompilePptt,  TemplatePptt},
517*35786f68SRobert Mustacchi     {ACPI_SIG_RASF, AcpiDmTableInfoRasf,    NULL,           NULL,           TemplateRasf},
518bc36eafdSMike Gerdts     {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt},
519bc36eafdSMike Gerdts     {ACPI_SIG_S3PT, NULL,                   NULL,           NULL,           TemplateS3pt},
520bc36eafdSMike Gerdts     {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst},
521*35786f68SRobert Mustacchi     {ACPI_SIG_SDEI, AcpiDmTableInfoSdei,    NULL,           NULL,           TemplateSdei},
522*35786f68SRobert Mustacchi     {ACPI_SIG_SDEV, AcpiDmTableInfoSdev,    AcpiDmDumpSdev, DtCompileSdev,  TemplateSdev},
523bc36eafdSMike Gerdts     {ACPI_SIG_SLIC, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateSlic},
524bc36eafdSMike Gerdts     {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit},
525bc36eafdSMike Gerdts     {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr},
526bc36eafdSMike Gerdts     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi},
527bc36eafdSMike Gerdts     {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat},
528bc36eafdSMike Gerdts     {ACPI_SIG_STAO, NULL,                   AcpiDmDumpStao, DtCompileStao,  TemplateStao},
529bc36eafdSMike Gerdts     {ACPI_SIG_TCPA, NULL,                   AcpiDmDumpTcpa, DtCompileTcpa,  TemplateTcpa},
530*35786f68SRobert Mustacchi     {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2,    AcpiDmDumpTpm2, DtCompileTpm2,  TemplateTpm2},
531bc36eafdSMike Gerdts     {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi},
532bc36eafdSMike Gerdts     {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc,    AcpiDmDumpVrtc, DtCompileVrtc,  TemplateVrtc},
533bc36eafdSMike Gerdts     {ACPI_SIG_WAET, AcpiDmTableInfoWaet,    NULL,           NULL,           TemplateWaet},
534bc36eafdSMike Gerdts     {ACPI_SIG_WDAT, NULL,                   AcpiDmDumpWdat, DtCompileWdat,  TemplateWdat},
535bc36eafdSMike Gerdts     {ACPI_SIG_WDDT, AcpiDmTableInfoWddt,    NULL,           NULL,           TemplateWddt},
536bc36eafdSMike Gerdts     {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt,    NULL,           NULL,           TemplateWdrt},
537bc36eafdSMike Gerdts     {ACPI_SIG_WPBT, NULL,                   AcpiDmDumpWpbt, DtCompileWpbt,  TemplateWpbt},
538*35786f68SRobert Mustacchi     {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt,    NULL,           NULL,           TemplateWsmt},
539bc36eafdSMike Gerdts     {ACPI_SIG_XENV, AcpiDmTableInfoXenv,    NULL,           NULL,           TemplateXenv},
540bc36eafdSMike Gerdts     {ACPI_SIG_XSDT, NULL,                   AcpiDmDumpXsdt, DtCompileXsdt,  TemplateXsdt},
541bc36eafdSMike Gerdts     {NULL,          NULL,                   NULL,           NULL,           NULL}
542bc36eafdSMike Gerdts };
543bc36eafdSMike Gerdts 
544bc36eafdSMike Gerdts 
545bc36eafdSMike Gerdts /*******************************************************************************
546bc36eafdSMike Gerdts  *
547bc36eafdSMike Gerdts  * FUNCTION:    AcpiDmGenerateChecksum
548bc36eafdSMike Gerdts  *
549bc36eafdSMike Gerdts  * PARAMETERS:  Table               - Pointer to table to be checksummed
550bc36eafdSMike Gerdts  *              Length              - Length of the table
551bc36eafdSMike Gerdts  *              OriginalChecksum    - Value of the checksum field
552bc36eafdSMike Gerdts  *
553bc36eafdSMike Gerdts  * RETURN:      8 bit checksum of buffer
554bc36eafdSMike Gerdts  *
555bc36eafdSMike Gerdts  * DESCRIPTION: Computes an 8 bit checksum of the table.
556bc36eafdSMike Gerdts  *
557bc36eafdSMike Gerdts  ******************************************************************************/
558bc36eafdSMike Gerdts 
559bc36eafdSMike Gerdts UINT8
AcpiDmGenerateChecksum(void * Table,UINT32 Length,UINT8 OriginalChecksum)560bc36eafdSMike Gerdts AcpiDmGenerateChecksum (
561bc36eafdSMike Gerdts     void                    *Table,
562bc36eafdSMike Gerdts     UINT32                  Length,
563bc36eafdSMike Gerdts     UINT8                   OriginalChecksum)
564bc36eafdSMike Gerdts {
565bc36eafdSMike Gerdts     UINT8                   Checksum;
566bc36eafdSMike Gerdts 
567bc36eafdSMike Gerdts 
568bc36eafdSMike Gerdts     /* Sum the entire table as-is */
569bc36eafdSMike Gerdts 
570bc36eafdSMike Gerdts     Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
571bc36eafdSMike Gerdts 
572bc36eafdSMike Gerdts     /* Subtract off the existing checksum value in the table */
573bc36eafdSMike Gerdts 
574bc36eafdSMike Gerdts     Checksum = (UINT8) (Checksum - OriginalChecksum);
575bc36eafdSMike Gerdts 
576bc36eafdSMike Gerdts     /* Compute the final checksum */
577bc36eafdSMike Gerdts 
578bc36eafdSMike Gerdts     Checksum = (UINT8) (0 - Checksum);
579bc36eafdSMike Gerdts     return (Checksum);
580bc36eafdSMike Gerdts }
581bc36eafdSMike Gerdts 
582bc36eafdSMike Gerdts 
583bc36eafdSMike Gerdts /*******************************************************************************
584bc36eafdSMike Gerdts  *
585bc36eafdSMike Gerdts  * FUNCTION:    AcpiDmGetTableData
586bc36eafdSMike Gerdts  *
587bc36eafdSMike Gerdts  * PARAMETERS:  Signature           - ACPI signature (4 chars) to match
588bc36eafdSMike Gerdts  *
589bc36eafdSMike Gerdts  * RETURN:      Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.
590bc36eafdSMike Gerdts  *
591bc36eafdSMike Gerdts  * DESCRIPTION: Find a match in the global table of supported ACPI tables
592bc36eafdSMike Gerdts  *
593bc36eafdSMike Gerdts  ******************************************************************************/
594bc36eafdSMike Gerdts 
595bc36eafdSMike Gerdts const ACPI_DMTABLE_DATA *
AcpiDmGetTableData(char * Signature)596bc36eafdSMike Gerdts AcpiDmGetTableData (
597bc36eafdSMike Gerdts     char                    *Signature)
598bc36eafdSMike Gerdts {
599bc36eafdSMike Gerdts     const ACPI_DMTABLE_DATA *Info;
600bc36eafdSMike Gerdts 
601bc36eafdSMike Gerdts 
602bc36eafdSMike Gerdts     for (Info = AcpiDmTableData; Info->Signature; Info++)
603bc36eafdSMike Gerdts     {
604bc36eafdSMike Gerdts         if (ACPI_COMPARE_NAME (Signature, Info->Signature))
605bc36eafdSMike Gerdts         {
606bc36eafdSMike Gerdts             return (Info);
607bc36eafdSMike Gerdts         }
608bc36eafdSMike Gerdts     }
609bc36eafdSMike Gerdts 
610bc36eafdSMike Gerdts     return (NULL);
611bc36eafdSMike Gerdts }
612bc36eafdSMike Gerdts 
613bc36eafdSMike Gerdts 
614bc36eafdSMike Gerdts /*******************************************************************************
615bc36eafdSMike Gerdts  *
616bc36eafdSMike Gerdts  * FUNCTION:    AcpiDmDumpDataTable
617bc36eafdSMike Gerdts  *
618bc36eafdSMike Gerdts  * PARAMETERS:  Table               - An ACPI table
619bc36eafdSMike Gerdts  *
620bc36eafdSMike Gerdts  * RETURN:      None.
621bc36eafdSMike Gerdts  *
622bc36eafdSMike Gerdts  * DESCRIPTION: Format the contents of an ACPI data table (any table other
623bc36eafdSMike Gerdts  *              than an SSDT or DSDT that does not contain executable AML code)
624bc36eafdSMike Gerdts  *
625bc36eafdSMike Gerdts  ******************************************************************************/
626bc36eafdSMike Gerdts 
627bc36eafdSMike Gerdts void
AcpiDmDumpDataTable(ACPI_TABLE_HEADER * Table)628bc36eafdSMike Gerdts AcpiDmDumpDataTable (
629bc36eafdSMike Gerdts     ACPI_TABLE_HEADER       *Table)
630bc36eafdSMike Gerdts {
631bc36eafdSMike Gerdts     ACPI_STATUS             Status;
632bc36eafdSMike Gerdts     const ACPI_DMTABLE_DATA *TableData;
633bc36eafdSMike Gerdts     UINT32                  Length;
634bc36eafdSMike Gerdts 
635bc36eafdSMike Gerdts 
636bc36eafdSMike Gerdts     /* Ignore tables that contain AML */
637bc36eafdSMike Gerdts 
638bc36eafdSMike Gerdts     if (AcpiUtIsAmlTable (Table))
639bc36eafdSMike Gerdts     {
640bc36eafdSMike Gerdts         if (Gbl_VerboseTemplates)
641bc36eafdSMike Gerdts         {
642bc36eafdSMike Gerdts             /* Dump the raw table data */
643bc36eafdSMike Gerdts 
644bc36eafdSMike Gerdts             Length = Table->Length;
645bc36eafdSMike Gerdts 
646bc36eafdSMike Gerdts             AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
647bc36eafdSMike Gerdts                 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
648bc36eafdSMike Gerdts             AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
649bc36eafdSMike Gerdts                 Length, DB_BYTE_DISPLAY, 0);
650bc36eafdSMike Gerdts             AcpiOsPrintf (" */\n");
651bc36eafdSMike Gerdts         }
652bc36eafdSMike Gerdts         return;
653bc36eafdSMike Gerdts     }
654bc36eafdSMike Gerdts 
655bc36eafdSMike Gerdts     /*
656bc36eafdSMike Gerdts      * Handle tables that don't use the common ACPI table header structure.
657bc36eafdSMike Gerdts      * Currently, these are the FACS, RSDP, and S3PT.
658bc36eafdSMike Gerdts      */
659bc36eafdSMike Gerdts     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
660bc36eafdSMike Gerdts     {
661bc36eafdSMike Gerdts         Length = Table->Length;
662bc36eafdSMike Gerdts         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
663bc36eafdSMike Gerdts         if (ACPI_FAILURE (Status))
664bc36eafdSMike Gerdts         {
665bc36eafdSMike Gerdts             return;
666bc36eafdSMike Gerdts         }
667bc36eafdSMike Gerdts     }
668bc36eafdSMike Gerdts     else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
669bc36eafdSMike Gerdts     {
670bc36eafdSMike Gerdts         Length = AcpiDmDumpRsdp (Table);
671bc36eafdSMike Gerdts     }
672bc36eafdSMike Gerdts     else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT))
673bc36eafdSMike Gerdts     {
674bc36eafdSMike Gerdts         Length = AcpiDmDumpS3pt (Table);
675bc36eafdSMike Gerdts     }
676bc36eafdSMike Gerdts     else
677bc36eafdSMike Gerdts     {
678bc36eafdSMike Gerdts         /*
679bc36eafdSMike Gerdts          * All other tables must use the common ACPI table header, dump it now
680bc36eafdSMike Gerdts          */
681bc36eafdSMike Gerdts         Length = Table->Length;
682bc36eafdSMike Gerdts         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
683bc36eafdSMike Gerdts         if (ACPI_FAILURE (Status))
684bc36eafdSMike Gerdts         {
685bc36eafdSMike Gerdts             return;
686bc36eafdSMike Gerdts         }
687bc36eafdSMike Gerdts         AcpiOsPrintf ("\n");
688bc36eafdSMike Gerdts 
689bc36eafdSMike Gerdts         /* Match signature and dispatch appropriately */
690bc36eafdSMike Gerdts 
691bc36eafdSMike Gerdts         TableData = AcpiDmGetTableData (Table->Signature);
692bc36eafdSMike Gerdts         if (!TableData)
693bc36eafdSMike Gerdts         {
694bc36eafdSMike Gerdts             if (!strncmp (Table->Signature, "OEM", 3))
695bc36eafdSMike Gerdts             {
696bc36eafdSMike Gerdts                 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
697bc36eafdSMike Gerdts                     Table->Signature);
698bc36eafdSMike Gerdts             }
699bc36eafdSMike Gerdts             else
700bc36eafdSMike Gerdts             {
701bc36eafdSMike Gerdts                 AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
702bc36eafdSMike Gerdts                     Table->Signature);
703bc36eafdSMike Gerdts 
704bc36eafdSMike Gerdts                 fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
705bc36eafdSMike Gerdts                     Table->Signature);
706bc36eafdSMike Gerdts 
707bc36eafdSMike Gerdts                 if (!AcpiGbl_ForceAmlDisassembly)
708bc36eafdSMike Gerdts                 {
709bc36eafdSMike Gerdts                     fprintf (stderr, "decoding ACPI table header only\n");
710bc36eafdSMike Gerdts                 }
711bc36eafdSMike Gerdts                 else
712bc36eafdSMike Gerdts                 {
713bc36eafdSMike Gerdts                     fprintf (stderr, "assuming table contains valid AML code\n");
714bc36eafdSMike Gerdts                 }
715bc36eafdSMike Gerdts             }
716bc36eafdSMike Gerdts         }
717bc36eafdSMike Gerdts         else if (TableData->TableHandler)
718bc36eafdSMike Gerdts         {
719bc36eafdSMike Gerdts             /* Complex table, has a handler */
720bc36eafdSMike Gerdts 
721bc36eafdSMike Gerdts             TableData->TableHandler (Table);
722bc36eafdSMike Gerdts         }
723bc36eafdSMike Gerdts         else if (TableData->TableInfo)
724bc36eafdSMike Gerdts         {
725bc36eafdSMike Gerdts             /* Simple table, just walk the info table */
726bc36eafdSMike Gerdts 
727bc36eafdSMike Gerdts             Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
728bc36eafdSMike Gerdts             if (ACPI_FAILURE (Status))
729bc36eafdSMike Gerdts             {
730bc36eafdSMike Gerdts                 return;
731bc36eafdSMike Gerdts             }
732bc36eafdSMike Gerdts         }
733bc36eafdSMike Gerdts     }
734bc36eafdSMike Gerdts 
735bc36eafdSMike Gerdts     if (!Gbl_DoTemplates || Gbl_VerboseTemplates)
736bc36eafdSMike Gerdts     {
737bc36eafdSMike Gerdts         /* Dump the raw table data */
738bc36eafdSMike Gerdts 
739bc36eafdSMike Gerdts         AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
740bc36eafdSMike Gerdts             ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
741bc36eafdSMike Gerdts         AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
742bc36eafdSMike Gerdts             Length, DB_BYTE_DISPLAY, 0);
743bc36eafdSMike Gerdts     }
744bc36eafdSMike Gerdts }
745bc36eafdSMike Gerdts 
746bc36eafdSMike Gerdts 
747bc36eafdSMike Gerdts /*******************************************************************************
748bc36eafdSMike Gerdts  *
749bc36eafdSMike Gerdts  * FUNCTION:    AcpiDmLineHeader
750bc36eafdSMike Gerdts  *
751bc36eafdSMike Gerdts  * PARAMETERS:  Offset              - Current byte offset, from table start
752bc36eafdSMike Gerdts  *              ByteLength          - Length of the field in bytes, 0 for flags
753bc36eafdSMike Gerdts  *              Name                - Name of this field
754bc36eafdSMike Gerdts  *
755bc36eafdSMike Gerdts  * RETURN:      None
756bc36eafdSMike Gerdts  *
757bc36eafdSMike Gerdts  * DESCRIPTION: Utility routines for formatting output lines. Displays the
758bc36eafdSMike Gerdts  *              current table offset in hex and decimal, the field length,
759bc36eafdSMike Gerdts  *              and the field name.
760bc36eafdSMike Gerdts  *
761bc36eafdSMike Gerdts  ******************************************************************************/
762bc36eafdSMike Gerdts 
763bc36eafdSMike Gerdts void
AcpiDmLineHeader(UINT32 Offset,UINT32 ByteLength,char * Name)764bc36eafdSMike Gerdts AcpiDmLineHeader (
765bc36eafdSMike Gerdts     UINT32                  Offset,
766bc36eafdSMike Gerdts     UINT32                  ByteLength,
767bc36eafdSMike Gerdts     char                    *Name)
768bc36eafdSMike Gerdts {
769bc36eafdSMike Gerdts 
770bc36eafdSMike Gerdts     /* Allow a null name for fields that span multiple lines (large buffers) */
771bc36eafdSMike Gerdts 
772bc36eafdSMike Gerdts     if (!Name)
773bc36eafdSMike Gerdts     {
774bc36eafdSMike Gerdts         Name = "";
775bc36eafdSMike Gerdts     }
776bc36eafdSMike Gerdts 
777bc36eafdSMike Gerdts     if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
778bc36eafdSMike Gerdts     {
779bc36eafdSMike Gerdts         if (ByteLength)
780bc36eafdSMike Gerdts         {
781bc36eafdSMike Gerdts             AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
782bc36eafdSMike Gerdts         }
783bc36eafdSMike Gerdts         else
784bc36eafdSMike Gerdts         {
785bc36eafdSMike Gerdts             if (*Name)
786bc36eafdSMike Gerdts             {
787bc36eafdSMike Gerdts                 AcpiOsPrintf ("%41s : ", Name);
788bc36eafdSMike Gerdts             }
789bc36eafdSMike Gerdts             else
790bc36eafdSMike Gerdts             {
791bc36eafdSMike Gerdts                 AcpiOsPrintf ("%41s   ", Name);
792bc36eafdSMike Gerdts             }
793bc36eafdSMike Gerdts         }
794bc36eafdSMike Gerdts     }
795bc36eafdSMike Gerdts     else /* Normal disassembler or verbose template */
796bc36eafdSMike Gerdts     {
797bc36eafdSMike Gerdts         if (ByteLength)
798bc36eafdSMike Gerdts         {
799bc36eafdSMike Gerdts             AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
800bc36eafdSMike Gerdts                 Offset, Offset, ByteLength, Name);
801bc36eafdSMike Gerdts         }
802bc36eafdSMike Gerdts         else
803bc36eafdSMike Gerdts         {
804bc36eafdSMike Gerdts             if (*Name)
805bc36eafdSMike Gerdts             {
806bc36eafdSMike Gerdts                 AcpiOsPrintf ("%44s : ", Name);
807bc36eafdSMike Gerdts             }
808bc36eafdSMike Gerdts             else
809bc36eafdSMike Gerdts             {
810bc36eafdSMike Gerdts                 AcpiOsPrintf ("%44s   ", Name);
811bc36eafdSMike Gerdts             }
812bc36eafdSMike Gerdts         }
813bc36eafdSMike Gerdts     }
814bc36eafdSMike Gerdts }
815bc36eafdSMike Gerdts 
816bc36eafdSMike Gerdts void
AcpiDmLineHeader2(UINT32 Offset,UINT32 ByteLength,char * Name,UINT32 Value)817bc36eafdSMike Gerdts AcpiDmLineHeader2 (
818bc36eafdSMike Gerdts     UINT32                  Offset,
819bc36eafdSMike Gerdts     UINT32                  ByteLength,
820bc36eafdSMike Gerdts     char                    *Name,
821bc36eafdSMike Gerdts     UINT32                  Value)
822bc36eafdSMike Gerdts {
823bc36eafdSMike Gerdts 
824bc36eafdSMike Gerdts     if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
825bc36eafdSMike Gerdts     {
826bc36eafdSMike Gerdts         if (ByteLength)
827bc36eafdSMike Gerdts         {
828bc36eafdSMike Gerdts             AcpiOsPrintf ("[%.4d] %30s %3d : ",
829bc36eafdSMike Gerdts                 ByteLength, Name, Value);
830bc36eafdSMike Gerdts         }
831bc36eafdSMike Gerdts         else
832bc36eafdSMike Gerdts         {
833bc36eafdSMike Gerdts             AcpiOsPrintf ("%36s % 3d : ",
834bc36eafdSMike Gerdts                 Name, Value);
835bc36eafdSMike Gerdts         }
836bc36eafdSMike Gerdts     }
837bc36eafdSMike Gerdts     else /* Normal disassembler or verbose template */
838bc36eafdSMike Gerdts     {
839bc36eafdSMike Gerdts         if (ByteLength)
840bc36eafdSMike Gerdts         {
841bc36eafdSMike Gerdts             AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ",
842bc36eafdSMike Gerdts                 Offset, Offset, ByteLength, Name, Value);
843bc36eafdSMike Gerdts         }
844bc36eafdSMike Gerdts         else
845bc36eafdSMike Gerdts         {
846bc36eafdSMike Gerdts             AcpiOsPrintf ("[%3.3Xh %4.4d   ] %24s %3d : ",
847bc36eafdSMike Gerdts                 Offset, Offset, Name, Value);
848bc36eafdSMike Gerdts         }
849bc36eafdSMike Gerdts     }
850bc36eafdSMike Gerdts }
851bc36eafdSMike Gerdts 
852bc36eafdSMike Gerdts 
853bc36eafdSMike Gerdts /*******************************************************************************
854bc36eafdSMike Gerdts  *
855bc36eafdSMike Gerdts  * FUNCTION:    AcpiDmDumpTable
856bc36eafdSMike Gerdts  *
857bc36eafdSMike Gerdts  * PARAMETERS:  TableLength         - Length of the entire ACPI table
858bc36eafdSMike Gerdts  *              TableOffset         - Starting offset within the table for this
859bc36eafdSMike Gerdts  *                                    sub-descriptor (0 if main table)
860bc36eafdSMike Gerdts  *              Table               - The ACPI table
861bc36eafdSMike Gerdts  *              SubtableLength      - Length of this sub-descriptor
862bc36eafdSMike Gerdts  *              Info                - Info table for this ACPI table
863bc36eafdSMike Gerdts  *
864bc36eafdSMike Gerdts  * RETURN:      Status
865bc36eafdSMike Gerdts  *
866bc36eafdSMike Gerdts  * DESCRIPTION: Display ACPI table contents by walking the Info table.
867bc36eafdSMike Gerdts  *
868bc36eafdSMike Gerdts  * Note: This function must remain in sync with DtGetFieldLength.
869bc36eafdSMike Gerdts  *
870bc36eafdSMike Gerdts  ******************************************************************************/
871bc36eafdSMike Gerdts 
872bc36eafdSMike Gerdts ACPI_STATUS
AcpiDmDumpTable(UINT32 TableLength,UINT32 TableOffset,void * Table,UINT32 SubtableLength,ACPI_DMTABLE_INFO * Info)873bc36eafdSMike Gerdts AcpiDmDumpTable (
874bc36eafdSMike Gerdts     UINT32                  TableLength,
875bc36eafdSMike Gerdts     UINT32                  TableOffset,
876bc36eafdSMike Gerdts     void                    *Table,
877bc36eafdSMike Gerdts     UINT32                  SubtableLength,
878bc36eafdSMike Gerdts     ACPI_DMTABLE_INFO       *Info)
879bc36eafdSMike Gerdts {
880bc36eafdSMike Gerdts     UINT8                   *Target;
881bc36eafdSMike Gerdts     UINT32                  CurrentOffset;
882bc36eafdSMike Gerdts     UINT32                  ByteLength;
883bc36eafdSMike Gerdts     UINT8                   Temp8;
884bc36eafdSMike Gerdts     UINT16                  Temp16;
885bc36eafdSMike Gerdts     UINT32                  Temp32;
886bc36eafdSMike Gerdts     UINT64                  Value;
887bc36eafdSMike Gerdts     const AH_TABLE          *TableData;
888bc36eafdSMike Gerdts     const char              *Name;
889bc36eafdSMike Gerdts     BOOLEAN                 LastOutputBlankLine = FALSE;
890bc36eafdSMike Gerdts     ACPI_STATUS             Status;
891bc36eafdSMike Gerdts     char                    RepairedName[8];
892bc36eafdSMike Gerdts 
893bc36eafdSMike Gerdts 
894bc36eafdSMike Gerdts     if (!Info)
895bc36eafdSMike Gerdts     {
896bc36eafdSMike Gerdts         AcpiOsPrintf ("Display not implemented\n");
897bc36eafdSMike Gerdts         return (AE_NOT_IMPLEMENTED);
898bc36eafdSMike Gerdts     }
899bc36eafdSMike Gerdts 
900bc36eafdSMike Gerdts     /* Walk entire Info table; Null name terminates */
901bc36eafdSMike Gerdts 
902bc36eafdSMike Gerdts     for (; Info->Name; Info++)
903bc36eafdSMike Gerdts     {
904bc36eafdSMike Gerdts         /*
905bc36eafdSMike Gerdts          * Target points to the field within the ACPI Table. CurrentOffset is
906bc36eafdSMike Gerdts          * the offset of the field from the start of the main table.
907bc36eafdSMike Gerdts          */
908bc36eafdSMike Gerdts         Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
909bc36eafdSMike Gerdts         CurrentOffset = TableOffset + Info->Offset;
910bc36eafdSMike Gerdts 
911bc36eafdSMike Gerdts         /* Check for beyond subtable end or (worse) beyond EOT */
912bc36eafdSMike Gerdts 
913bc36eafdSMike Gerdts         if (SubtableLength && (Info->Offset >= SubtableLength))
914bc36eafdSMike Gerdts         {
915bc36eafdSMike Gerdts             AcpiOsPrintf (
916bc36eafdSMike Gerdts                 "/**** ACPI subtable terminates early - "
917bc36eafdSMike Gerdts                 "may be older version (dump table) */\n");
918bc36eafdSMike Gerdts 
919bc36eafdSMike Gerdts             /* Move on to next subtable */
920bc36eafdSMike Gerdts 
921bc36eafdSMike Gerdts             return (AE_OK);
922bc36eafdSMike Gerdts         }
923bc36eafdSMike Gerdts 
924bc36eafdSMike Gerdts         if (CurrentOffset >= TableLength)
925bc36eafdSMike Gerdts         {
926bc36eafdSMike Gerdts             AcpiOsPrintf (
927bc36eafdSMike Gerdts                 "/**** ACPI table terminates "
928bc36eafdSMike Gerdts                 "in the middle of a data structure! (dump table) */\n");
929bc36eafdSMike Gerdts             return (AE_BAD_DATA);
930bc36eafdSMike Gerdts         }
931bc36eafdSMike Gerdts 
932bc36eafdSMike Gerdts         /* Generate the byte length for this field */
933bc36eafdSMike Gerdts 
934bc36eafdSMike Gerdts         switch (Info->Opcode)
935bc36eafdSMike Gerdts         {
936bc36eafdSMike Gerdts         case ACPI_DMT_UINT8:
937bc36eafdSMike Gerdts         case ACPI_DMT_CHKSUM:
938bc36eafdSMike Gerdts         case ACPI_DMT_SPACEID:
939bc36eafdSMike Gerdts         case ACPI_DMT_ACCWIDTH:
940bc36eafdSMike Gerdts         case ACPI_DMT_IVRS:
941bc36eafdSMike Gerdts         case ACPI_DMT_GTDT:
942bc36eafdSMike Gerdts         case ACPI_DMT_MADT:
943bc36eafdSMike Gerdts         case ACPI_DMT_PCCT:
944bc36eafdSMike Gerdts         case ACPI_DMT_PMTT:
945*35786f68SRobert Mustacchi         case ACPI_DMT_PPTT:
946*35786f68SRobert Mustacchi         case ACPI_DMT_SDEV:
947bc36eafdSMike Gerdts         case ACPI_DMT_SRAT:
948bc36eafdSMike Gerdts         case ACPI_DMT_ASF:
949bc36eafdSMike Gerdts         case ACPI_DMT_HESTNTYP:
950bc36eafdSMike Gerdts         case ACPI_DMT_FADTPM:
951bc36eafdSMike Gerdts         case ACPI_DMT_EINJACT:
952bc36eafdSMike Gerdts         case ACPI_DMT_EINJINST:
953bc36eafdSMike Gerdts         case ACPI_DMT_ERSTACT:
954bc36eafdSMike Gerdts         case ACPI_DMT_ERSTINST:
955bc36eafdSMike Gerdts         case ACPI_DMT_DMAR_SCOPE:
956bc36eafdSMike Gerdts 
957bc36eafdSMike Gerdts             ByteLength = 1;
958bc36eafdSMike Gerdts             break;
959bc36eafdSMike Gerdts 
960bc36eafdSMike Gerdts         case ACPI_DMT_UINT16:
961bc36eafdSMike Gerdts         case ACPI_DMT_DMAR:
962bc36eafdSMike Gerdts         case ACPI_DMT_HEST:
963*35786f68SRobert Mustacchi         case ACPI_DMT_HMAT:
964bc36eafdSMike Gerdts         case ACPI_DMT_NFIT:
965bc36eafdSMike Gerdts 
966bc36eafdSMike Gerdts             ByteLength = 2;
967bc36eafdSMike Gerdts             break;
968bc36eafdSMike Gerdts 
969bc36eafdSMike Gerdts         case ACPI_DMT_UINT24:
970bc36eafdSMike Gerdts 
971bc36eafdSMike Gerdts             ByteLength = 3;
972bc36eafdSMike Gerdts             break;
973bc36eafdSMike Gerdts 
974bc36eafdSMike Gerdts         case ACPI_DMT_UINT32:
975bc36eafdSMike Gerdts         case ACPI_DMT_NAME4:
976bc36eafdSMike Gerdts         case ACPI_DMT_SIG:
977bc36eafdSMike Gerdts         case ACPI_DMT_LPIT:
978*35786f68SRobert Mustacchi         case ACPI_DMT_TPM2:
979bc36eafdSMike Gerdts 
980bc36eafdSMike Gerdts             ByteLength = 4;
981bc36eafdSMike Gerdts             break;
982bc36eafdSMike Gerdts 
983bc36eafdSMike Gerdts         case ACPI_DMT_UINT40:
984bc36eafdSMike Gerdts 
985bc36eafdSMike Gerdts             ByteLength = 5;
986bc36eafdSMike Gerdts             break;
987bc36eafdSMike Gerdts 
988bc36eafdSMike Gerdts         case ACPI_DMT_UINT48:
989bc36eafdSMike Gerdts         case ACPI_DMT_NAME6:
990bc36eafdSMike Gerdts 
991bc36eafdSMike Gerdts             ByteLength = 6;
992bc36eafdSMike Gerdts             break;
993bc36eafdSMike Gerdts 
994bc36eafdSMike Gerdts         case ACPI_DMT_UINT56:
995bc36eafdSMike Gerdts         case ACPI_DMT_BUF7:
996bc36eafdSMike Gerdts 
997bc36eafdSMike Gerdts             ByteLength = 7;
998bc36eafdSMike Gerdts             break;
999bc36eafdSMike Gerdts 
1000bc36eafdSMike Gerdts         case ACPI_DMT_UINT64:
1001bc36eafdSMike Gerdts         case ACPI_DMT_NAME8:
1002bc36eafdSMike Gerdts 
1003bc36eafdSMike Gerdts             ByteLength = 8;
1004bc36eafdSMike Gerdts             break;
1005bc36eafdSMike Gerdts 
1006bc36eafdSMike Gerdts         case ACPI_DMT_BUF10:
1007bc36eafdSMike Gerdts 
1008bc36eafdSMike Gerdts             ByteLength = 10;
1009bc36eafdSMike Gerdts             break;
1010bc36eafdSMike Gerdts 
1011*35786f68SRobert Mustacchi         case ACPI_DMT_BUF12:
1012*35786f68SRobert Mustacchi 
1013*35786f68SRobert Mustacchi             ByteLength = 12;
1014*35786f68SRobert Mustacchi             break;
1015*35786f68SRobert Mustacchi 
1016bc36eafdSMike Gerdts         case ACPI_DMT_BUF16:
1017bc36eafdSMike Gerdts         case ACPI_DMT_UUID:
1018bc36eafdSMike Gerdts 
1019bc36eafdSMike Gerdts             ByteLength = 16;
1020bc36eafdSMike Gerdts             break;
1021bc36eafdSMike Gerdts 
1022bc36eafdSMike Gerdts         case ACPI_DMT_BUF128:
1023bc36eafdSMike Gerdts 
1024bc36eafdSMike Gerdts             ByteLength = 128;
1025bc36eafdSMike Gerdts             break;
1026bc36eafdSMike Gerdts 
1027bc36eafdSMike Gerdts         case ACPI_DMT_UNICODE:
1028bc36eafdSMike Gerdts         case ACPI_DMT_BUFFER:
1029bc36eafdSMike Gerdts         case ACPI_DMT_RAW_BUFFER:
1030bc36eafdSMike Gerdts 
1031bc36eafdSMike Gerdts             ByteLength = SubtableLength;
1032bc36eafdSMike Gerdts             break;
1033bc36eafdSMike Gerdts 
1034bc36eafdSMike Gerdts         case ACPI_DMT_STRING:
1035bc36eafdSMike Gerdts 
1036bc36eafdSMike Gerdts             ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;
1037bc36eafdSMike Gerdts             break;
1038bc36eafdSMike Gerdts 
1039bc36eafdSMike Gerdts         case ACPI_DMT_GAS:
1040bc36eafdSMike Gerdts 
1041bc36eafdSMike Gerdts             if (!LastOutputBlankLine)
1042bc36eafdSMike Gerdts             {
1043bc36eafdSMike Gerdts                 AcpiOsPrintf ("\n");
1044bc36eafdSMike Gerdts                 LastOutputBlankLine = TRUE;
1045bc36eafdSMike Gerdts             }
1046bc36eafdSMike Gerdts 
1047bc36eafdSMike Gerdts             ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
1048bc36eafdSMike Gerdts             break;
1049bc36eafdSMike Gerdts 
1050bc36eafdSMike Gerdts         case ACPI_DMT_HESTNTFY:
1051bc36eafdSMike Gerdts 
1052bc36eafdSMike Gerdts             if (!LastOutputBlankLine)
1053bc36eafdSMike Gerdts             {
1054bc36eafdSMike Gerdts                 AcpiOsPrintf ("\n");
1055bc36eafdSMike Gerdts                 LastOutputBlankLine = TRUE;
1056bc36eafdSMike Gerdts             }
1057bc36eafdSMike Gerdts 
1058bc36eafdSMike Gerdts             ByteLength = sizeof (ACPI_HEST_NOTIFY);
1059bc36eafdSMike Gerdts             break;
1060bc36eafdSMike Gerdts 
1061bc36eafdSMike Gerdts         case ACPI_DMT_IORTMEM:
1062bc36eafdSMike Gerdts 
1063bc36eafdSMike Gerdts             if (!LastOutputBlankLine)
1064bc36eafdSMike Gerdts             {
1065bc36eafdSMike Gerdts                 LastOutputBlankLine = FALSE;
1066bc36eafdSMike Gerdts             }
1067bc36eafdSMike Gerdts 
1068bc36eafdSMike Gerdts             ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
1069bc36eafdSMike Gerdts             break;
1070bc36eafdSMike Gerdts 
1071bc36eafdSMike Gerdts         default:
1072bc36eafdSMike Gerdts 
1073bc36eafdSMike Gerdts             ByteLength = 0;
1074bc36eafdSMike Gerdts             break;
1075bc36eafdSMike Gerdts         }
1076bc36eafdSMike Gerdts 
1077bc36eafdSMike Gerdts         /* Check if we are beyond a subtable, or (worse) beyond EOT */
1078bc36eafdSMike Gerdts 
1079bc36eafdSMike Gerdts         if (CurrentOffset + ByteLength > TableLength)
1080bc36eafdSMike Gerdts         {
1081bc36eafdSMike Gerdts             if (SubtableLength)
1082bc36eafdSMike Gerdts             {
1083bc36eafdSMike Gerdts                 AcpiOsPrintf (
1084bc36eafdSMike Gerdts                     "/**** ACPI subtable terminates early - "
1085bc36eafdSMike Gerdts                     "may be older version (dump table) */\n");
1086bc36eafdSMike Gerdts 
1087bc36eafdSMike Gerdts                 /* Move on to next subtable */
1088bc36eafdSMike Gerdts 
1089bc36eafdSMike Gerdts                 return (AE_OK);
1090bc36eafdSMike Gerdts             }
1091bc36eafdSMike Gerdts 
1092bc36eafdSMike Gerdts             AcpiOsPrintf (
1093bc36eafdSMike Gerdts                 "/**** ACPI table terminates "
1094bc36eafdSMike Gerdts                 "in the middle of a data structure! */\n");
1095bc36eafdSMike Gerdts             return (AE_BAD_DATA);
1096bc36eafdSMike Gerdts         }
1097bc36eafdSMike Gerdts 
1098bc36eafdSMike Gerdts         if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)
1099bc36eafdSMike Gerdts         {
1100bc36eafdSMike Gerdts             AcpiOsPrintf ("%s", Info->Name);
1101bc36eafdSMike Gerdts             continue;
1102bc36eafdSMike Gerdts         }
1103bc36eafdSMike Gerdts 
1104bc36eafdSMike Gerdts         /* Start a new line and decode the opcode */
1105bc36eafdSMike Gerdts 
1106bc36eafdSMike Gerdts         AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
1107bc36eafdSMike Gerdts 
1108bc36eafdSMike Gerdts         switch (Info->Opcode)
1109bc36eafdSMike Gerdts         {
1110bc36eafdSMike Gerdts         /* Single-bit Flag fields. Note: Opcode is the bit position */
1111bc36eafdSMike Gerdts 
1112bc36eafdSMike Gerdts         case ACPI_DMT_FLAG0:
1113bc36eafdSMike Gerdts         case ACPI_DMT_FLAG1:
1114bc36eafdSMike Gerdts         case ACPI_DMT_FLAG2:
1115bc36eafdSMike Gerdts         case ACPI_DMT_FLAG3:
1116bc36eafdSMike Gerdts         case ACPI_DMT_FLAG4:
1117bc36eafdSMike Gerdts         case ACPI_DMT_FLAG5:
1118bc36eafdSMike Gerdts         case ACPI_DMT_FLAG6:
1119bc36eafdSMike Gerdts         case ACPI_DMT_FLAG7:
1120bc36eafdSMike Gerdts 
1121bc36eafdSMike Gerdts             AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);
1122bc36eafdSMike Gerdts             break;
1123bc36eafdSMike Gerdts 
1124bc36eafdSMike Gerdts         /* 2-bit Flag fields */
1125bc36eafdSMike Gerdts 
1126bc36eafdSMike Gerdts         case ACPI_DMT_FLAGS0:
1127bc36eafdSMike Gerdts 
1128bc36eafdSMike Gerdts             AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
1129bc36eafdSMike Gerdts             break;
1130bc36eafdSMike Gerdts 
1131bc36eafdSMike Gerdts         case ACPI_DMT_FLAGS1:
1132bc36eafdSMike Gerdts 
1133bc36eafdSMike Gerdts             AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);
1134bc36eafdSMike Gerdts             break;
1135bc36eafdSMike Gerdts 
1136bc36eafdSMike Gerdts         case ACPI_DMT_FLAGS2:
1137bc36eafdSMike Gerdts 
1138bc36eafdSMike Gerdts             AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
1139bc36eafdSMike Gerdts             break;
1140bc36eafdSMike Gerdts 
1141bc36eafdSMike Gerdts         case ACPI_DMT_FLAGS4:
1142bc36eafdSMike Gerdts 
1143bc36eafdSMike Gerdts             AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);
1144bc36eafdSMike Gerdts             break;
1145bc36eafdSMike Gerdts 
1146*35786f68SRobert Mustacchi         case ACPI_DMT_FLAGS4_0:
1147*35786f68SRobert Mustacchi 
1148*35786f68SRobert Mustacchi             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);
1149*35786f68SRobert Mustacchi             break;
1150*35786f68SRobert Mustacchi 
1151*35786f68SRobert Mustacchi         case ACPI_DMT_FLAGS4_4:
1152*35786f68SRobert Mustacchi 
1153*35786f68SRobert Mustacchi             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);
1154*35786f68SRobert Mustacchi             break;
1155*35786f68SRobert Mustacchi 
1156*35786f68SRobert Mustacchi         case ACPI_DMT_FLAGS4_8:
1157*35786f68SRobert Mustacchi 
1158*35786f68SRobert Mustacchi             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);
1159*35786f68SRobert Mustacchi             break;
1160*35786f68SRobert Mustacchi 
1161*35786f68SRobert Mustacchi         case ACPI_DMT_FLAGS4_12:
1162*35786f68SRobert Mustacchi 
1163*35786f68SRobert Mustacchi             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);
1164*35786f68SRobert Mustacchi             break;
1165*35786f68SRobert Mustacchi 
1166*35786f68SRobert Mustacchi         case ACPI_DMT_FLAGS16_16:
1167*35786f68SRobert Mustacchi 
1168*35786f68SRobert Mustacchi             AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);
1169*35786f68SRobert Mustacchi             break;
1170*35786f68SRobert Mustacchi 
1171bc36eafdSMike Gerdts         /* Integer Data Types */
1172bc36eafdSMike Gerdts 
1173bc36eafdSMike Gerdts         case ACPI_DMT_UINT8:
1174bc36eafdSMike Gerdts         case ACPI_DMT_UINT16:
1175bc36eafdSMike Gerdts         case ACPI_DMT_UINT24:
1176bc36eafdSMike Gerdts         case ACPI_DMT_UINT32:
1177bc36eafdSMike Gerdts         case ACPI_DMT_UINT40:
1178bc36eafdSMike Gerdts         case ACPI_DMT_UINT48:
1179bc36eafdSMike Gerdts         case ACPI_DMT_UINT56:
1180bc36eafdSMike Gerdts         case ACPI_DMT_UINT64:
1181bc36eafdSMike Gerdts             /*
1182bc36eafdSMike Gerdts              * Dump bytes - high byte first, low byte last.
1183bc36eafdSMike Gerdts              * Note: All ACPI tables are little-endian.
1184bc36eafdSMike Gerdts              */
1185bc36eafdSMike Gerdts             Value = 0;
1186bc36eafdSMike Gerdts             for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
1187bc36eafdSMike Gerdts             {
1188bc36eafdSMike Gerdts                 AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
1189bc36eafdSMike Gerdts                 Value |= Target[Temp8 - 1];
1190bc36eafdSMike Gerdts                 Value <<= 8;
1191bc36eafdSMike Gerdts             }
1192bc36eafdSMike Gerdts 
1193bc36eafdSMike Gerdts             if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
1194bc36eafdSMike Gerdts             {
1195bc36eafdSMike Gerdts                 AcpiOsPrintf (" [Optional field not present]");
1196bc36eafdSMike Gerdts             }
1197bc36eafdSMike Gerdts 
1198bc36eafdSMike Gerdts             AcpiOsPrintf ("\n");
1199bc36eafdSMike Gerdts             break;
1200bc36eafdSMike Gerdts 
1201bc36eafdSMike Gerdts         case ACPI_DMT_BUF7:
1202bc36eafdSMike Gerdts         case ACPI_DMT_BUF10:
1203*35786f68SRobert Mustacchi         case ACPI_DMT_BUF12:
1204bc36eafdSMike Gerdts         case ACPI_DMT_BUF16:
1205bc36eafdSMike Gerdts         case ACPI_DMT_BUF128:
1206bc36eafdSMike Gerdts             /*
1207bc36eafdSMike Gerdts              * Buffer: Size depends on the opcode and was set above.
1208bc36eafdSMike Gerdts              * Each hex byte is separated with a space.
1209bc36eafdSMike Gerdts              * Multiple lines are separated by line continuation char.
1210bc36eafdSMike Gerdts              */
1211bc36eafdSMike Gerdts             for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
1212bc36eafdSMike Gerdts             {
1213bc36eafdSMike Gerdts                 AcpiOsPrintf ("%2.2X", Target[Temp16]);
1214bc36eafdSMike Gerdts                 if ((UINT32) (Temp16 + 1) < ByteLength)
1215bc36eafdSMike Gerdts                 {
1216bc36eafdSMike Gerdts                     if ((Temp16 > 0) && (!((Temp16+1) % 16)))
1217bc36eafdSMike Gerdts                     {
1218bc36eafdSMike Gerdts                         AcpiOsPrintf (" \\\n"); /* Line continuation */
1219bc36eafdSMike Gerdts                         AcpiDmLineHeader (0, 0, NULL);
1220bc36eafdSMike Gerdts                     }
1221bc36eafdSMike Gerdts                     else
1222bc36eafdSMike Gerdts                     {
1223bc36eafdSMike Gerdts                         AcpiOsPrintf (" ");
1224bc36eafdSMike Gerdts                     }
1225bc36eafdSMike Gerdts                 }
1226bc36eafdSMike Gerdts             }
1227bc36eafdSMike Gerdts 
1228bc36eafdSMike Gerdts             AcpiOsPrintf ("\n");
1229bc36eafdSMike Gerdts             break;
1230bc36eafdSMike Gerdts 
1231bc36eafdSMike Gerdts         case ACPI_DMT_UUID:
1232bc36eafdSMike Gerdts 
1233bc36eafdSMike Gerdts             /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
1234bc36eafdSMike Gerdts 
1235bc36eafdSMike Gerdts             (void) AuConvertUuidToString ((char *) Target, MsgBuffer);
1236bc36eafdSMike Gerdts 
1237bc36eafdSMike Gerdts             AcpiOsPrintf ("%s\n", MsgBuffer);
1238bc36eafdSMike Gerdts             break;
1239bc36eafdSMike Gerdts 
1240bc36eafdSMike Gerdts         case ACPI_DMT_STRING:
1241bc36eafdSMike Gerdts 
1242bc36eafdSMike Gerdts             AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
1243bc36eafdSMike Gerdts             break;
1244bc36eafdSMike Gerdts 
1245bc36eafdSMike Gerdts         /* Fixed length ASCII name fields */
1246bc36eafdSMike Gerdts 
1247bc36eafdSMike Gerdts         case ACPI_DMT_SIG:
1248bc36eafdSMike Gerdts 
1249bc36eafdSMike Gerdts             AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1250bc36eafdSMike Gerdts             AcpiOsPrintf ("\"%.4s\"    ", RepairedName);
1251bc36eafdSMike Gerdts 
1252bc36eafdSMike Gerdts             TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
1253bc36eafdSMike Gerdts             if (TableData)
1254bc36eafdSMike Gerdts             {
1255bc36eafdSMike Gerdts                 AcpiOsPrintf (STRING_FORMAT, TableData->Description);
1256bc36eafdSMike Gerdts             }
1257bc36eafdSMike Gerdts             else
1258bc36eafdSMike Gerdts             {
1259bc36eafdSMike Gerdts                 AcpiOsPrintf ("\n");
1260bc36eafdSMike Gerdts             }
1261bc36eafdSMike Gerdts             break;
1262bc36eafdSMike Gerdts 
1263bc36eafdSMike Gerdts         case ACPI_DMT_NAME4:
1264bc36eafdSMike Gerdts 
1265bc36eafdSMike Gerdts             AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1266bc36eafdSMike Gerdts             AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
1267bc36eafdSMike Gerdts             break;
1268bc36eafdSMike Gerdts 
1269bc36eafdSMike Gerdts         case ACPI_DMT_NAME6:
1270bc36eafdSMike Gerdts 
1271bc36eafdSMike Gerdts             AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);
1272bc36eafdSMike Gerdts             AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
1273bc36eafdSMike Gerdts             break;
1274bc36eafdSMike Gerdts 
1275bc36eafdSMike Gerdts         case ACPI_DMT_NAME8:
1276bc36eafdSMike Gerdts 
1277bc36eafdSMike Gerdts             AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);
1278bc36eafdSMike Gerdts             AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
1279bc36eafdSMike Gerdts             break;
1280bc36eafdSMike Gerdts 
1281bc36eafdSMike Gerdts         /* Special Data Types */
1282bc36eafdSMike Gerdts 
1283bc36eafdSMike Gerdts         case ACPI_DMT_CHKSUM:
1284bc36eafdSMike Gerdts 
1285bc36eafdSMike Gerdts             /* Checksum, display and validate */
1286bc36eafdSMike Gerdts 
1287bc36eafdSMike Gerdts             AcpiOsPrintf ("%2.2X", *Target);
1288bc36eafdSMike Gerdts             Temp8 = AcpiDmGenerateChecksum (Table,
1289bc36eafdSMike Gerdts                 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
1290bc36eafdSMike Gerdts                 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
1291bc36eafdSMike Gerdts 
1292bc36eafdSMike Gerdts             if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
1293bc36eafdSMike Gerdts             {
1294bc36eafdSMike Gerdts                 AcpiOsPrintf (
1295bc36eafdSMike Gerdts                     "     /* Incorrect checksum, should be %2.2X */", Temp8);
1296bc36eafdSMike Gerdts             }
1297bc36eafdSMike Gerdts 
1298bc36eafdSMike Gerdts             AcpiOsPrintf ("\n");
1299bc36eafdSMike Gerdts             break;
1300bc36eafdSMike Gerdts 
1301bc36eafdSMike Gerdts         case ACPI_DMT_SPACEID:
1302bc36eafdSMike Gerdts 
1303bc36eafdSMike Gerdts             /* Address Space ID */
1304bc36eafdSMike Gerdts 
1305bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));
1306bc36eafdSMike Gerdts             break;
1307bc36eafdSMike Gerdts 
1308bc36eafdSMike Gerdts         case ACPI_DMT_ACCWIDTH:
1309bc36eafdSMike Gerdts 
1310bc36eafdSMike Gerdts             /* Encoded Access Width */
1311bc36eafdSMike Gerdts 
1312bc36eafdSMike Gerdts             Temp8 = *Target;
1313bc36eafdSMike Gerdts             if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
1314bc36eafdSMike Gerdts             {
1315bc36eafdSMike Gerdts                 Temp8 = ACPI_GAS_WIDTH_RESERVED;
1316bc36eafdSMike Gerdts             }
1317bc36eafdSMike Gerdts 
1318bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);
1319bc36eafdSMike Gerdts             break;
1320bc36eafdSMike Gerdts 
1321bc36eafdSMike Gerdts         case ACPI_DMT_GAS:
1322bc36eafdSMike Gerdts 
1323bc36eafdSMike Gerdts             /* Generic Address Structure */
1324bc36eafdSMike Gerdts 
1325bc36eafdSMike Gerdts             AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
1326bc36eafdSMike Gerdts             Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1327bc36eafdSMike Gerdts                 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
1328bc36eafdSMike Gerdts             if (ACPI_FAILURE (Status))
1329bc36eafdSMike Gerdts             {
1330bc36eafdSMike Gerdts                 return (Status);
1331bc36eafdSMike Gerdts             }
1332bc36eafdSMike Gerdts 
1333bc36eafdSMike Gerdts             AcpiOsPrintf ("\n");
1334bc36eafdSMike Gerdts             LastOutputBlankLine = TRUE;
1335bc36eafdSMike Gerdts             break;
1336bc36eafdSMike Gerdts 
1337bc36eafdSMike Gerdts         case ACPI_DMT_ASF:
1338bc36eafdSMike Gerdts 
1339bc36eafdSMike Gerdts             /* ASF subtable types */
1340bc36eafdSMike Gerdts 
1341bc36eafdSMike Gerdts             Temp16 = (UINT16) ((*Target) & 0x7F);  /* Top bit can be zero or one */
1342bc36eafdSMike Gerdts             if (Temp16 > ACPI_ASF_TYPE_RESERVED)
1343bc36eafdSMike Gerdts             {
1344bc36eafdSMike Gerdts                 Temp16 = ACPI_ASF_TYPE_RESERVED;
1345bc36eafdSMike Gerdts             }
1346bc36eafdSMike Gerdts 
1347bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
1348bc36eafdSMike Gerdts             break;
1349bc36eafdSMike Gerdts 
1350bc36eafdSMike Gerdts         case ACPI_DMT_DMAR:
1351bc36eafdSMike Gerdts 
1352bc36eafdSMike Gerdts             /* DMAR subtable types */
1353bc36eafdSMike Gerdts 
1354bc36eafdSMike Gerdts             Temp16 = ACPI_GET16 (Target);
1355bc36eafdSMike Gerdts             if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
1356bc36eafdSMike Gerdts             {
1357bc36eafdSMike Gerdts                 Temp16 = ACPI_DMAR_TYPE_RESERVED;
1358bc36eafdSMike Gerdts             }
1359bc36eafdSMike Gerdts 
1360bc36eafdSMike Gerdts             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1361bc36eafdSMike Gerdts                 AcpiDmDmarSubnames[Temp16]);
1362bc36eafdSMike Gerdts             break;
1363bc36eafdSMike Gerdts 
1364bc36eafdSMike Gerdts         case ACPI_DMT_DMAR_SCOPE:
1365bc36eafdSMike Gerdts 
1366bc36eafdSMike Gerdts             /* DMAR device scope types */
1367bc36eafdSMike Gerdts 
1368bc36eafdSMike Gerdts             Temp8 = *Target;
1369bc36eafdSMike Gerdts             if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
1370bc36eafdSMike Gerdts             {
1371bc36eafdSMike Gerdts                 Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
1372bc36eafdSMike Gerdts             }
1373bc36eafdSMike Gerdts 
1374bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1375bc36eafdSMike Gerdts                 AcpiDmDmarScope[Temp8]);
1376bc36eafdSMike Gerdts             break;
1377bc36eafdSMike Gerdts 
1378bc36eafdSMike Gerdts         case ACPI_DMT_EINJACT:
1379bc36eafdSMike Gerdts 
1380bc36eafdSMike Gerdts             /* EINJ Action types */
1381bc36eafdSMike Gerdts 
1382bc36eafdSMike Gerdts             Temp8 = *Target;
1383bc36eafdSMike Gerdts             if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
1384bc36eafdSMike Gerdts             {
1385bc36eafdSMike Gerdts                 Temp8 = ACPI_EINJ_ACTION_RESERVED;
1386bc36eafdSMike Gerdts             }
1387bc36eafdSMike Gerdts 
1388bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1389bc36eafdSMike Gerdts                 AcpiDmEinjActions[Temp8]);
1390bc36eafdSMike Gerdts             break;
1391bc36eafdSMike Gerdts 
1392bc36eafdSMike Gerdts         case ACPI_DMT_EINJINST:
1393bc36eafdSMike Gerdts 
1394bc36eafdSMike Gerdts             /* EINJ Instruction types */
1395bc36eafdSMike Gerdts 
1396bc36eafdSMike Gerdts             Temp8 = *Target;
1397bc36eafdSMike Gerdts             if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
1398bc36eafdSMike Gerdts             {
1399bc36eafdSMike Gerdts                 Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
1400bc36eafdSMike Gerdts             }
1401bc36eafdSMike Gerdts 
1402bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1403bc36eafdSMike Gerdts                 AcpiDmEinjInstructions[Temp8]);
1404bc36eafdSMike Gerdts             break;
1405bc36eafdSMike Gerdts 
1406bc36eafdSMike Gerdts         case ACPI_DMT_ERSTACT:
1407bc36eafdSMike Gerdts 
1408bc36eafdSMike Gerdts             /* ERST Action types */
1409bc36eafdSMike Gerdts 
1410bc36eafdSMike Gerdts             Temp8 = *Target;
1411bc36eafdSMike Gerdts             if (Temp8 > ACPI_ERST_ACTION_RESERVED)
1412bc36eafdSMike Gerdts             {
1413bc36eafdSMike Gerdts                 Temp8 = ACPI_ERST_ACTION_RESERVED;
1414bc36eafdSMike Gerdts             }
1415bc36eafdSMike Gerdts 
1416bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1417bc36eafdSMike Gerdts                 AcpiDmErstActions[Temp8]);
1418bc36eafdSMike Gerdts             break;
1419bc36eafdSMike Gerdts 
1420bc36eafdSMike Gerdts         case ACPI_DMT_ERSTINST:
1421bc36eafdSMike Gerdts 
1422bc36eafdSMike Gerdts             /* ERST Instruction types */
1423bc36eafdSMike Gerdts 
1424bc36eafdSMike Gerdts             Temp8 = *Target;
1425bc36eafdSMike Gerdts             if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
1426bc36eafdSMike Gerdts             {
1427bc36eafdSMike Gerdts                 Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
1428bc36eafdSMike Gerdts             }
1429bc36eafdSMike Gerdts 
1430bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1431bc36eafdSMike Gerdts                 AcpiDmErstInstructions[Temp8]);
1432bc36eafdSMike Gerdts             break;
1433bc36eafdSMike Gerdts 
1434bc36eafdSMike Gerdts         case ACPI_DMT_GTDT:
1435bc36eafdSMike Gerdts 
1436bc36eafdSMike Gerdts             /* GTDT subtable types */
1437bc36eafdSMike Gerdts 
1438bc36eafdSMike Gerdts             Temp8 = *Target;
1439bc36eafdSMike Gerdts             if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
1440bc36eafdSMike Gerdts             {
1441bc36eafdSMike Gerdts                 Temp8 = ACPI_GTDT_TYPE_RESERVED;
1442bc36eafdSMike Gerdts             }
1443bc36eafdSMike Gerdts 
1444bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1445bc36eafdSMike Gerdts                 AcpiDmGtdtSubnames[Temp8]);
1446bc36eafdSMike Gerdts             break;
1447bc36eafdSMike Gerdts 
1448bc36eafdSMike Gerdts         case ACPI_DMT_HEST:
1449bc36eafdSMike Gerdts 
1450bc36eafdSMike Gerdts             /* HEST subtable types */
1451bc36eafdSMike Gerdts 
1452bc36eafdSMike Gerdts             Temp16 = ACPI_GET16 (Target);
1453bc36eafdSMike Gerdts             if (Temp16 > ACPI_HEST_TYPE_RESERVED)
1454bc36eafdSMike Gerdts             {
1455bc36eafdSMike Gerdts                 Temp16 = ACPI_HEST_TYPE_RESERVED;
1456bc36eafdSMike Gerdts             }
1457bc36eafdSMike Gerdts 
1458bc36eafdSMike Gerdts             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1459bc36eafdSMike Gerdts                 AcpiDmHestSubnames[Temp16]);
1460bc36eafdSMike Gerdts             break;
1461bc36eafdSMike Gerdts 
1462bc36eafdSMike Gerdts         case ACPI_DMT_HESTNTFY:
1463bc36eafdSMike Gerdts 
1464bc36eafdSMike Gerdts             AcpiOsPrintf (STRING_FORMAT,
1465bc36eafdSMike Gerdts                 "Hardware Error Notification Structure");
1466bc36eafdSMike Gerdts 
1467bc36eafdSMike Gerdts             Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1468bc36eafdSMike Gerdts                 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
1469bc36eafdSMike Gerdts             if (ACPI_FAILURE (Status))
1470bc36eafdSMike Gerdts             {
1471bc36eafdSMike Gerdts                 return (Status);
1472bc36eafdSMike Gerdts             }
1473bc36eafdSMike Gerdts 
1474bc36eafdSMike Gerdts             AcpiOsPrintf ("\n");
1475bc36eafdSMike Gerdts             LastOutputBlankLine = TRUE;
1476bc36eafdSMike Gerdts             break;
1477bc36eafdSMike Gerdts 
1478bc36eafdSMike Gerdts         case ACPI_DMT_HESTNTYP:
1479bc36eafdSMike Gerdts 
1480bc36eafdSMike Gerdts             /* HEST Notify types */
1481bc36eafdSMike Gerdts 
1482bc36eafdSMike Gerdts             Temp8 = *Target;
1483bc36eafdSMike Gerdts             if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)
1484bc36eafdSMike Gerdts             {
1485bc36eafdSMike Gerdts                 Temp8 = ACPI_HEST_NOTIFY_RESERVED;
1486bc36eafdSMike Gerdts             }
1487bc36eafdSMike Gerdts 
1488bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1489bc36eafdSMike Gerdts                 AcpiDmHestNotifySubnames[Temp8]);
1490bc36eafdSMike Gerdts             break;
1491bc36eafdSMike Gerdts 
1492*35786f68SRobert Mustacchi         case ACPI_DMT_HMAT:
1493*35786f68SRobert Mustacchi 
1494*35786f68SRobert Mustacchi             /* HMAT subtable types */
1495*35786f68SRobert Mustacchi 
1496*35786f68SRobert Mustacchi             Temp16 = *Target;
1497*35786f68SRobert Mustacchi             if (Temp16 > ACPI_HMAT_TYPE_RESERVED)
1498*35786f68SRobert Mustacchi             {
1499*35786f68SRobert Mustacchi                 Temp16 = ACPI_HMAT_TYPE_RESERVED;
1500*35786f68SRobert Mustacchi             }
1501*35786f68SRobert Mustacchi 
1502*35786f68SRobert Mustacchi             AcpiOsPrintf (UINT16_FORMAT, *Target,
1503*35786f68SRobert Mustacchi                 AcpiDmHmatSubnames[Temp16]);
1504*35786f68SRobert Mustacchi             break;
1505*35786f68SRobert Mustacchi 
1506bc36eafdSMike Gerdts         case ACPI_DMT_IORTMEM:
1507bc36eafdSMike Gerdts 
1508bc36eafdSMike Gerdts             AcpiOsPrintf (STRING_FORMAT,
1509bc36eafdSMike Gerdts                 "IORT Memory Access Properties");
1510bc36eafdSMike Gerdts 
1511bc36eafdSMike Gerdts             Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1512bc36eafdSMike Gerdts                 sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
1513bc36eafdSMike Gerdts             if (ACPI_FAILURE (Status))
1514bc36eafdSMike Gerdts             {
1515bc36eafdSMike Gerdts                 return (Status);
1516bc36eafdSMike Gerdts             }
1517bc36eafdSMike Gerdts 
1518bc36eafdSMike Gerdts             LastOutputBlankLine = TRUE;
1519bc36eafdSMike Gerdts             break;
1520bc36eafdSMike Gerdts 
1521bc36eafdSMike Gerdts         case ACPI_DMT_MADT:
1522bc36eafdSMike Gerdts 
1523bc36eafdSMike Gerdts             /* MADT subtable types */
1524bc36eafdSMike Gerdts 
1525bc36eafdSMike Gerdts             Temp8 = *Target;
1526bc36eafdSMike Gerdts             if (Temp8 > ACPI_MADT_TYPE_RESERVED)
1527bc36eafdSMike Gerdts             {
1528bc36eafdSMike Gerdts                 Temp8 = ACPI_MADT_TYPE_RESERVED;
1529bc36eafdSMike Gerdts             }
1530bc36eafdSMike Gerdts 
1531bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1532bc36eafdSMike Gerdts                 AcpiDmMadtSubnames[Temp8]);
1533bc36eafdSMike Gerdts             break;
1534bc36eafdSMike Gerdts 
1535bc36eafdSMike Gerdts         case ACPI_DMT_NFIT:
1536bc36eafdSMike Gerdts 
1537bc36eafdSMike Gerdts             /* NFIT subtable types */
1538bc36eafdSMike Gerdts 
1539bc36eafdSMike Gerdts             Temp16 = ACPI_GET16 (Target);
1540bc36eafdSMike Gerdts             if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
1541bc36eafdSMike Gerdts             {
1542bc36eafdSMike Gerdts                 Temp16 = ACPI_NFIT_TYPE_RESERVED;
1543bc36eafdSMike Gerdts             }
1544bc36eafdSMike Gerdts 
1545bc36eafdSMike Gerdts             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1546bc36eafdSMike Gerdts                 AcpiDmNfitSubnames[Temp16]);
1547bc36eafdSMike Gerdts             break;
1548bc36eafdSMike Gerdts 
1549bc36eafdSMike Gerdts         case ACPI_DMT_PCCT:
1550bc36eafdSMike Gerdts 
1551bc36eafdSMike Gerdts             /* PCCT subtable types */
1552bc36eafdSMike Gerdts 
1553bc36eafdSMike Gerdts             Temp8 = *Target;
1554bc36eafdSMike Gerdts             if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
1555bc36eafdSMike Gerdts             {
1556bc36eafdSMike Gerdts                 Temp8 = ACPI_PCCT_TYPE_RESERVED;
1557bc36eafdSMike Gerdts             }
1558bc36eafdSMike Gerdts 
1559bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1560bc36eafdSMike Gerdts                 AcpiDmPcctSubnames[Temp8]);
1561bc36eafdSMike Gerdts             break;
1562bc36eafdSMike Gerdts 
1563bc36eafdSMike Gerdts         case ACPI_DMT_PMTT:
1564bc36eafdSMike Gerdts 
1565bc36eafdSMike Gerdts             /* PMTT subtable types */
1566bc36eafdSMike Gerdts 
1567bc36eafdSMike Gerdts             Temp8 = *Target;
1568bc36eafdSMike Gerdts             if (Temp8 > ACPI_PMTT_TYPE_RESERVED)
1569bc36eafdSMike Gerdts             {
1570bc36eafdSMike Gerdts                 Temp8 = ACPI_PMTT_TYPE_RESERVED;
1571bc36eafdSMike Gerdts             }
1572bc36eafdSMike Gerdts 
1573bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1574bc36eafdSMike Gerdts                 AcpiDmPmttSubnames[Temp8]);
1575bc36eafdSMike Gerdts             break;
1576bc36eafdSMike Gerdts 
1577*35786f68SRobert Mustacchi         case ACPI_DMT_PPTT:
1578*35786f68SRobert Mustacchi 
1579*35786f68SRobert Mustacchi             /* PPTT subtable types */
1580*35786f68SRobert Mustacchi 
1581*35786f68SRobert Mustacchi             Temp8 = *Target;
1582*35786f68SRobert Mustacchi             if (Temp8 > ACPI_PPTT_TYPE_RESERVED)
1583*35786f68SRobert Mustacchi             {
1584*35786f68SRobert Mustacchi                 Temp8 = ACPI_PPTT_TYPE_RESERVED;
1585*35786f68SRobert Mustacchi             }
1586*35786f68SRobert Mustacchi 
1587*35786f68SRobert Mustacchi             AcpiOsPrintf (UINT8_FORMAT, *Target,
1588*35786f68SRobert Mustacchi                 AcpiDmPpttSubnames[Temp8]);
1589*35786f68SRobert Mustacchi             break;
1590*35786f68SRobert Mustacchi 
1591bc36eafdSMike Gerdts         case ACPI_DMT_UNICODE:
1592bc36eafdSMike Gerdts 
1593bc36eafdSMike Gerdts             if (ByteLength == 0)
1594bc36eafdSMike Gerdts             {
1595bc36eafdSMike Gerdts                 AcpiOsPrintf ("/* Zero-length Data */\n");
1596bc36eafdSMike Gerdts                 break;
1597bc36eafdSMike Gerdts             }
1598bc36eafdSMike Gerdts 
1599bc36eafdSMike Gerdts             AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength);
1600bc36eafdSMike Gerdts             break;
1601bc36eafdSMike Gerdts 
1602bc36eafdSMike Gerdts         case ACPI_DMT_RAW_BUFFER:
1603bc36eafdSMike Gerdts 
1604bc36eafdSMike Gerdts             if (ByteLength == 0)
1605bc36eafdSMike Gerdts             {
1606bc36eafdSMike Gerdts                 AcpiOsPrintf ("/* Zero-length Data */\n");
1607bc36eafdSMike Gerdts                 break;
1608bc36eafdSMike Gerdts             }
1609bc36eafdSMike Gerdts 
1610bc36eafdSMike Gerdts             AcpiDmDumpBuffer (Table, CurrentOffset, ByteLength,
1611bc36eafdSMike Gerdts                 CurrentOffset, NULL);
1612bc36eafdSMike Gerdts             break;
1613bc36eafdSMike Gerdts 
1614*35786f68SRobert Mustacchi         case ACPI_DMT_SDEV:
1615*35786f68SRobert Mustacchi 
1616*35786f68SRobert Mustacchi             /* SDEV subtable types */
1617*35786f68SRobert Mustacchi 
1618*35786f68SRobert Mustacchi             Temp8 = *Target;
1619*35786f68SRobert Mustacchi             if (Temp8 > ACPI_SDEV_TYPE_RESERVED)
1620*35786f68SRobert Mustacchi             {
1621*35786f68SRobert Mustacchi                 Temp8 = ACPI_SDEV_TYPE_RESERVED;
1622*35786f68SRobert Mustacchi             }
1623*35786f68SRobert Mustacchi 
1624*35786f68SRobert Mustacchi             AcpiOsPrintf (UINT8_FORMAT, *Target,
1625*35786f68SRobert Mustacchi                 AcpiDmSdevSubnames[Temp8]);
1626*35786f68SRobert Mustacchi             break;
1627*35786f68SRobert Mustacchi 
1628bc36eafdSMike Gerdts         case ACPI_DMT_SRAT:
1629bc36eafdSMike Gerdts 
1630bc36eafdSMike Gerdts             /* SRAT subtable types */
1631bc36eafdSMike Gerdts 
1632bc36eafdSMike Gerdts             Temp8 = *Target;
1633bc36eafdSMike Gerdts             if (Temp8 > ACPI_SRAT_TYPE_RESERVED)
1634bc36eafdSMike Gerdts             {
1635bc36eafdSMike Gerdts                 Temp8 = ACPI_SRAT_TYPE_RESERVED;
1636bc36eafdSMike Gerdts             }
1637bc36eafdSMike Gerdts 
1638bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1639bc36eafdSMike Gerdts                 AcpiDmSratSubnames[Temp8]);
1640bc36eafdSMike Gerdts             break;
1641bc36eafdSMike Gerdts 
1642*35786f68SRobert Mustacchi         case ACPI_DMT_TPM2:
1643*35786f68SRobert Mustacchi 
1644*35786f68SRobert Mustacchi             /* TPM2 Start Method types */
1645*35786f68SRobert Mustacchi 
1646*35786f68SRobert Mustacchi             Temp8 = *Target;
1647*35786f68SRobert Mustacchi             if (Temp8 > ACPI_TPM2_RESERVED)
1648*35786f68SRobert Mustacchi             {
1649*35786f68SRobert Mustacchi                 Temp8 = ACPI_TPM2_RESERVED;
1650*35786f68SRobert Mustacchi             }
1651*35786f68SRobert Mustacchi 
1652*35786f68SRobert Mustacchi             AcpiOsPrintf (UINT8_FORMAT, *Target,
1653*35786f68SRobert Mustacchi                 AcpiDmTpm2Subnames[Temp8]);
1654*35786f68SRobert Mustacchi             break;
1655*35786f68SRobert Mustacchi 
1656*35786f68SRobert Mustacchi 
1657bc36eafdSMike Gerdts         case ACPI_DMT_FADTPM:
1658bc36eafdSMike Gerdts 
1659bc36eafdSMike Gerdts             /* FADT Preferred PM Profile names */
1660bc36eafdSMike Gerdts 
1661bc36eafdSMike Gerdts             Temp8 = *Target;
1662bc36eafdSMike Gerdts             if (Temp8 > ACPI_FADT_PM_RESERVED)
1663bc36eafdSMike Gerdts             {
1664bc36eafdSMike Gerdts                 Temp8 = ACPI_FADT_PM_RESERVED;
1665bc36eafdSMike Gerdts             }
1666bc36eafdSMike Gerdts 
1667bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target,
1668bc36eafdSMike Gerdts                 AcpiDmFadtProfiles[Temp8]);
1669bc36eafdSMike Gerdts             break;
1670bc36eafdSMike Gerdts 
1671bc36eafdSMike Gerdts         case ACPI_DMT_IVRS:
1672bc36eafdSMike Gerdts 
1673bc36eafdSMike Gerdts             /* IVRS subtable types */
1674bc36eafdSMike Gerdts 
1675bc36eafdSMike Gerdts             Temp8 = *Target;
1676bc36eafdSMike Gerdts             switch (Temp8)
1677bc36eafdSMike Gerdts             {
1678bc36eafdSMike Gerdts             case ACPI_IVRS_TYPE_HARDWARE:
1679bc36eafdSMike Gerdts 
1680bc36eafdSMike Gerdts                 Name = AcpiDmIvrsSubnames[0];
1681bc36eafdSMike Gerdts                 break;
1682bc36eafdSMike Gerdts 
1683bc36eafdSMike Gerdts             case ACPI_IVRS_TYPE_MEMORY1:
1684bc36eafdSMike Gerdts             case ACPI_IVRS_TYPE_MEMORY2:
1685bc36eafdSMike Gerdts             case ACPI_IVRS_TYPE_MEMORY3:
1686bc36eafdSMike Gerdts 
1687bc36eafdSMike Gerdts                 Name = AcpiDmIvrsSubnames[1];
1688bc36eafdSMike Gerdts                 break;
1689bc36eafdSMike Gerdts 
1690bc36eafdSMike Gerdts             default:
1691bc36eafdSMike Gerdts 
1692bc36eafdSMike Gerdts                 Name = AcpiDmIvrsSubnames[2];
1693bc36eafdSMike Gerdts                 break;
1694bc36eafdSMike Gerdts             }
1695bc36eafdSMike Gerdts 
1696bc36eafdSMike Gerdts             AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
1697bc36eafdSMike Gerdts             break;
1698bc36eafdSMike Gerdts 
1699bc36eafdSMike Gerdts         case ACPI_DMT_LPIT:
1700bc36eafdSMike Gerdts 
1701bc36eafdSMike Gerdts             /* LPIT subtable types */
1702bc36eafdSMike Gerdts 
1703bc36eafdSMike Gerdts             Temp32 = ACPI_GET32 (Target);
1704bc36eafdSMike Gerdts             if (Temp32 > ACPI_LPIT_TYPE_RESERVED)
1705bc36eafdSMike Gerdts             {
1706bc36eafdSMike Gerdts                 Temp32 = ACPI_LPIT_TYPE_RESERVED;
1707bc36eafdSMike Gerdts             }
1708bc36eafdSMike Gerdts 
1709bc36eafdSMike Gerdts             AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),
1710bc36eafdSMike Gerdts                 AcpiDmLpitSubnames[Temp32]);
1711bc36eafdSMike Gerdts             break;
1712bc36eafdSMike Gerdts 
1713bc36eafdSMike Gerdts         case ACPI_DMT_EXIT:
1714bc36eafdSMike Gerdts 
1715bc36eafdSMike Gerdts             return (AE_OK);
1716bc36eafdSMike Gerdts 
1717bc36eafdSMike Gerdts         default:
1718bc36eafdSMike Gerdts 
1719bc36eafdSMike Gerdts             ACPI_ERROR ((AE_INFO,
1720bc36eafdSMike Gerdts                 "**** Invalid table opcode [0x%X] ****\n", Info->Opcode));
1721bc36eafdSMike Gerdts             return (AE_SUPPORT);
1722bc36eafdSMike Gerdts         }
1723bc36eafdSMike Gerdts     }
1724bc36eafdSMike Gerdts 
1725bc36eafdSMike Gerdts     if (TableOffset && !SubtableLength)
1726bc36eafdSMike Gerdts     {
1727bc36eafdSMike Gerdts         /*
1728bc36eafdSMike Gerdts          * If this table is not the main table, the subtable must have a
1729bc36eafdSMike Gerdts          * valid length
1730bc36eafdSMike Gerdts          */
1731bc36eafdSMike Gerdts         AcpiOsPrintf ("Invalid zero length subtable\n");
1732bc36eafdSMike Gerdts         return (AE_BAD_DATA);
1733bc36eafdSMike Gerdts     }
1734bc36eafdSMike Gerdts 
1735bc36eafdSMike Gerdts     return (AE_OK);
1736bc36eafdSMike Gerdts }
1737