xref: /freebsd/sys/contrib/dev/acpica/common/dmtable.c (revision 07c64d74917e7c8ca61c77413dbd533390e7dca7)
1 /******************************************************************************
2  *
3  * Module Name: dmtable - Support for ACPI tables that contain no AML code
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2023, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
16  * 2.1. This is your license from Intel Corp. under its intellectual property
17  * rights. You may have additional license terms from the party that provided
18  * you this software, covering your right to use that party's intellectual
19  * property rights.
20  *
21  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22  * copy of the source code appearing in this file ("Covered Code") an
23  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24  * base code distributed originally by Intel ("Original Intel Code") to copy,
25  * make derivatives, distribute, use and display any portion of the Covered
26  * Code in any form, with the right to sublicense such rights; and
27  *
28  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29  * license (with the right to sublicense), under only those claims of Intel
30  * patents that are infringed by the Original Intel Code, to make, use, sell,
31  * offer to sell, and import the Covered Code and derivative works thereof
32  * solely to the minimum extent necessary to exercise the above copyright
33  * license, and in no event shall the patent license extend to any additions
34  * to or modifications of the Original Intel Code. No other license or right
35  * is granted directly or by implication, estoppel or otherwise;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
42  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43  * Redistribution of source code of any substantial portion of the Covered
44  * Code or modification with rights to further distribute source must include
45  * the above Copyright Notice, the above License, this list of Conditions,
46  * and the following Disclaimer and Export Compliance provision. In addition,
47  * Licensee must cause all Covered Code to which Licensee contributes to
48  * contain a file documenting the changes Licensee made to create that Covered
49  * Code and the date of any change. Licensee must include in that file the
50  * documentation of any changes made by any predecessor Licensee. Licensee
51  * must include a prominent statement that the modification is derived,
52  * directly or indirectly, from Original Intel Code.
53  *
54  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55  * Redistribution of source code of any substantial portion of the Covered
56  * Code or modification without rights to further distribute source must
57  * include the following Disclaimer and Export Compliance provision in the
58  * documentation and/or other materials provided with distribution. In
59  * addition, Licensee may not authorize further sublicense of source of any
60  * portion of the Covered Code, and must include terms to the effect that the
61  * license from Licensee to its licensee is limited to the intellectual
62  * property embodied in the software Licensee provides to its licensee, and
63  * not to intellectual property embodied in modifications its licensee may
64  * make.
65  *
66  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67  * substantial portion of the Covered Code or modification must reproduce the
68  * above Copyright Notice, and the following Disclaimer and Export Compliance
69  * provision in the documentation and/or other materials provided with the
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
75  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76  * Intel shall be used in advertising or otherwise to promote the sale, use or
77  * other dealings in products derived from or relating to the Covered Code
78  * without prior written authorization from Intel.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
82  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88  * PARTICULAR PURPOSE.
89  *
90  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97  * LIMITED REMEDY.
98  *
99  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100  * software or system incorporating such software without first obtaining any
101  * required license or other approval from the U. S. Department of Commerce or
102  * any other agency or department of the United States Government. In the
103  * event Licensee exports any such software from the United States or
104  * re-exports any such software from a foreign destination, Licensee shall
105  * ensure that the distribution and export/re-export of the software is in
106  * compliance with all laws, regulations, orders, or other restrictions of the
107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108  * any of its subsidiaries will export/re-export any technical data, process,
109  * software, or service, directly or indirectly, to any country for which the
110  * United States government or any agency thereof requires an export license,
111  * other governmental approval, or letter of assurance, without first obtaining
112  * such license, approval or letter.
113  *
114  *****************************************************************************
115  *
116  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #include <contrib/dev/acpica/include/acpi.h>
153 #include <contrib/dev/acpica/include/accommon.h>
154 #include <contrib/dev/acpica/include/acdisasm.h>
155 #include <contrib/dev/acpica/include/actables.h>
156 #include <contrib/dev/acpica/compiler/aslcompiler.h>
157 
158 /* This module used for application-level code only */
159 
160 #define _COMPONENT          ACPI_CA_DISASSEMBLER
161         ACPI_MODULE_NAME    ("dmtable")
162 
163 const AH_TABLE *
164 AcpiAhGetTableInfo (
165     char                    *Signature);
166 
167 
168 /* Common format strings for commented values */
169 
170 #define UINT8_FORMAT            "%2.2X [%s]\n"
171 #define UINT8_FORMAT_NO_NEWLINE "%2.2X [%s]"
172 #define UINT16_FORMAT           "%4.4X [%s]\n"
173 #define UINT32_FORMAT           "%8.8X [%s]\n"
174 #define STRING_FORMAT           "[%s]\n"
175 
176 /* These tables map a subtable type to a description string */
177 
178 static const char           *AcpiDmAestResourceNames[] =
179 {
180     "Cache Resource",
181     "TLB Resource",
182     "Generic Resource",
183     "Unknown Resource Type"         /* Reserved */
184 };
185 
186 static const char           *AcpiDmAestSubnames[] =
187 {
188     "Processor Error Node",
189     "Memory Error Node",
190     "SMMU Error Node",
191     "Vendor-defined Error Node",
192     "GIC Error Node",
193     "Unknown Subtable Type"         /* Reserved */
194 };
195 
196 static const char           *AcpiDmAestCacheNames[] =
197 {
198     "Data Cache",
199     "Instruction Cache",
200     "Unified Cache",
201     "Unknown Cache Type"            /* Reserved */
202 };
203 
204 static const char           *AcpiDmAestGicNames[] =
205 {
206     "GIC CPU",
207     "GIC Distributor",
208     "GIC Redistributor",
209     "GIC ITS",
210     "Unknown GIC Interface Type"    /* Reserved */
211 };
212 
213 static const char           *AcpiDmAestXfaceNames[] =
214 {
215     "System Register Interface",
216     "Memory Mapped Interface",
217     "Unknown Interface Type"        /* Reserved */
218 };
219 
220 static const char           *AcpiDmAestXruptNames[] =
221 {
222     "Fault Handling Interrupt",
223     "Error Recovery Interrupt",
224     "Unknown Interrupt Type"        /* Reserved */
225 };
226 
227 static const char           *AcpiDmAsfSubnames[] =
228 {
229     "ASF Information",
230     "ASF Alerts",
231     "ASF Remote Control",
232     "ASF RMCP Boot Options",
233     "ASF Address",
234     "Unknown Subtable Type"         /* Reserved */
235 };
236 
237 static const char           *AcpiDmAsptSubnames[] =
238 {
239     "ASPT Global Registers",
240     "ASPT SEV Mailbox Registers",
241     "ASPT ACPI Mailbox Registers",
242     "Unknown Subtable Type"         /* Reserved */
243 };
244 
245 static const char           *AcpiDmCdatSubnames[] =
246 {
247     "Device Scoped Memory Affinity Structure (DSMAS)",
248     "Device scoped Latency and Bandwidth Information Structure (DSLBIS)",
249     "Device Scoped Memory Side Cache Information Structure (DSMSCIS)",
250     "Device Scoped Initiator Structure (DSIS)",
251     "Device Scoped EFI Memory Type Structure (DSEMTS)",
252     "Switch Scoped Latency and Bandwidth Information Structure (SSLBIS)",
253     "Unknown Subtable Type"         /* Reserved */
254 };
255 
256 static const char           *AcpiDmCedtSubnames[] =
257 {
258     "CXL Host Bridge Structure",
259     "CXL Fixed Memory Window Structure",
260     "Unknown Subtable Type"         /* Reserved */
261 };
262 
263 static const char           *AcpiDmDmarSubnames[] =
264 {
265     "Hardware Unit Definition",
266     "Reserved Memory Region",
267     "Root Port ATS Capability",
268     "Remapping Hardware Static Affinity",
269     "ACPI Namespace Device Declaration",
270     "SoC Integrated Address Translation Cache",
271     "Unknown Subtable Type"         /* Reserved */
272 };
273 
274 static const char           *AcpiDmDmarScope[] =
275 {
276     "Reserved value",
277     "PCI Endpoint Device",
278     "PCI Bridge Device",
279     "IOAPIC Device",
280     "Message-capable HPET Device",
281     "Namespace Device",
282     "Unknown Scope Type"            /* Reserved */
283 };
284 
285 static const char           *AcpiDmEinjActions[] =
286 {
287     "Begin Operation",
288     "Get Trigger Table",
289     "Set Error Type",
290     "Get Error Type",
291     "End Operation",
292     "Execute Operation",
293     "Check Busy Status",
294     "Get Command Status",
295     "Set Error Type With Address",
296     "Get Execute Timings",
297     "Unknown Action"
298 };
299 
300 static const char           *AcpiDmEinjInstructions[] =
301 {
302     "Read Register",
303     "Read Register Value",
304     "Write Register",
305     "Write Register Value",
306     "Noop",
307     "Flush Cacheline",
308     "Unknown Instruction"
309 };
310 
311 static const char           *AcpiDmErstActions[] =
312 {
313     "Begin Write Operation",
314     "Begin Read Operation",
315     "Begin Clear Operation",
316     "End Operation",
317     "Set Record Offset",
318     "Execute Operation",
319     "Check Busy Status",
320     "Get Command Status",
321     "Get Record Identifier",
322     "Set Record Identifier",
323     "Get Record Count",
324     "Begin Dummy Write",
325     "Unused/Unknown Action",
326     "Get Error Address Range",
327     "Get Error Address Length",
328     "Get Error Attributes",
329     "Execute Timings",
330     "Unknown Action"
331 };
332 
333 static const char           *AcpiDmErstInstructions[] =
334 {
335     "Read Register",
336     "Read Register Value",
337     "Write Register",
338     "Write Register Value",
339     "Noop",
340     "Load Var1",
341     "Load Var2",
342     "Store Var1",
343     "Add",
344     "Subtract",
345     "Add Value",
346     "Subtract Value",
347     "Stall",
348     "Stall While True",
349     "Skip Next If True",
350     "GoTo",
351     "Set Source Address",
352     "Set Destination Address",
353     "Move Data",
354     "Unknown Instruction"
355 };
356 
357 static const char           *AcpiDmGtdtSubnames[] =
358 {
359     "Generic Timer Block",
360     "Generic Watchdog Timer",
361     "Unknown Subtable Type"         /* Reserved */
362 };
363 
364 static const char           *AcpiDmHestSubnames[] =
365 {
366     "IA-32 Machine Check Exception",
367     "IA-32 Corrected Machine Check",
368     "IA-32 Non-Maskable Interrupt",
369     "Unknown Subtable Type",        /* 3 - Reserved */
370     "Unknown Subtable Type",        /* 4 - Reserved */
371     "Unknown Subtable Type",        /* 5 - Reserved */
372     "PCI Express Root Port AER",
373     "PCI Express AER (AER Endpoint)",
374     "PCI Express/PCI-X Bridge AER",
375     "Generic Hardware Error Source",
376     "Generic Hardware Error Source V2",
377     "IA-32 Deferred Machine Check",
378     "Unknown Subtable Type"         /* Reserved */
379 };
380 
381 static const char           *AcpiDmHestNotifySubnames[] =
382 {
383     "Polled",
384     "External Interrupt",
385     "Local Interrupt",
386     "SCI",
387     "NMI",
388     "CMCI",                         /* ACPI 5.0 */
389     "MCE",                          /* ACPI 5.0 */
390     "GPIO",                         /* ACPI 6.0 */
391     "SEA",                          /* ACPI 6.1 */
392     "SEI",                          /* ACPI 6.1 */
393     "GSIV",                         /* ACPI 6.1 */
394     "Software Delegated Exception", /* ACPI 6.2 */
395     "Unknown Notify Type"           /* Reserved */
396 };
397 
398 static const char           *AcpiDmHmatSubnames[] =
399 {
400     "Memory Proximity Domain Attributes",
401     "System Locality Latency and Bandwidth Information",
402     "Memory Side Cache Information",
403     "Unknown Structure Type"         /* Reserved */
404 };
405 
406 static const char           *AcpiDmMadtSubnames[] =
407 {
408     "Processor Local APIC",             /* ACPI_MADT_TYPE_LOCAL_APIC */
409     "I/O APIC",                         /* ACPI_MADT_TYPE_IO_APIC */
410     "Interrupt Source Override",        /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
411     "NMI Source",                       /* ACPI_MADT_TYPE_NMI_SOURCE */
412     "Local APIC NMI",                   /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
413     "Local APIC Address Override",      /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
414     "I/O SAPIC",                        /* ACPI_MADT_TYPE_IO_SAPIC */
415     "Local SAPIC",                      /* ACPI_MADT_TYPE_LOCAL_SAPIC */
416     "Platform Interrupt Sources",       /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
417     "Processor Local x2APIC",           /* ACPI_MADT_TYPE_LOCAL_X2APIC */
418     "Local x2APIC NMI",                 /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
419     "Generic Interrupt Controller",     /* ACPI_MADT_GENERIC_INTERRUPT */
420     "Generic Interrupt Distributor",    /* ACPI_MADT_GENERIC_DISTRIBUTOR */
421     "Generic MSI Frame",                /* ACPI_MADT_GENERIC_MSI_FRAME */
422     "Generic Interrupt Redistributor",  /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
423     "Generic Interrupt Translator",     /* ACPI_MADT_GENERIC_TRANSLATOR */
424     "Mutiprocessor Wakeup",             /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */
425     "CPU Core Interrupt Controller",    /* ACPI_MADT_TYPE_CORE_PIC */
426     "Legacy I/O Interrupt Controller",  /* ACPI_MADT_TYPE_LIO_PIC */
427     "HT Interrupt Controller",          /* ACPI_MADT_TYPE_HT_PIC */
428     "Extend I/O Interrupt Controller",  /* ACPI_MADT_TYPE_EIO_PIC */
429     "MSI Interrupt Controller",         /* ACPI_MADT_TYPE_MSI_PIC */
430     "Bridge I/O Interrupt Controller",  /* ACPI_MADT_TYPE_BIO_PIC */
431     "LPC Interrupt Controller",         /* ACPI_MADT_TYPE_LPC_PIC */
432     "RISC-V Interrupt Controller",      /* ACPI_MADT_TYPE_RINTC */
433     "RISC-V Incoming MSI Controller",   /* ACPI_MADT_TYPE_IMSIC */
434     "RISC-V APLIC Controller",          /* ACPI_MADT_TYPE_APLIC */
435     "RISC-V PLIC Controller",           /* ACPI_MADT_TYPE_PLIC */
436     "Unknown Subtable Type",            /* Reserved */
437     "Types 80-FF are used for OEM data" /* Reserved for OEM data */
438 };
439 
440 static const char           *AcpiDmMpamSubnames[] =
441 {
442     "Processor cache",      /* ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE */
443     "Memory",               /* ACPI_MPAM_LOCATION_TYPE_MEMORY */
444     "SMMU",                 /* ACPI_MPAM_LOCATION_TYPE_SMMU */
445     "Memory-side cache",    /* ACPI_MPAM_LOCATION_TYPE_MEMORY_CACHE */
446     "ACPI device",          /* ACPI_MPAM_LOCATION_TYPE_ACPI_DEVICE */
447     "Interconnect",         /* ACPI_MPAM_LOCATION_TYPE_INTERCONNECT */
448     "Unknown"               /* ACPI_MPAM_LOCATION_TYPE_UNKNOWN */
449 };
450 
451 static const char           *AcpiDmNfitSubnames[] =
452 {
453     "System Physical Address Range",    /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */
454     "Memory Range Map",                 /* ACPI_NFIT_TYPE_MEMORY_MAP */
455     "Interleave Info",                  /* ACPI_NFIT_TYPE_INTERLEAVE */
456     "SMBIOS Information",               /* ACPI_NFIT_TYPE_SMBIOS */
457     "NVDIMM Control Region",            /* ACPI_NFIT_TYPE_CONTROL_REGION */
458     "NVDIMM Block Data Window Region",  /* ACPI_NFIT_TYPE_DATA_REGION */
459     "Flush Hint Address",               /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */
460     "Platform Capabilities",            /* ACPI_NFIT_TYPE_CAPABILITIES */
461     "Unknown Subtable Type"             /* Reserved */
462 };
463 
464 static const char           *AcpiDmNhltLinkTypeNames[] =
465 {
466     "Reserved for HD-Audio",            /* ACPI_NHLT_RESERVED_HD_AUDIO */
467     "Reserved for DSP",                 /* ACPI_NHLT_RESERVED_DSP */
468     "Type PDM",                         /* ACPI_NHLT_PDM */
469     "Type SSP",                         /* ACPI_NHLT_SSP */
470     "Reserved for SlimBus",             /* ACPI_NHLT_RESERVED_SLIMBUS */
471     "Reserved for SoundWire",           /* ACPI_NHLT_RESERVED_SOUNDWIRE */
472     "Unknown Link Type"                 /* Reserved */
473 };
474 
475 static const char           *AcpiDmNhltDirectionNames[] =
476 {
477     "Render",                           /* ACPI_NHLT_DIR_RENDER */
478     "Capture",                          /* ACPI_NHLT_DIR_CAPTURE */
479     "Render with Loopback",             /* ACPI_NHLT_DIR_RENDER_LOOPBACK */
480     "Feedback for Render",              /* ACPI_NHLT_DIR_RENDER_FEEDBACK */
481     "Unknown Direction"                 /* Reserved */
482 };
483 
484 static const char           *AcpiDmNhltMicTypeNames[] =
485 {
486     "Omnidirectional",                  /* ACPI_NHLT_MIC_OMNIDIRECTIONAL */
487     "Subcardioid",                      /* ACPI_NHLT_MIC_SUBCARDIOID */
488     "Cardioid",                         /* ACPI_NHLT_MIC_CARDIOID */
489     "SuperCardioid",                    /* ACPI_NHLT_MIC_SUPER_CARDIOID */
490     "HyperCardioid",                    /* ACPI_NHLT_MIC_HYPER_CARDIOID */
491     "8 Shaped",                         /* ACPI_NHLT_MIC_8_SHAPED */
492     "Reserved Mic Type",                /* Reserved */
493     "Vendor Defined",                   /* ACPI_NHLT_MIC_VENDOR_DEFINED */
494     "Unknown Mic Type"                  /* ACPI_NHLT_MIC_RESERVED */
495 };
496 
497 static const char           *AcpiDmNhltMicPositionNames[] =
498 {
499     "Top",                              /* ACPI_NHLT_MIC_POSITION_TOP */
500     "Bottom",                           /* ACPI_NHLT_MIC_POSITION_BOTTOM */
501     "Left",                             /* ACPI_NHLT_MIC_POSITION_LEFT */
502     "Right",                            /* ACPI_NHLT_MIC_POSITION_RIGHT */
503     "Front",                            /* ACPI_NHLT_MIC_POSITION_FRONT */
504     "Back",                             /* ACPI_NHLT_MIC_POSITION_BACK */
505     "Unknown Mic Position"              /* 6 and above are reserved */
506 };
507 
508 static const char           *AcpiDmNhltMicArrayTypeNames[] =
509 {
510     "Unknown Array Type",               /* ACPI_NHLT_ARRAY_TYPE_RESERVED */
511     "Small Linear 2-element",           /* ACPI_NHLT_SMALL_LINEAR_2ELEMENT */
512     "Big Linear 2-element",             /* ACPI_NHLT_BIG_LINEAR_2ELEMENT */
513     "Linear 4-element 1st Geometry",    /* ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT */
514     "Planar L-shaped 4-element",        /* ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT */
515     "Linear 4-element 2nd Geometry",    /* ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT */
516     "Vendor Defined"                    /* ACPI_NHLT_VENDOR_DEFINED */
517 };
518 
519 static const char           *AcpiDmNhltConfigTypeNames[] =
520 {
521     "Generic Type",                     /* ACPI_NHLT_CONFIG_TYPE_GENERIC */
522     "Microphone Array",                 /* ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY */
523     "Reserved",                         /* ACPI_NHLT_CONFIG_TYPE_RESERVED */
524     "Render Feedback",                  /* ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK */
525     "Unknown Config Type"               /* ACPI_NHLT_CONFIG_TYPE_RESERVED */
526 };
527 
528 static const char           *AcpiDmPcctSubnames[] =
529 {
530     "Generic Communications Subspace",  /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
531     "HW-Reduced Comm Subspace",         /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
532     "HW-Reduced Comm Subspace Type2",   /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */
533     "Extended PCC Master Subspace",     /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */
534     "Extended PCC Slave Subspace",      /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */
535     "HW Registers based Comm Subspace", /* ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE */
536     "Unknown Subtable Type"             /* Reserved */
537 };
538 
539 static const char           *AcpiDmPhatSubnames[] =
540 {
541     "Firmware Version Data",        /* ACPI_PHAT_TYPE_FW_VERSION_DATA */
542     "Firmware Health Data",         /* ACPI_PHAT_TYPE_FW_HEALTH_DATA */
543     "Unknown Subtable Type"         /* Reserved */
544 };
545 
546 static const char           *AcpiDmPmttSubnames[] =
547 {
548     "Socket",                       /* ACPI_PMTT_TYPE_SOCKET */
549     "Memory Controller",            /* ACPI_PMTT_TYPE_CONTROLLER */
550     "Physical Component (DIMM)",    /* ACPI_PMTT_TYPE_DIMM */
551     "Unknown Subtable Type",        /* Reserved */
552     "Vendor Specific"               /* ACPI_PMTT_TYPE_VENDOR */
553 };
554 
555 static const char           *AcpiDmPpttSubnames[] =
556 {
557     "Processor Hierarchy Node",     /* ACPI_PPTT_TYPE_PROCESSOR */
558     "Cache Type",                   /* ACPI_PPTT_TYPE_CACHE */
559     "ID",                           /* ACPI_PPTT_TYPE_ID */
560     "Unknown Subtable Type"         /* Reserved */
561 };
562 
563 static const char           *AcpiDmRgrtSubnames[] =
564 {
565     "Unknown/Reserved Image Type",  /* ACPI_RGRT_TYPE_RESERVED0 */
566     "Type PNG"                      /* ACPI_RGRT_IMAGE_TYPE_PNG */
567 };
568 
569 static const char           *AcpiDmSdevSubnames[] =
570 {
571     "Namespace Device",             /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */
572     "PCIe Endpoint Device",         /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */
573     "Unknown Subtable Type"         /* Reserved */
574 };
575 
576 static const char           *AcpiDmSratSubnames[] =
577 {
578     "Processor Local APIC/SAPIC Affinity",
579     "Memory Affinity",
580     "Processor Local x2APIC Affinity",
581     "GICC Affinity",
582     "GIC ITS Affinity",             /* Acpi 6.2 */
583     "Generic Initiator Affinity",   /* Acpi 6.3 */
584     "Generic Port Affinity",        /* Acpi 6.4 */
585     "Unknown Subtable Type"         /* Reserved */
586 };
587 
588 static const char           *AcpiDmTpm2Subnames[] =
589 {
590     "Illegal Start Method value",
591     "Reserved",
592     "ACPI Start Method",
593     "Reserved",
594     "Reserved",
595     "Reserved",
596     "Memory Mapped I/O",
597     "Command Response Buffer",
598     "Command Response Buffer with ACPI Start Method",
599     "Reserved",
600     "Reserved",
601     "Command Response Buffer with ARM SMC",
602     "Unknown Subtable Type"         /* Reserved */
603 };
604 
605 static const char           *AcpiDmIvrsSubnames[] =
606 {
607     "Hardware Definition Block (IVHD)",
608     "Hardware Definition Block - Mixed Format (IVHD)",
609     "Memory Definition Block (IVMD)",
610     "Unknown/Reserved Subtable Type"            /* Reserved */
611 };
612 
613 static const char           *AcpiDmIvrsDevEntryNames[] =
614 {
615     "Unknown/Reserved Device Entry Type",       /* 0- Reserved */
616     "Device Entry: Select All Devices",         /* 1 */
617     "Device Entry: Select One Device",          /* 2 */
618     "Device Entry: Start of Range",             /* 3 */
619     "Device Entry: End of Range",               /* 4 */
620     "Device Entry: Alias Select",               /* 66 */
621     "Device Entry: Alias Start of Range",       /* 67 */
622     "Unknown/Reserved Device Entry Type",       /* 68- Reserved */
623     "Unknown/Reserved Device Entry Type",       /* 69- Reserved */
624     "Device Entry: Extended Select",            /* 70 */
625     "Device Entry: Extended Start of Range",    /* 71 */
626     "Device Entry: Special Device",             /* 72 */
627     "Device Entry: ACPI HID Named Device",      /* 240 */
628     "Unknown/Reserved Device Entry Type"        /* Reserved */
629 };
630 
631 static const char           *AcpiDmLpitSubnames[] =
632 {
633     "Native C-state Idle Structure",
634     "Unknown Subtable Type"         /* Reserved */
635 };
636 
637 static const char           *AcpiDmViotSubnames[] =
638 {
639     "Unknown Subtable Type",        /* 0 -Reserved */
640     "PCI Range",
641     "MMIO Endpoint",
642     "VirtIO-PCI IOMMU",
643     "VirtIO-MMIO IOMMU",
644     "Unknown Subtable Type"         /* Reserved */
645 };
646 
647 #define ACPI_FADT_PM_RESERVED       9
648 
649 static const char           *AcpiDmFadtProfiles[] =
650 {
651     "Unspecified",
652     "Desktop",
653     "Mobile",
654     "Workstation",
655     "Enterprise Server",
656     "SOHO Server",
657     "Appliance PC",
658     "Performance Server",
659     "Tablet",
660     "Unknown Profile Type"
661 };
662 
663 #define ACPI_GAS_WIDTH_RESERVED     5
664 
665 static const char           *AcpiDmGasAccessWidth[] =
666 {
667     "Undefined/Legacy",
668     "Byte Access:8",
669     "Word Access:16",
670     "DWord Access:32",
671     "QWord Access:64",
672     "Unknown Width Encoding"
673 };
674 
675 static const char           *AcpiDmRhctSubnames[] =
676 {
677     "RISC-V ISA string structure",  /* ACPI_RHCT_ISA_STRING */
678     "RISC-V CMO node structure",    /* ACPI_RHCT_CMO_NODE */
679     "RISC-V MMU node structure",    /* ACPI_RHCT_MMU_NODE */
680     "RISC-V Hart Info structure",   /* ACPI_RHCT_HART_INFO */
681 };
682 
683 
684 /*******************************************************************************
685  *
686  * ACPI Table Data, indexed by signature.
687  *
688  * Each entry contains: Signature, Table Info, Handler, DtHandler,
689  *  Template, Description
690  *
691  * Simple tables have only a TableInfo structure, complex tables have a
692  * handler. This table must be NULL terminated. RSDP and FACS are
693  * special-cased elsewhere.
694  *
695  * Note: Any tables added here should be duplicated within
696  * AcpiGbl_SupportedTables in the file common/ahtable.c
697  *
698  ******************************************************************************/
699 
700 const ACPI_DMTABLE_DATA     AcpiDmTableData[] =
701 {
702     {ACPI_SIG_AEST, NULL,                   AcpiDmDumpAest, DtCompileAest,  TemplateAest},
703     {ACPI_SIG_AGDI, AcpiDmTableInfoAgdi,    NULL,           NULL,           TemplateAgdi},
704     {ACPI_SIG_APMT, NULL,                   AcpiDmDumpApmt, DtCompileApmt,  TemplateApmt},
705     {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf},
706     {ACPI_SIG_ASPT, NULL,                   AcpiDmDumpAspt, DtCompileAspt,  TemplateAspt},
707     {ACPI_SIG_BDAT, AcpiDmTableInfoBdat,    NULL,           NULL,           TemplateBdat},
708     {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert},
709     {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt},
710     {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot},
711     {ACPI_SIG_CCEL, AcpiDmTableInfoCcel,    NULL,           NULL,           TemplateCcel},
712     {ACPI_SIG_CDAT, NULL,                   AcpiDmDumpCdat, NULL,           TemplateCdat},
713     {ACPI_SIG_CEDT, NULL,                   AcpiDmDumpCedt, DtCompileCedt,  TemplateCedt},
714     {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep},
715     {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt},
716     {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2,    AcpiDmDumpDbg2, DtCompileDbg2,  TemplateDbg2},
717     {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp},
718     {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar},
719     {ACPI_SIG_DRTM, NULL,                   AcpiDmDumpDrtm, DtCompileDrtm,  TemplateDrtm},
720     {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt},
721     {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj},
722     {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst},
723     {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt},
724     {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt},
725     {ACPI_SIG_GTDT, NULL,                   AcpiDmDumpGtdt, DtCompileGtdt,  TemplateGtdt},
726     {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest},
727     {ACPI_SIG_HMAT, NULL,                   AcpiDmDumpHmat, DtCompileHmat,  TemplateHmat},
728     {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet},
729     {ACPI_SIG_IORT, NULL,                   AcpiDmDumpIort, DtCompileIort,  TemplateIort},
730     {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs},
731     {ACPI_SIG_LPIT, NULL,                   AcpiDmDumpLpit, DtCompileLpit,  TemplateLpit},
732     {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt},
733     {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg},
734     {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi},
735     {ACPI_SIG_MPAM, NULL,                   AcpiDmDumpMpam, DtCompileMpam,  TemplateMpam},
736     {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst},
737     {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct},
738     {ACPI_SIG_MSDM, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateMsdm},
739     {ACPI_SIG_NFIT, AcpiDmTableInfoNfit,    AcpiDmDumpNfit, DtCompileNfit,  TemplateNfit},
740     {ACPI_SIG_NHLT, AcpiDmTableInfoNhlt,    AcpiDmDumpNhlt, DtCompileNhlt,  TemplateNhlt},
741     {ACPI_SIG_PCCT, AcpiDmTableInfoPcct,    AcpiDmDumpPcct, DtCompilePcct,  TemplatePcct},
742     {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt,    AcpiDmDumpPdtt, DtCompilePdtt,  TemplatePdtt},
743     {ACPI_SIG_PHAT, NULL,                   AcpiDmDumpPhat, DtCompilePhat,  TemplatePhat},
744     {ACPI_SIG_PMTT, NULL,                   AcpiDmDumpPmtt, DtCompilePmtt,  TemplatePmtt},
745     {ACPI_SIG_PPTT, NULL,                   AcpiDmDumpPptt, DtCompilePptt,  TemplatePptt},
746     {ACPI_SIG_PRMT, NULL,                   AcpiDmDumpPrmt, DtCompilePrmt,  TemplatePrmt},
747     {ACPI_SIG_RASF, AcpiDmTableInfoRasf,    NULL,           NULL,           TemplateRasf},
748     {ACPI_SIG_RGRT, NULL,                   AcpiDmDumpRgrt, DtCompileRgrt,  TemplateRgrt},
749     {ACPI_SIG_RHCT, NULL,                   AcpiDmDumpRhct, DtCompileRhct,  TemplateRhct},
750     {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt},
751     {ACPI_SIG_S3PT, NULL,                   NULL,           NULL,           TemplateS3pt},
752     {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst},
753     {ACPI_SIG_SDEI, AcpiDmTableInfoSdei,    NULL,           NULL,           TemplateSdei},
754     {ACPI_SIG_SDEV, AcpiDmTableInfoSdev,    AcpiDmDumpSdev, DtCompileSdev,  TemplateSdev},
755     {ACPI_SIG_SLIC, NULL,                   AcpiDmDumpSlic, DtCompileSlic,  TemplateSlic},
756     {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit},
757     {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr},
758     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi},
759     {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat},
760     {ACPI_SIG_STAO, NULL,                   AcpiDmDumpStao, DtCompileStao,  TemplateStao},
761     {ACPI_SIG_SVKL, AcpiDmTableInfoSvkl,    AcpiDmDumpSvkl, DtCompileSvkl,  TemplateSvkl},
762     {ACPI_SIG_TCPA, NULL,                   AcpiDmDumpTcpa, DtCompileTcpa,  TemplateTcpa},
763     {ACPI_SIG_TDEL, AcpiDmTableInfoTdel,    NULL,           NULL,           TemplateTdel},
764     {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2,    AcpiDmDumpTpm2, DtCompileTpm2,  TemplateTpm2},
765     {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi},
766     {ACPI_SIG_VIOT, AcpiDmTableInfoViot,    AcpiDmDumpViot, DtCompileViot,  TemplateViot},
767     {ACPI_SIG_WAET, AcpiDmTableInfoWaet,    NULL,           NULL,           TemplateWaet},
768     {ACPI_SIG_WDAT, NULL,                   AcpiDmDumpWdat, DtCompileWdat,  TemplateWdat},
769     {ACPI_SIG_WDDT, AcpiDmTableInfoWddt,    NULL,           NULL,           TemplateWddt},
770     {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt,    NULL,           NULL,           TemplateWdrt},
771     {ACPI_SIG_WPBT, NULL,                   AcpiDmDumpWpbt, DtCompileWpbt,  TemplateWpbt},
772     {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt,    NULL,           NULL,           TemplateWsmt},
773     {ACPI_SIG_XENV, AcpiDmTableInfoXenv,    NULL,           NULL,           TemplateXenv},
774     {ACPI_SIG_XSDT, NULL,                   AcpiDmDumpXsdt, DtCompileXsdt,  TemplateXsdt},
775     {NULL,          NULL,                   NULL,           NULL,           NULL}
776 };
777 
778 
779 /*******************************************************************************
780  *
781  * FUNCTION:    AcpiDmGetTableData
782  *
783  * PARAMETERS:  Signature           - ACPI signature (4 chars) to match
784  *
785  * RETURN:      Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.
786  *
787  * DESCRIPTION: Find a match in the global table of supported ACPI tables
788  *
789  ******************************************************************************/
790 
791 const ACPI_DMTABLE_DATA *
AcpiDmGetTableData(char * Signature)792 AcpiDmGetTableData (
793     char                    *Signature)
794 {
795     const ACPI_DMTABLE_DATA *Info;
796 
797 
798     for (Info = AcpiDmTableData; Info->Signature; Info++)
799     {
800         if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature))
801         {
802             return (Info);
803         }
804     }
805 
806     return (NULL);
807 }
808 
809 
810 /*******************************************************************************
811  *
812  * FUNCTION:    AcpiDmDumpDataTable
813  *
814  * PARAMETERS:  Table               - An ACPI table
815  *
816  * RETURN:      None.
817  *
818  * DESCRIPTION: Format the contents of an ACPI data table (any table other
819  *              than an SSDT or DSDT that does not contain executable AML code)
820  *
821  ******************************************************************************/
822 
823 void
AcpiDmDumpDataTable(ACPI_TABLE_HEADER * Table)824 AcpiDmDumpDataTable (
825     ACPI_TABLE_HEADER       *Table)
826 {
827     ACPI_STATUS             Status;
828     const ACPI_DMTABLE_DATA *TableData;
829     UINT32                  Length;
830 
831 
832     /* Ignore tables that contain AML */
833 
834     if (AcpiUtIsAmlTable (Table))
835     {
836         if (AslGbl_VerboseTemplates)
837         {
838             /* Dump the raw table data */
839 
840             Length = Table->Length;
841 
842             AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
843                 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
844             AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
845                 Length, DB_BYTE_DISPLAY, 0);
846             AcpiOsPrintf (" */\n");
847         }
848         return;
849     }
850 
851     /*
852      * Handle tables that don't use the common ACPI table header structure.
853      * Currently, these are the FACS, RSDP, S3PT and CDAT.
854      */
855     if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
856     {
857         Length = Table->Length;
858         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
859         if (ACPI_FAILURE (Status))
860         {
861             return;
862         }
863     }
864     else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP,
865         Table)->Signature))
866     {
867         Length = AcpiDmDumpRsdp (Table);
868     }
869     else if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT))
870     {
871         Length = AcpiDmDumpS3pt (Table);
872     }
873     else if (!AcpiUtValidNameseg (Table->Signature))
874     {
875         /*
876          * For CDAT we are assuming that there should be at least one non-ASCII
877          * byte in the (normally) 4-character Signature field (at least the
878          * high-order byte should be zero).
879          */
880         if (AcpiGbl_CDAT)
881         {
882             /*
883              * Invalid signature and <-ds CDAT> was specified on the command line.
884              * Therefore, we have a CDAT table.
885              */
886             AcpiDmDumpCdat (Table);
887         }
888         else
889         {
890             fprintf (stderr, "Table has an invalid signature\n");
891         }
892 
893         return;
894     }
895     else
896     {
897         /*
898          * All other tables must use the common ACPI table header, dump it now
899          */
900         Length = Table->Length;
901         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
902         if (ACPI_FAILURE (Status))
903         {
904             return;
905         }
906         AcpiOsPrintf ("\n");
907 
908         /* Match signature and dispatch appropriately */
909 
910         TableData = AcpiDmGetTableData (Table->Signature);
911         if (!TableData)
912         {
913             if (!strncmp (Table->Signature, "OEM", 3))
914             {
915                 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
916                     Table->Signature);
917             }
918             else
919             {
920                 AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
921                     Table->Signature);
922 
923                 fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
924                     Table->Signature);
925 
926                 if (!AcpiGbl_ForceAmlDisassembly)
927                 {
928                     fprintf (stderr, "decoding ACPI table header only\n");
929                 }
930                 else
931                 {
932                     fprintf (stderr, "assuming table contains valid AML code\n");
933                 }
934             }
935         }
936         else if (TableData->TableHandler)
937         {
938             /* Complex table, has a handler */
939 
940             TableData->TableHandler (Table);
941         }
942         else if (TableData->TableInfo)
943         {
944             /* Simple table, just walk the info table */
945 
946             Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
947             if (ACPI_FAILURE (Status))
948             {
949                 return;
950             }
951         }
952     }
953 
954     if (!AslGbl_DoTemplates || AslGbl_VerboseTemplates)
955     {
956         /* Dump the raw table data */
957 
958         AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
959             ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
960         AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
961             Length, DB_BYTE_DISPLAY, 0);
962     }
963 }
964 
965 
966 /*******************************************************************************
967  *
968  * FUNCTION:    AcpiDmLineHeader
969  *
970  * PARAMETERS:  Offset              - Current byte offset, from table start
971  *              ByteLength          - Length of the field in bytes, 0 for flags
972  *              Name                - Name of this field
973  *
974  * RETURN:      None
975  *
976  * DESCRIPTION: Utility routines for formatting output lines. Displays the
977  *              current table offset in hex and decimal, the field length,
978  *              and the field name.
979  *
980  ******************************************************************************/
981 
982 void
AcpiDmLineHeader(UINT32 Offset,UINT32 ByteLength,char * Name)983 AcpiDmLineHeader (
984     UINT32                  Offset,
985     UINT32                  ByteLength,
986     char                    *Name)
987 {
988 
989     /* Allow a null name for fields that span multiple lines (large buffers) */
990 
991     if (!Name)
992     {
993         Name = "";
994     }
995 
996     if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */
997     {
998         if (ByteLength)
999         {
1000             AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
1001         }
1002         else
1003         {
1004             if (*Name)
1005             {
1006                 AcpiOsPrintf ("%41s : ", Name);
1007             }
1008             else
1009             {
1010                 AcpiOsPrintf ("%41s   ", Name);
1011             }
1012         }
1013     }
1014     else /* Normal disassembler or verbose template */
1015     {
1016         if (ByteLength)
1017         {
1018             AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %27s : ",
1019                 Offset, Offset, ByteLength, Name);
1020         }
1021         else
1022         {
1023             if (*Name)
1024             {
1025                 AcpiOsPrintf ("%44s : ", Name);
1026             }
1027             else
1028             {
1029                 AcpiOsPrintf ("%44s   ", Name);
1030             }
1031         }
1032     }
1033 }
1034 
1035 void
AcpiDmLineHeader2(UINT32 Offset,UINT32 ByteLength,char * Name,UINT32 Value)1036 AcpiDmLineHeader2 (
1037     UINT32                  Offset,
1038     UINT32                  ByteLength,
1039     char                    *Name,
1040     UINT32                  Value)
1041 {
1042 
1043     if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */
1044     {
1045         if (ByteLength)
1046         {
1047             AcpiOsPrintf ("[%.4d] %30s %3d : ",
1048                 ByteLength, Name, Value);
1049         }
1050         else
1051         {
1052             AcpiOsPrintf ("%36s % 3d : ",
1053                 Name, Value);
1054         }
1055     }
1056     else /* Normal disassembler or verbose template */
1057     {
1058         if (ByteLength)
1059         {
1060             AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %24s %3d : ",
1061                 Offset, Offset, ByteLength, Name, Value);
1062         }
1063         else
1064         {
1065             AcpiOsPrintf ("[%3.3Xh %4.4u   ] %24s %3d : ",
1066                 Offset, Offset, Name, Value);
1067         }
1068     }
1069 }
1070 
1071 
1072 /*******************************************************************************
1073  *
1074  * FUNCTION:    AcpiDmDumpTable
1075  *
1076  * PARAMETERS:  TableLength         - Length of the entire ACPI table
1077  *              TableOffset         - Starting offset within the table for this
1078  *                                    sub-descriptor (0 if main table)
1079  *              Table               - The ACPI table
1080  *              SubtableLength      - Length of this sub-descriptor
1081  *              Info                - Info table for this ACPI table
1082  *
1083  * RETURN:      Status
1084  *
1085  * DESCRIPTION: Display ACPI table contents by walking the Info table.
1086  *
1087  * Note: This function must remain in sync with DtGetFieldLength.
1088  *
1089  ******************************************************************************/
1090 
1091 ACPI_STATUS
AcpiDmDumpTable(UINT32 TableLength,UINT32 TableOffset,void * Table,UINT32 SubtableLength,ACPI_DMTABLE_INFO * Info)1092 AcpiDmDumpTable (
1093     UINT32                  TableLength,
1094     UINT32                  TableOffset,
1095     void                    *Table,
1096     UINT32                  SubtableLength,
1097     ACPI_DMTABLE_INFO       *Info)
1098 {
1099     UINT8                   *Target;
1100     UINT32                  CurrentOffset;
1101     UINT32                  ByteLength;
1102     UINT8                   Temp8;
1103     UINT16                  Temp16;
1104     UINT32                  Temp32;
1105     UINT64                  Value;
1106     const AH_TABLE          *TableData;
1107     const char              *Name;
1108     BOOLEAN                 LastOutputBlankLine = FALSE;
1109     ACPI_STATUS             Status;
1110     char                    RepairedName[8];
1111 
1112 
1113     if (!Info)
1114     {
1115         AcpiOsPrintf ("Display not implemented\n");
1116         return (AE_NOT_IMPLEMENTED);
1117     }
1118 
1119     /* Walk entire Info table; Null name terminates */
1120 
1121     for (; Info->Name; Info++)
1122     {
1123         /*
1124          * Target points to the field within the ACPI Table. CurrentOffset is
1125          * the offset of the field from the start of the main table.
1126          */
1127         Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
1128         CurrentOffset = TableOffset + Info->Offset;
1129 
1130         /* Check for beyond subtable end or (worse) beyond EOT */
1131 
1132         if (SubtableLength && (Info->Offset > SubtableLength))
1133         {
1134             AcpiOsPrintf (
1135                 "/**** ACPI subtable terminates early (Len %u) - "
1136                 "may be older version (dump table) */\n", SubtableLength);
1137 
1138             /* Move on to next subtable */
1139 
1140             return (AE_OK);
1141         }
1142 
1143         if (CurrentOffset >= TableLength)
1144         {
1145             AcpiOsPrintf (
1146                 "/**** ACPI table terminates "
1147                 "in the middle of a data structure! (dump table) \n"
1148                 "CurrentOffset: %X, TableLength: %X ***/", CurrentOffset, TableLength);
1149             return (AE_BAD_DATA);
1150         }
1151 
1152         /* Generate the byte length for this field */
1153 
1154         switch (Info->Opcode)
1155         {
1156         case ACPI_DMT_UINT8:
1157         case ACPI_DMT_CHKSUM:
1158         case ACPI_DMT_SPACEID:
1159         case ACPI_DMT_ACCWIDTH:
1160         case ACPI_DMT_CEDT:
1161         case ACPI_DMT_IVRS:
1162         case ACPI_DMT_IVRS_DE:
1163         case ACPI_DMT_GTDT:
1164         case ACPI_DMT_MADT:
1165         case ACPI_DMT_MPAM_LOCATOR:
1166         case ACPI_DMT_NHLT1:
1167         case ACPI_DMT_NHLT1a:
1168         case ACPI_DMT_NHLT1b:
1169         case ACPI_DMT_NHLT1c:
1170         case ACPI_DMT_NHLT1d:
1171         case ACPI_DMT_NHLT1f:
1172         case ACPI_DMT_PCCT:
1173         case ACPI_DMT_PMTT:
1174         case ACPI_DMT_PPTT:
1175         case ACPI_DMT_RGRT:
1176         case ACPI_DMT_SDEV:
1177         case ACPI_DMT_SRAT:
1178         case ACPI_DMT_AEST:
1179         case ACPI_DMT_AEST_RES:
1180         case ACPI_DMT_AEST_XFACE:
1181         case ACPI_DMT_AEST_XRUPT:
1182         case ACPI_DMT_ASF:
1183         case ACPI_DMT_CDAT:
1184         case ACPI_DMT_HESTNTYP:
1185         case ACPI_DMT_FADTPM:
1186         case ACPI_DMT_EINJACT:
1187         case ACPI_DMT_EINJINST:
1188         case ACPI_DMT_ERSTACT:
1189         case ACPI_DMT_ERSTINST:
1190         case ACPI_DMT_DMAR_SCOPE:
1191         case ACPI_DMT_VIOT:
1192 
1193             ByteLength = 1;
1194             break;
1195 
1196         case ACPI_DMT_ASPT:
1197         case ACPI_DMT_UINT16:
1198         case ACPI_DMT_DMAR:
1199         case ACPI_DMT_HEST:
1200         case ACPI_DMT_HMAT:
1201         case ACPI_DMT_NFIT:
1202         case ACPI_DMT_NHLT1e:
1203         case ACPI_DMT_PHAT:
1204         case ACPI_DMT_RHCT:
1205 
1206             ByteLength = 2;
1207             break;
1208 
1209         case ACPI_DMT_UINT24:
1210 
1211             ByteLength = 3;
1212             break;
1213 
1214         case ACPI_DMT_UINT32:
1215         case ACPI_DMT_AEST_CACHE:
1216         case ACPI_DMT_AEST_GIC:
1217         case ACPI_DMT_NAME4:
1218         case ACPI_DMT_SIG:
1219         case ACPI_DMT_LPIT:
1220         case ACPI_DMT_TPM2:
1221 
1222             ByteLength = 4;
1223             break;
1224 
1225         case ACPI_DMT_UINT40:
1226 
1227             ByteLength = 5;
1228             break;
1229 
1230         case ACPI_DMT_UINT48:
1231         case ACPI_DMT_NAME6:
1232 
1233             ByteLength = 6;
1234             break;
1235 
1236         case ACPI_DMT_UINT56:
1237         case ACPI_DMT_BUF7:
1238 
1239             ByteLength = 7;
1240             break;
1241 
1242         case ACPI_DMT_UINT64:
1243         case ACPI_DMT_NAME8:
1244 
1245             ByteLength = 8;
1246             break;
1247 
1248         case ACPI_DMT_BUF10:
1249 
1250             ByteLength = 10;
1251             break;
1252 
1253         case ACPI_DMT_BUF12:
1254 
1255             ByteLength = 12;
1256             break;
1257 
1258         case ACPI_DMT_BUF16:
1259         case ACPI_DMT_UUID:
1260 
1261             ByteLength = 16;
1262             break;
1263 
1264         case ACPI_DMT_BUF18:
1265 
1266             ByteLength = 18;
1267             break;
1268 
1269         case ACPI_DMT_BUF128:
1270 
1271             ByteLength = 128;
1272             break;
1273 
1274         case ACPI_DMT_WPBT_UNICODE:
1275 
1276             ByteLength = SubtableLength;
1277             CurrentOffset = sizeof (ACPI_TABLE_WPBT);
1278             break;
1279 
1280         case ACPI_DMT_UNICODE:
1281         case ACPI_DMT_BUFFER:
1282         case ACPI_DMT_RAW_BUFFER:
1283 
1284             ByteLength = SubtableLength;
1285             break;
1286 
1287         case ACPI_DMT_PMTT_VENDOR:
1288             /*
1289              * Calculate the length of the vendor data for the PMTT table:
1290              * Length = (Current Subtable ptr + Subtable length) -
1291              *          Start of the vendor data (Target)
1292              */
1293             ByteLength = ((ACPI_CAST_PTR (char, Table) +
1294                             (ACPI_CAST_PTR (ACPI_PMTT_HEADER, Table)->Length)) -
1295                             ACPI_CAST_PTR (char, Target));
1296             break;
1297 
1298         case ACPI_DMT_STRING:
1299 
1300             ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;
1301             break;
1302 
1303         case ACPI_DMT_IVRS_UNTERMINATED_STRING:
1304 
1305             ByteLength = ((ACPI_CAST_PTR (ACPI_IVRS_DEVICE_HID, Target) -1)->UidLength);
1306             break;
1307 
1308         case ACPI_DMT_GAS:
1309 
1310             if (!LastOutputBlankLine)
1311             {
1312                 AcpiOsPrintf ("\n");
1313                 LastOutputBlankLine = TRUE;
1314             }
1315 
1316             ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
1317             break;
1318 
1319         case ACPI_DMT_HESTNTFY:
1320 
1321             if (!LastOutputBlankLine)
1322             {
1323                 AcpiOsPrintf ("\n");
1324                 LastOutputBlankLine = TRUE;
1325             }
1326 
1327             ByteLength = sizeof (ACPI_HEST_NOTIFY);
1328             break;
1329 
1330         case ACPI_DMT_IORTMEM:
1331 
1332             if (!LastOutputBlankLine)
1333             {
1334                 LastOutputBlankLine = FALSE;
1335             }
1336 
1337             ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
1338             break;
1339 
1340         default:
1341 
1342             ByteLength = 0;
1343             break;
1344         }
1345 
1346         /* Check if we are beyond a subtable, or (worse) beyond EOT */
1347 
1348         if (CurrentOffset + ByteLength > TableLength)
1349         {
1350             if (SubtableLength)
1351             {
1352                 AcpiOsPrintf (
1353                     "/**** ACPI subtable terminates early - "
1354                     "may be older version (dump table) */\n");
1355 
1356                 /* Move on to next subtable */
1357 
1358                 return (AE_OK);
1359             }
1360 
1361             AcpiOsPrintf (
1362                 "/**** ACPI table terminates "
1363                 "in the middle of a data structure! */\n");
1364             return (AE_BAD_DATA);
1365         }
1366 
1367         if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)
1368         {
1369             AcpiOsPrintf ("%s", Info->Name);
1370             continue;
1371         }
1372 
1373         /* Start a new line and decode the opcode */
1374 
1375         AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
1376 
1377         switch (Info->Opcode)
1378         {
1379         /* Single-bit Flag fields. Note: Opcode is the bit position */
1380 
1381         case ACPI_DMT_FLAG0:
1382         case ACPI_DMT_FLAG1:
1383         case ACPI_DMT_FLAG2:
1384         case ACPI_DMT_FLAG3:
1385         case ACPI_DMT_FLAG4:
1386         case ACPI_DMT_FLAG5:
1387         case ACPI_DMT_FLAG6:
1388         case ACPI_DMT_FLAG7:
1389 
1390             AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);
1391             break;
1392 
1393         /* 2-bit Flag fields */
1394 
1395         case ACPI_DMT_FLAGS0:
1396 
1397             AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
1398             break;
1399 
1400         case ACPI_DMT_FLAGS1:
1401 
1402             AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);
1403             break;
1404 
1405         case ACPI_DMT_FLAGS2:
1406 
1407             AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
1408             break;
1409 
1410         case ACPI_DMT_FLAGS8_2:
1411 
1412             AcpiOsPrintf ("%2.2X\n", (*Target >> 2) & 0xFF);
1413             break;
1414 
1415         case ACPI_DMT_FLAGS4:
1416 
1417             AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);
1418             break;
1419 
1420         case ACPI_DMT_FLAGS4_0:
1421 
1422             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);
1423             break;
1424 
1425         case ACPI_DMT_FLAGS4_4:
1426 
1427             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);
1428             break;
1429 
1430         case ACPI_DMT_FLAGS4_8:
1431 
1432             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);
1433             break;
1434 
1435         case ACPI_DMT_FLAGS4_12:
1436 
1437             AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);
1438             break;
1439 
1440         case ACPI_DMT_FLAGS16_16:
1441 
1442             AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);
1443             break;
1444 
1445         /* Integer Data Types */
1446 
1447         case ACPI_DMT_UINT8:
1448         case ACPI_DMT_UINT16:
1449         case ACPI_DMT_UINT24:
1450         case ACPI_DMT_UINT32:
1451         case ACPI_DMT_UINT40:
1452         case ACPI_DMT_UINT48:
1453         case ACPI_DMT_UINT56:
1454         case ACPI_DMT_UINT64:
1455             /*
1456              * Dump bytes - high byte first, low byte last.
1457              * Note: All ACPI tables are little-endian.
1458              */
1459             Value = 0;
1460             for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
1461             {
1462                 AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
1463                 Value |= Target[Temp8 - 1];
1464                 Value <<= 8;
1465             }
1466 
1467             if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
1468             {
1469                 AcpiOsPrintf (" [Optional field not present]");
1470             }
1471 
1472             AcpiOsPrintf ("\n");
1473             break;
1474 
1475         case ACPI_DMT_BUF7:
1476         case ACPI_DMT_BUF10:
1477         case ACPI_DMT_BUF12:
1478         case ACPI_DMT_BUF16:
1479         case ACPI_DMT_BUF18:
1480         case ACPI_DMT_BUF128:
1481             /*
1482              * Buffer: Size depends on the opcode and was set above.
1483              * Each hex byte is separated with a space.
1484              * Multiple lines are separated by line continuation char.
1485              */
1486             for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
1487             {
1488                 AcpiOsPrintf ("%2.2X", Target[Temp16]);
1489                 if ((UINT32) (Temp16 + 1) < ByteLength)
1490                 {
1491                     if ((Temp16 > 0) && (!((Temp16+1) % 16)))
1492                     {
1493                         AcpiOsPrintf (" \\\n"); /* Line continuation */
1494                         AcpiDmLineHeader (0, 0, NULL);
1495                     }
1496                     else
1497                     {
1498                         AcpiOsPrintf (" ");
1499                     }
1500                 }
1501             }
1502 
1503             AcpiOsPrintf ("\n");
1504             break;
1505 
1506         case ACPI_DMT_UUID:
1507 
1508             /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
1509 
1510             (void) AcpiUtConvertUuidToString ((char *) Target, AslGbl_MsgBuffer);
1511 
1512             AcpiOsPrintf ("%s\n", AslGbl_MsgBuffer);
1513             break;
1514 
1515         case ACPI_DMT_STRING:
1516 
1517             AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
1518             break;
1519 
1520         case ACPI_DMT_IVRS_UNTERMINATED_STRING:
1521 
1522             AcpiOsPrintf ("\"%.*s\"\n", ByteLength, ACPI_CAST_PTR (char, Target));
1523             break;
1524 
1525         /* Fixed length ASCII name fields */
1526 
1527         case ACPI_DMT_SIG:
1528 
1529             AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1530             AcpiOsPrintf ("\"%.4s\"    ", RepairedName);
1531 
1532             TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
1533             if (TableData)
1534             {
1535                 AcpiOsPrintf (STRING_FORMAT, TableData->Description);
1536             }
1537             else
1538             {
1539                 AcpiOsPrintf ("\n");
1540             }
1541             break;
1542 
1543         case ACPI_DMT_NAME4:
1544 
1545             AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1546             AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
1547             break;
1548 
1549         case ACPI_DMT_NAME6:
1550 
1551             AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);
1552             AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
1553             break;
1554 
1555         case ACPI_DMT_NAME8:
1556 
1557             AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);
1558             AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
1559             break;
1560 
1561         /* Special Data Types */
1562 
1563         case ACPI_DMT_CHKSUM:
1564 
1565             /* Checksum, display and validate */
1566 
1567             AcpiOsPrintf ("%2.2X", *Target);
1568             Temp8 = AcpiUtGenerateChecksum (Table,
1569                 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
1570                 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
1571 
1572             if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
1573             {
1574                 AcpiOsPrintf (
1575                     "     /* Incorrect checksum, should be %2.2X */", Temp8);
1576             }
1577 
1578             AcpiOsPrintf ("\n");
1579             break;
1580 
1581         case ACPI_DMT_SPACEID:
1582 
1583             /* Address Space ID */
1584 
1585             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));
1586             break;
1587 
1588         case ACPI_DMT_ACCWIDTH:
1589 
1590             /* Encoded Access Width */
1591 
1592             Temp8 = *Target;
1593             if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
1594             {
1595                 Temp8 = ACPI_GAS_WIDTH_RESERVED;
1596             }
1597 
1598             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);
1599             break;
1600 
1601         case ACPI_DMT_GAS:
1602 
1603             /* Generic Address Structure */
1604 
1605             AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
1606             Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1607                 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
1608             if (ACPI_FAILURE (Status))
1609             {
1610                 return (Status);
1611             }
1612 
1613             AcpiOsPrintf ("\n");
1614             LastOutputBlankLine = TRUE;
1615             break;
1616 
1617         case ACPI_DMT_AEST:
1618 
1619             /* AEST subtable types */
1620 
1621             Temp8 = *Target;
1622             if (Temp8 > ACPI_AEST_NODE_TYPE_RESERVED)
1623             {
1624                 Temp8 = ACPI_AEST_NODE_TYPE_RESERVED;
1625             }
1626 
1627             AcpiOsPrintf (UINT8_FORMAT, *Target,
1628                 AcpiDmAestSubnames[Temp8]);
1629             break;
1630 
1631         case ACPI_DMT_AEST_CACHE:
1632 
1633             /* AEST cache resource subtable */
1634 
1635             Temp32 = *Target;
1636             if (Temp32 > ACPI_AEST_CACHE_RESERVED)
1637             {
1638                 Temp32 = ACPI_AEST_CACHE_RESERVED;
1639             }
1640 
1641             AcpiOsPrintf (UINT32_FORMAT, *Target,
1642                 AcpiDmAestCacheNames[Temp32]);
1643             break;
1644 
1645         case ACPI_DMT_AEST_GIC:
1646 
1647             /* AEST GIC error subtable */
1648 
1649             Temp32 = *Target;
1650             if (Temp32 > ACPI_AEST_GIC_RESERVED)
1651             {
1652                 Temp32 = ACPI_AEST_GIC_RESERVED;
1653             }
1654 
1655             AcpiOsPrintf (UINT32_FORMAT, *Target,
1656                 AcpiDmAestGicNames[Temp32]);
1657             break;
1658 
1659         case ACPI_DMT_AEST_RES:
1660 
1661             /* AEST resource type subtable */
1662 
1663             Temp8 = *Target;
1664             if (Temp8 > ACPI_AEST_RESOURCE_RESERVED)
1665             {
1666                 Temp8 = ACPI_AEST_RESOURCE_RESERVED;
1667             }
1668 
1669             AcpiOsPrintf (UINT8_FORMAT, *Target,
1670                 AcpiDmAestResourceNames[Temp8]);
1671             break;
1672 
1673         case ACPI_DMT_AEST_XFACE:
1674 
1675             /* AEST interface structure types */
1676 
1677             Temp8 = *Target;
1678             if (Temp8 > ACPI_AEST_XFACE_RESERVED)
1679             {
1680                 Temp8 = ACPI_AEST_XFACE_RESERVED;
1681             }
1682 
1683             AcpiOsPrintf (UINT8_FORMAT, *Target,
1684                 AcpiDmAestXfaceNames[Temp8]);
1685             break;
1686 
1687         case ACPI_DMT_AEST_XRUPT:
1688 
1689             /* AEST interrupt structure types */
1690 
1691             Temp8 = *Target;
1692             if (Temp8 > ACPI_AEST_XRUPT_RESERVED)
1693             {
1694                 Temp8 = ACPI_AEST_XRUPT_RESERVED;
1695             }
1696 
1697             AcpiOsPrintf (UINT8_FORMAT, *Target,
1698                 AcpiDmAestXruptNames[Temp8]);
1699             break;
1700 
1701         case ACPI_DMT_ASPT:
1702             /* ASPT subtable types */
1703             Temp16 = ACPI_GET16(Target);
1704             if (Temp16 > ACPI_ASPT_TYPE_UNKNOWN)
1705             {
1706                 Temp16 = ACPI_ASPT_TYPE_UNKNOWN;
1707             }
1708 
1709             AcpiOsPrintf(UINT16_FORMAT, Temp16, AcpiDmAsptSubnames[Temp16]);
1710             break;
1711 
1712         case ACPI_DMT_ASF:
1713 
1714             /* ASF subtable types */
1715 
1716             Temp16 = (UINT16) ((*Target) & 0x7F);  /* Top bit can be zero or one */
1717             if (Temp16 > ACPI_ASF_TYPE_RESERVED)
1718             {
1719                 Temp16 = ACPI_ASF_TYPE_RESERVED;
1720             }
1721 
1722             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
1723             break;
1724 
1725         case ACPI_DMT_CDAT:
1726 
1727             /* CDAT subtable types */
1728 
1729             Temp8 = *Target;
1730             if (Temp8 > ACPI_CDAT_TYPE_RESERVED)
1731             {
1732                 Temp8 = ACPI_CDAT_TYPE_RESERVED;
1733             }
1734 
1735             AcpiOsPrintf (UINT8_FORMAT, *Target,
1736                 AcpiDmCdatSubnames[Temp8]);
1737             break;
1738 
1739         case ACPI_DMT_CEDT:
1740 
1741             /* CEDT subtable types */
1742 
1743             Temp8 = *Target;
1744             if (Temp8 > ACPI_CEDT_TYPE_RESERVED)
1745             {
1746                 Temp8 = ACPI_CEDT_TYPE_RESERVED;
1747             }
1748 
1749             AcpiOsPrintf (UINT8_FORMAT, *Target,
1750                 AcpiDmCedtSubnames[Temp8]);
1751             break;
1752 
1753         case ACPI_DMT_DMAR:
1754 
1755             /* DMAR subtable types */
1756 
1757             Temp16 = ACPI_GET16 (Target);
1758             if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
1759             {
1760                 Temp16 = ACPI_DMAR_TYPE_RESERVED;
1761             }
1762 
1763             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1764                 AcpiDmDmarSubnames[Temp16]);
1765             break;
1766 
1767         case ACPI_DMT_DMAR_SCOPE:
1768 
1769             /* DMAR device scope types */
1770 
1771             Temp8 = *Target;
1772             if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
1773             {
1774                 Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
1775             }
1776 
1777             AcpiOsPrintf (UINT8_FORMAT, *Target,
1778                 AcpiDmDmarScope[Temp8]);
1779             break;
1780 
1781         case ACPI_DMT_EINJACT:
1782 
1783             /* EINJ Action types */
1784 
1785             Temp8 = *Target;
1786             if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
1787             {
1788                 Temp8 = ACPI_EINJ_ACTION_RESERVED;
1789             }
1790 
1791             AcpiOsPrintf (UINT8_FORMAT, *Target,
1792                 AcpiDmEinjActions[Temp8]);
1793             break;
1794 
1795         case ACPI_DMT_EINJINST:
1796 
1797             /* EINJ Instruction types */
1798 
1799             Temp8 = *Target;
1800             if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
1801             {
1802                 Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
1803             }
1804 
1805             AcpiOsPrintf (UINT8_FORMAT, *Target,
1806                 AcpiDmEinjInstructions[Temp8]);
1807             break;
1808 
1809         case ACPI_DMT_ERSTACT:
1810 
1811             /* ERST Action types */
1812 
1813             Temp8 = *Target;
1814             if (Temp8 > ACPI_ERST_ACTION_RESERVED)
1815             {
1816                 Temp8 = ACPI_ERST_ACTION_RESERVED;
1817             }
1818 
1819             AcpiOsPrintf (UINT8_FORMAT, *Target,
1820                 AcpiDmErstActions[Temp8]);
1821             break;
1822 
1823         case ACPI_DMT_ERSTINST:
1824 
1825             /* ERST Instruction types */
1826 
1827             Temp8 = *Target;
1828             if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
1829             {
1830                 Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
1831             }
1832 
1833             AcpiOsPrintf (UINT8_FORMAT, *Target,
1834                 AcpiDmErstInstructions[Temp8]);
1835             break;
1836 
1837         case ACPI_DMT_GTDT:
1838 
1839             /* GTDT subtable types */
1840 
1841             Temp8 = *Target;
1842             if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
1843             {
1844                 Temp8 = ACPI_GTDT_TYPE_RESERVED;
1845             }
1846 
1847             AcpiOsPrintf (UINT8_FORMAT, *Target,
1848                 AcpiDmGtdtSubnames[Temp8]);
1849             break;
1850 
1851         case ACPI_DMT_HEST:
1852 
1853             /* HEST subtable types */
1854 
1855             Temp16 = ACPI_GET16 (Target);
1856             if (Temp16 > ACPI_HEST_TYPE_RESERVED)
1857             {
1858                 Temp16 = ACPI_HEST_TYPE_RESERVED;
1859             }
1860 
1861             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1862                 AcpiDmHestSubnames[Temp16]);
1863             break;
1864 
1865         case ACPI_DMT_HESTNTFY:
1866 
1867             AcpiOsPrintf (STRING_FORMAT,
1868                 "Hardware Error Notification Structure");
1869 
1870             Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1871                 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
1872             if (ACPI_FAILURE (Status))
1873             {
1874                 return (Status);
1875             }
1876 
1877             AcpiOsPrintf ("\n");
1878             LastOutputBlankLine = TRUE;
1879             break;
1880 
1881         case ACPI_DMT_HESTNTYP:
1882 
1883             /* HEST Notify types */
1884 
1885             Temp8 = *Target;
1886             if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)
1887             {
1888                 Temp8 = ACPI_HEST_NOTIFY_RESERVED;
1889             }
1890 
1891             AcpiOsPrintf (UINT8_FORMAT, *Target,
1892                 AcpiDmHestNotifySubnames[Temp8]);
1893             break;
1894 
1895         case ACPI_DMT_HMAT:
1896 
1897             /* HMAT subtable types */
1898 
1899             Temp16 = *Target;
1900             if (Temp16 > ACPI_HMAT_TYPE_RESERVED)
1901             {
1902                 Temp16 = ACPI_HMAT_TYPE_RESERVED;
1903             }
1904 
1905             AcpiOsPrintf (UINT16_FORMAT, *Target,
1906                 AcpiDmHmatSubnames[Temp16]);
1907             break;
1908 
1909         case ACPI_DMT_IORTMEM:
1910 
1911             AcpiOsPrintf (STRING_FORMAT,
1912                 "IORT Memory Access Properties");
1913 
1914             Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1915                 sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
1916             if (ACPI_FAILURE (Status))
1917             {
1918                 return (Status);
1919             }
1920 
1921             LastOutputBlankLine = TRUE;
1922             break;
1923 
1924         case ACPI_DMT_MADT:
1925 
1926             /* MADT subtable types */
1927 
1928             Temp8 = *Target;
1929             if ((Temp8 >= ACPI_MADT_TYPE_RESERVED) && (Temp8 < ACPI_MADT_TYPE_OEM_RESERVED))
1930             {
1931                 Temp8 = ACPI_MADT_TYPE_RESERVED;
1932             }
1933             else if (Temp8 >= ACPI_MADT_TYPE_OEM_RESERVED)
1934             {
1935                 Temp8 = ACPI_MADT_TYPE_RESERVED + 1;
1936             }
1937             AcpiOsPrintf (UINT8_FORMAT, *Target,
1938                 AcpiDmMadtSubnames[Temp8]);
1939             break;
1940 
1941         case ACPI_DMT_MPAM_LOCATOR:
1942 
1943             /* MPAM subtable locator types */
1944 
1945             Temp8 = *Target;
1946             if (Temp8 > ACPI_MPAM_LOCATION_TYPE_INTERCONNECT)
1947             {
1948                 Temp8 = ACPI_MPAM_LOCATION_TYPE_INTERCONNECT + 1;
1949             }
1950 
1951             AcpiOsPrintf (UINT8_FORMAT, *Target,
1952                 AcpiDmMpamSubnames[Temp8]);
1953             break;
1954 
1955         case ACPI_DMT_NFIT:
1956 
1957             /* NFIT subtable types */
1958 
1959             Temp16 = ACPI_GET16 (Target);
1960             if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
1961             {
1962                 Temp16 = ACPI_NFIT_TYPE_RESERVED;
1963             }
1964 
1965             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1966                 AcpiDmNfitSubnames[Temp16]);
1967             break;
1968 
1969         case ACPI_DMT_NHLT1:
1970 
1971             /* NHLT link types */
1972 
1973             Temp8 = *Target;
1974             if (Temp8 > ACPI_NHLT_TYPE_RESERVED)
1975             {
1976                 Temp8 = ACPI_NHLT_TYPE_RESERVED;
1977             }
1978 
1979             AcpiOsPrintf (UINT8_FORMAT, *Target,
1980                 AcpiDmNhltLinkTypeNames[Temp8]);
1981             break;
1982 
1983         case ACPI_DMT_NHLT1a:
1984 
1985             /* NHLT direction */
1986 
1987             Temp8 = *Target;
1988             if (Temp8 > ACPI_NHLT_DIR_RESERVED)
1989             {
1990                 Temp8 = ACPI_NHLT_DIR_RESERVED;
1991             }
1992 
1993             AcpiOsPrintf (UINT8_FORMAT, *Target,
1994                 AcpiDmNhltDirectionNames[Temp8]);
1995             break;
1996 
1997         case ACPI_DMT_NHLT1b:
1998 
1999             /* NHLT microphone type */
2000 
2001             Temp8 = *Target;
2002             if (Temp8 > ACPI_NHLT_MIC_RESERVED)
2003             {
2004                 Temp8 = ACPI_NHLT_MIC_RESERVED;
2005             }
2006 
2007             AcpiOsPrintf (UINT8_FORMAT, *Target,
2008                 AcpiDmNhltMicTypeNames[Temp8]);
2009             break;
2010 
2011         case ACPI_DMT_NHLT1c:
2012 
2013             /* NHLT microphone position */
2014 
2015             Temp8 = *Target;
2016             if (Temp8 > ACPI_NHLT_MIC_POSITION_RESERVED)
2017             {
2018                 Temp8 = ACPI_NHLT_MIC_POSITION_RESERVED;
2019             }
2020 
2021             AcpiOsPrintf (UINT8_FORMAT, *Target,
2022                 AcpiDmNhltMicPositionNames[Temp8]);
2023             break;
2024 
2025         case ACPI_DMT_NHLT1d:
2026 
2027             /* NHLT microphone array type */
2028 
2029             Temp8 = *Target & ACPI_NHLT_ARRAY_TYPE_MASK;
2030             if (Temp8 < ACPI_NHLT_ARRAY_TYPE_RESERVED)
2031             {
2032                 Temp8 = ACPI_NHLT_ARRAY_TYPE_RESERVED;
2033             }
2034 
2035             AcpiOsPrintf (UINT8_FORMAT_NO_NEWLINE, *Target,
2036                 AcpiDmNhltMicArrayTypeNames[Temp8 - ACPI_NHLT_ARRAY_TYPE_RESERVED]);
2037 
2038             Temp8 = *Target;
2039             if (Temp8 & ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT)
2040             {
2041                 AcpiOsPrintf (" [%s]", "SNR and Sensitivity");
2042             }
2043 
2044             AcpiOsPrintf ("\n");
2045             break;
2046 
2047         case ACPI_DMT_NHLT1e:
2048 
2049             /* NHLT Endpoint Device ID */
2050 
2051             Temp16 = ACPI_GET16 (Target);
2052             if (Temp16 == 0xAE20)
2053             {
2054                 Name = "PDM DMIC";
2055             }
2056             else if (Temp16 == 0xAE30)
2057             {
2058                 Name = "BT Sideband";
2059             }
2060             else if (Temp16 == 0xAE34)
2061             {
2062                 Name = "I2S/TDM Codecs";
2063             }
2064             else
2065             {
2066                 Name = "Unknown Device ID";
2067             }
2068 
2069             AcpiOsPrintf (UINT16_FORMAT, Temp16, Name);
2070             break;
2071 
2072         case ACPI_DMT_NHLT1f:
2073 
2074             /* NHLT ConfigType field */
2075 
2076             Temp8 = *Target;
2077             if (Temp8 > ACPI_NHLT_CONFIG_TYPE_RESERVED)
2078             {
2079                 Temp8 = ACPI_NHLT_CONFIG_TYPE_RESERVED;
2080             }
2081 
2082             AcpiOsPrintf (UINT8_FORMAT, *Target,
2083                 AcpiDmNhltConfigTypeNames[Temp8]);
2084             break;
2085 
2086         case ACPI_DMT_PCCT:
2087 
2088             /* PCCT subtable types */
2089 
2090             Temp8 = *Target;
2091             if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
2092             {
2093                 Temp8 = ACPI_PCCT_TYPE_RESERVED;
2094             }
2095 
2096             AcpiOsPrintf (UINT8_FORMAT, *Target,
2097                 AcpiDmPcctSubnames[Temp8]);
2098             break;
2099 
2100         case ACPI_DMT_PHAT:
2101 
2102             /* PHAT subtable types */
2103 
2104             Temp16 = ACPI_GET16 (Target);
2105             if (Temp16 > ACPI_PHAT_TYPE_RESERVED)
2106             {
2107                 Temp16 = ACPI_PHAT_TYPE_RESERVED;
2108             }
2109 
2110             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
2111                 AcpiDmPhatSubnames[Temp16]);
2112             break;
2113 
2114         case ACPI_DMT_PMTT:
2115 
2116             /* PMTT subtable types */
2117 
2118             Temp8 = *Target;
2119             if (Temp8 == ACPI_PMTT_TYPE_VENDOR)
2120             {
2121                 Temp8 = ACPI_PMTT_TYPE_RESERVED + 1;
2122             }
2123             else if (Temp8 > ACPI_PMTT_TYPE_RESERVED)
2124             {
2125                 Temp8 = ACPI_PMTT_TYPE_RESERVED;
2126             }
2127             AcpiOsPrintf (UINT8_FORMAT, *Target,
2128                 AcpiDmPmttSubnames[Temp8]);
2129             break;
2130 
2131         case ACPI_DMT_PPTT:
2132 
2133             /* PPTT subtable types */
2134 
2135             Temp8 = *Target;
2136             if (Temp8 > ACPI_PPTT_TYPE_RESERVED)
2137             {
2138                 Temp8 = ACPI_PPTT_TYPE_RESERVED;
2139             }
2140 
2141             AcpiOsPrintf (UINT8_FORMAT, *Target,
2142                 AcpiDmPpttSubnames[Temp8]);
2143             break;
2144 
2145         case ACPI_DMT_UNICODE:
2146         case ACPI_DMT_WPBT_UNICODE:
2147 
2148             if (ByteLength == 0)
2149             {
2150                 AcpiOsPrintf ("/* Zero-length Data */\n");
2151                 break;
2152             }
2153 
2154             AcpiDmDumpUnicode (Table, 0, ByteLength);
2155             break;
2156 
2157         case ACPI_DMT_RAW_BUFFER:
2158         case ACPI_DMT_BUFFER:
2159         case ACPI_DMT_PMTT_VENDOR:
2160 
2161             if (ByteLength == 0)
2162             {
2163                 AcpiOsPrintf ("/* Zero-length Data */\n");
2164                 break;
2165             }
2166 
2167             AcpiDmDumpBuffer (Target, 0, ByteLength, CurrentOffset, NULL);
2168             break;
2169 
2170         case ACPI_DMT_RGRT:
2171 
2172             /* RGRT subtable types */
2173 
2174             Temp8 = *Target;
2175             if (Temp8 >= ACPI_RGRT_TYPE_RESERVED)
2176             {
2177                 Temp8 = ACPI_RGRT_TYPE_RESERVED0;
2178             }
2179 
2180             AcpiOsPrintf (UINT8_FORMAT, *Target,
2181                 AcpiDmRgrtSubnames[Temp8]);
2182             break;
2183 
2184         case ACPI_DMT_RHCT:
2185 
2186             /* RHCT subtable types */
2187 
2188             Temp16 = ACPI_GET16 (Target);
2189             if (Temp16 == ACPI_RHCT_NODE_TYPE_HART_INFO)
2190             {
2191                 Temp16 = ACPI_RHCT_NODE_TYPE_RESERVED;
2192             }
2193 
2194             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
2195                 AcpiDmRhctSubnames[Temp16]);
2196             break;
2197 
2198         case ACPI_DMT_SDEV:
2199 
2200             /* SDEV subtable types */
2201 
2202             Temp8 = *Target;
2203             if (Temp8 > ACPI_SDEV_TYPE_RESERVED)
2204             {
2205                 Temp8 = ACPI_SDEV_TYPE_RESERVED;
2206             }
2207 
2208             AcpiOsPrintf (UINT8_FORMAT, *Target,
2209                 AcpiDmSdevSubnames[Temp8]);
2210             break;
2211 
2212         case ACPI_DMT_SRAT:
2213 
2214             /* SRAT subtable types */
2215 
2216             Temp8 = *Target;
2217             if (Temp8 > ACPI_SRAT_TYPE_RESERVED)
2218             {
2219                 Temp8 = ACPI_SRAT_TYPE_RESERVED;
2220             }
2221 
2222             AcpiOsPrintf (UINT8_FORMAT, *Target,
2223                 AcpiDmSratSubnames[Temp8]);
2224             break;
2225 
2226         case ACPI_DMT_TPM2:
2227 
2228             /* TPM2 Start Method types */
2229 
2230             Temp8 = *Target;
2231             if (Temp8 > ACPI_TPM2_RESERVED)
2232             {
2233                 Temp8 = ACPI_TPM2_RESERVED;
2234             }
2235 
2236             AcpiOsPrintf (UINT8_FORMAT, *Target,
2237                 AcpiDmTpm2Subnames[Temp8]);
2238             break;
2239 
2240 
2241         case ACPI_DMT_FADTPM:
2242 
2243             /* FADT Preferred PM Profile names */
2244 
2245             Temp8 = *Target;
2246             if (Temp8 > ACPI_FADT_PM_RESERVED)
2247             {
2248                 Temp8 = ACPI_FADT_PM_RESERVED;
2249             }
2250 
2251             AcpiOsPrintf (UINT8_FORMAT, *Target,
2252                 AcpiDmFadtProfiles[Temp8]);
2253             break;
2254 
2255         case ACPI_DMT_IVRS:
2256 
2257             /* IVRS subtable types */
2258 
2259             Temp8 = *Target;
2260             switch (Temp8)
2261             {
2262             case ACPI_IVRS_TYPE_HARDWARE1:
2263             case ACPI_IVRS_TYPE_HARDWARE2:
2264 
2265                 Name = AcpiDmIvrsSubnames[0];
2266                 break;
2267 
2268             case ACPI_IVRS_TYPE_HARDWARE3:
2269 
2270                 Name = AcpiDmIvrsSubnames[1];
2271                 break;
2272 
2273             case ACPI_IVRS_TYPE_MEMORY1:
2274             case ACPI_IVRS_TYPE_MEMORY2:
2275             case ACPI_IVRS_TYPE_MEMORY3:
2276 
2277                 Name = AcpiDmIvrsSubnames[2];
2278                 break;
2279 
2280             default:
2281 
2282                 Name = AcpiDmIvrsSubnames[3];
2283                 break;
2284             }
2285 
2286             AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
2287             break;
2288 
2289         case ACPI_DMT_IVRS_DE:
2290 
2291             /* IVRS device entry types */
2292 
2293             Temp8 = *Target;
2294             switch (Temp8)
2295             {
2296             case ACPI_IVRS_TYPE_ALL:
2297             case ACPI_IVRS_TYPE_SELECT:
2298             case ACPI_IVRS_TYPE_START:
2299             case ACPI_IVRS_TYPE_END:
2300 
2301                 Name = AcpiDmIvrsDevEntryNames[Temp8];
2302                 break;
2303 
2304             case ACPI_IVRS_TYPE_ALIAS_SELECT:
2305             case ACPI_IVRS_TYPE_ALIAS_START:
2306             case ACPI_IVRS_TYPE_EXT_SELECT:
2307             case ACPI_IVRS_TYPE_EXT_START:
2308             case ACPI_IVRS_TYPE_SPECIAL:
2309 
2310                 Name = AcpiDmIvrsDevEntryNames[Temp8 - 61];
2311                 break;
2312 
2313             case ACPI_IVRS_TYPE_HID:
2314 
2315                 Name = AcpiDmIvrsDevEntryNames[Temp8 - 228];
2316                 break;
2317 
2318             default:
2319                 Name = AcpiDmIvrsDevEntryNames[0];  /* Unknown/Reserved */
2320                 break;
2321             }
2322 
2323             AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
2324             break;
2325 
2326         case ACPI_DMT_LPIT:
2327 
2328             /* LPIT subtable types */
2329 
2330             Temp32 = ACPI_GET32 (Target);
2331             if (Temp32 > ACPI_LPIT_TYPE_RESERVED)
2332             {
2333                 Temp32 = ACPI_LPIT_TYPE_RESERVED;
2334             }
2335 
2336             AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),
2337                 AcpiDmLpitSubnames[Temp32]);
2338             break;
2339 
2340         case ACPI_DMT_VIOT:
2341 
2342             /* VIOT subtable types */
2343 
2344             Temp8 = *Target;
2345             if (Temp8 > ACPI_VIOT_RESERVED)
2346             {
2347                 Temp8 = ACPI_VIOT_RESERVED;
2348             }
2349 
2350             AcpiOsPrintf (UINT8_FORMAT, *Target,
2351                 AcpiDmViotSubnames[Temp8]);
2352             break;
2353 
2354         case ACPI_DMT_EXIT:
2355 
2356             return (AE_OK);
2357 
2358         default:
2359 
2360             ACPI_ERROR ((AE_INFO,
2361                 "**** Invalid table opcode [0x%X] ****\n", Info->Opcode));
2362             return (AE_SUPPORT);
2363         }
2364     }
2365 
2366     if (TableOffset && !SubtableLength)
2367     {
2368         /*
2369          * If this table is not the main table, the subtable must have a
2370          * valid length
2371          */
2372         AcpiOsPrintf ("Invalid zero length subtable\n");
2373         return (AE_BAD_DATA);
2374     }
2375 
2376     return (AE_OK);
2377 }
2378