1 /******************************************************************************
3 * Module Name: dmtable - Support for ACPI tables that contain no AML code
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2021, Intel Corp.
12 * All rights reserved.
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
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
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;
37 * The above copyright and patent license is granted only if the following
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.
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
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
72 * 3.4. Intel retains all right, title, and interest in and to the Original
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.
80 * 4. Disclaimer and Export Compliance
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
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
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.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
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.
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.
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.
150 *****************************************************************************/
153 #include "accommon.h"
154 #include "acdisasm.h"
155 #include "actables.h"
156 #include "aslcompiler.h"
158 /* This module used for application-level code only */
160 #define _COMPONENT ACPI_CA_DISASSEMBLER
161 ACPI_MODULE_NAME ("dmtable")
168 /* Common format strings for commented values */
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"
176 /* These tables map a subtable type to a description string */
178 static const char *AcpiDmAestResourceNames[] =
183 "Unknown Resource Type" /* Reserved */
186 static const char *AcpiDmAestSubnames[] =
188 "Processor Error Node",
191 "Vendor-defined Error Node",
193 "Unknown Subtable Type" /* Reserved */
196 static const char *AcpiDmAestCacheNames[] =
201 "Unknown Cache Type" /* Reserved */
204 static const char *AcpiDmAestGicNames[] =
210 "Unknown GIC Interface Type" /* Reserved */
213 static const char *AcpiDmAestXfaceNames[] =
215 "System Register Interface",
216 "Memory Mapped Interface",
217 "Unknown Interface Type" /* Reserved */
220 static const char *AcpiDmAestXruptNames[] =
222 "Fault Handling Interrupt",
223 "Error Recovery Interrupt",
224 "Unknown Interrupt Type" /* Reserved */
227 static const char *AcpiDmAsfSubnames[] =
231 "ASF Remote Control",
232 "ASF RMCP Boot Options",
234 "Unknown Subtable Type" /* Reserved */
237 static const char *AcpiDmCedtSubnames[] =
239 "CXL Host Bridge Structure",
240 "CXL Fixed Memory Window Structure",
241 "Unknown Subtable Type" /* Reserved */
244 static const char *AcpiDmDmarSubnames[] =
246 "Hardware Unit Definition",
247 "Reserved Memory Region",
248 "Root Port ATS Capability",
249 "Remapping Hardware Static Affinity",
250 "ACPI Namespace Device Declaration",
251 "Unknown Subtable Type" /* Reserved */
254 static const char *AcpiDmDmarScope[] =
257 "PCI Endpoint Device",
260 "Message-capable HPET Device",
262 "Unknown Scope Type" /* Reserved */
265 static const char *AcpiDmEinjActions[] =
274 "Get Command Status",
275 "Set Error Type With Address",
276 "Get Execute Timings",
280 static const char *AcpiDmEinjInstructions[] =
283 "Read Register Value",
285 "Write Register Value",
288 "Unknown Instruction"
291 static const char *AcpiDmErstActions[] =
293 "Begin Write Operation",
294 "Begin Read Operation",
295 "Begin Clear Operation",
300 "Get Command Status",
301 "Get Record Identifier",
302 "Set Record Identifier",
305 "Unused/Unknown Action",
306 "Get Error Address Range",
307 "Get Error Address Length",
308 "Get Error Attributes",
313 static const char *AcpiDmErstInstructions[] =
316 "Read Register Value",
318 "Write Register Value",
331 "Set Source Address",
332 "Set Destination Address",
334 "Unknown Instruction"
337 static const char *AcpiDmGtdtSubnames[] =
339 "Generic Timer Block",
340 "Generic Watchdog Timer",
341 "Unknown Subtable Type" /* Reserved */
344 static const char *AcpiDmHestSubnames[] =
346 "IA-32 Machine Check Exception",
347 "IA-32 Corrected Machine Check",
348 "IA-32 Non-Maskable Interrupt",
349 "Unknown Subtable Type", /* 3 - Reserved */
350 "Unknown Subtable Type", /* 4 - Reserved */
351 "Unknown Subtable Type", /* 5 - Reserved */
352 "PCI Express Root Port AER",
353 "PCI Express AER (AER Endpoint)",
354 "PCI Express/PCI-X Bridge AER",
355 "Generic Hardware Error Source",
356 "Generic Hardware Error Source V2",
357 "IA-32 Deferred Machine Check",
358 "Unknown Subtable Type" /* Reserved */
361 static const char *AcpiDmHestNotifySubnames[] =
364 "External Interrupt",
368 "CMCI", /* ACPI 5.0 */
369 "MCE", /* ACPI 5.0 */
370 "GPIO", /* ACPI 6.0 */
371 "SEA", /* ACPI 6.1 */
372 "SEI", /* ACPI 6.1 */
373 "GSIV", /* ACPI 6.1 */
374 "Software Delegated Exception", /* ACPI 6.2 */
375 "Unknown Notify Type" /* Reserved */
378 static const char *AcpiDmHmatSubnames[] =
380 "Memory Proximity Domain Attributes",
381 "System Locality Latency and Bandwidth Information",
382 "Memory Side Cache Information",
383 "Unknown Structure Type" /* Reserved */
386 static const char *AcpiDmMadtSubnames[] =
388 "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
389 "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
390 "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
391 "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
392 "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
393 "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
394 "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
395 "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
396 "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
397 "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
398 "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
399 "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
400 "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */
401 "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */
402 "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
403 "Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */
404 "Mutiprocessor Wakeup", /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */
405 "Unknown Subtable Type" /* Reserved */
408 static const char *AcpiDmNfitSubnames[] =
410 "System Physical Address Range", /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */
411 "Memory Range Map", /* ACPI_NFIT_TYPE_MEMORY_MAP */
412 "Interleave Info", /* ACPI_NFIT_TYPE_INTERLEAVE */
413 "SMBIOS Information", /* ACPI_NFIT_TYPE_SMBIOS */
414 "NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */
415 "NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */
416 "Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */
417 "Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */
418 "Unknown Subtable Type" /* Reserved */
421 static const char *AcpiDmNhltLinkTypeNames[] =
423 "Reserved for HD-Audio", /* ACPI_NHLT_RESERVED_HD_AUDIO */
424 "Reserved for DSP", /* ACPI_NHLT_RESERVED_DSP */
425 "Type PDM", /* ACPI_NHLT_PDM */
426 "Type SSP", /* ACPI_NHLT_SSP */
427 "Reserved for SlimBus", /* ACPI_NHLT_RESERVED_SLIMBUS */
428 "Reserved for SoundWire", /* ACPI_NHLT_RESERVED_SOUNDWIRE */
429 "Unknown Link Type" /* Reserved */
432 static const char *AcpiDmNhltDirectionNames[] =
434 "Render", /* ACPI_NHLT_DIR_RENDER */
435 "Capture", /* ACPI_NHLT_DIR_CAPTURE */
436 "Render with Loopback", /* ACPI_NHLT_DIR_RENDER_LOOPBACK */
437 "Feedback for Render", /* ACPI_NHLT_DIR_RENDER_FEEDBACK */
438 "Unknown Direction" /* Reserved */
441 static const char *AcpiDmNhltMicTypeNames[] =
443 "Omnidirectional", /* ACPI_NHLT_MIC_OMNIDIRECTIONAL */
444 "Subcardioid", /* ACPI_NHLT_MIC_SUBCARDIOID */
445 "Cardioid", /* ACPI_NHLT_MIC_CARDIOID */
446 "SuperCardioid", /* ACPI_NHLT_MIC_SUPER_CARDIOID */
447 "HyperCardioid", /* ACPI_NHLT_MIC_HYPER_CARDIOID */
448 "8 Shaped", /* ACPI_NHLT_MIC_8_SHAPED */
449 "Reserved Mic Type", /* Reserved */
450 "Vendor Defined", /* ACPI_NHLT_MIC_VENDOR_DEFINED */
451 "Unknown Mic Type" /* ACPI_NHLT_MIC_RESERVED */
454 static const char *AcpiDmNhltMicPositionNames[] =
456 "Top", /* ACPI_NHLT_MIC_POSITION_TOP */
457 "Bottom", /* ACPI_NHLT_MIC_POSITION_BOTTOM */
458 "Left", /* ACPI_NHLT_MIC_POSITION_LEFT */
459 "Right", /* ACPI_NHLT_MIC_POSITION_RIGHT */
460 "Front", /* ACPI_NHLT_MIC_POSITION_FRONT */
461 "Back", /* ACPI_NHLT_MIC_POSITION_BACK */
462 "Unknown Mic Position" /* 6 and above are reserved */
465 static const char *AcpiDmNhltMicArrayTypeNames[] =
467 "Unknown Array Type", /* ACPI_NHLT_ARRAY_TYPE_RESERVED */
468 "Small Linear 2-element", /* ACPI_NHLT_SMALL_LINEAR_2ELEMENT */
469 "Big Linear 2-element", /* ACPI_NHLT_BIG_LINEAR_2ELEMENT */
470 "Linear 4-element 1st Geometry", /* ACPI_NHLT_FIRST_GEOMETRY_LINEAR_4ELEMENT */
471 "Planar L-shaped 4-element", /* ACPI_NHLT_PLANAR_LSHAPED_4ELEMENT */
472 "Linear 4-element 2nd Geometry", /* ACPI_NHLT_SECOND_GEOMETRY_LINEAR_4ELEMENT */
473 "Vendor Defined" /* ACPI_NHLT_VENDOR_DEFINED */
476 static const char *AcpiDmNhltConfigTypeNames[] =
478 "Generic Type", /* ACPI_NHLT_CONFIG_TYPE_GENERIC */
479 "Microphone Array", /* ACPI_NHLT_CONFIG_TYPE_MIC_ARRAY */
480 "Reserved", /* ACPI_NHLT_CONFIG_TYPE_RESERVED */
481 "Render Feedback", /* ACPI_NHLT_CONFIG_TYPE_RENDER_FEEDBACK */
482 "Unknown Config Type" /* ACPI_NHLT_CONFIG_TYPE_RESERVED */
485 static const char *AcpiDmPcctSubnames[] =
487 "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
488 "HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
489 "HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */
490 "Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */
491 "Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */
492 "HW Registers based Comm Subspace", /* ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE */
493 "Unknown Subtable Type" /* Reserved */
496 static const char *AcpiDmPhatSubnames[] =
498 "Firmware Version Data", /* ACPI_PHAT_TYPE_FW_VERSION_DATA */
499 "Firmware Health Data", /* ACPI_PHAT_TYPE_FW_HEALTH_DATA */
500 "Unknown Subtable Type" /* Reserved */
503 static const char *AcpiDmPmttSubnames[] =
505 "Socket", /* ACPI_PMTT_TYPE_SOCKET */
506 "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */
507 "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */
508 "Unknown Subtable Type", /* Reserved */
509 "Vendor Specific" /* ACPI_PMTT_TYPE_VENDOR */
512 static const char *AcpiDmPpttSubnames[] =
514 "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */
515 "Cache Type", /* ACPI_PPTT_TYPE_CACHE */
516 "ID", /* ACPI_PPTT_TYPE_ID */
517 "Unknown Subtable Type" /* Reserved */
520 static const char *AcpiDmRgrtSubnames[] =
522 "Unknown/Reserved Image Type", /* ACPI_RGRT_TYPE_RESERVED0 */
523 "Type PNG" /* ACPI_RGRT_IMAGE_TYPE_PNG */
526 static const char *AcpiDmSdevSubnames[] =
528 "Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */
529 "PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */
530 "Unknown Subtable Type" /* Reserved */
533 static const char *AcpiDmSratSubnames[] =
535 "Processor Local APIC/SAPIC Affinity",
537 "Processor Local x2APIC Affinity",
539 "GIC ITS Affinity", /* Acpi 6.2 */
540 "Generic Initiator Affinity", /* Acpi 6.3 */
541 "Generic Port Affinity", /* Acpi 6.4 */
542 "Unknown Subtable Type" /* Reserved */
545 static const char *AcpiDmTpm2Subnames[] =
547 "Illegal Start Method value",
554 "Command Response Buffer",
555 "Command Response Buffer with ACPI Start Method",
558 "Command Response Buffer with ARM SMC",
559 "Unknown Subtable Type" /* Reserved */
562 static const char *AcpiDmIvrsSubnames[] =
564 "Hardware Definition Block (IVHD)",
565 "Hardware Definition Block - Mixed Format (IVHD)",
566 "Memory Definition Block (IVMD)",
567 "Unknown/Reserved Subtable Type" /* Reserved */
570 static const char *AcpiDmIvrsDevEntryNames[] =
572 "Unknown/Reserved Device Entry Type", /* 0- Reserved */
573 "Device Entry: Select All Devices", /* 1 */
574 "Device Entry: Select One Device", /* 2 */
575 "Device Entry: Start of Range", /* 3 */
576 "Device Entry: End of Range", /* 4 */
577 "Device Entry: Alias Select", /* 66 */
578 "Device Entry: Alias Start of Range", /* 67 */
579 "Unknown/Reserved Device Entry Type", /* 68- Reserved */
580 "Unknown/Reserved Device Entry Type", /* 69- Reserved */
581 "Device Entry: Extended Select", /* 70 */
582 "Device Entry: Extended Start of Range", /* 71 */
583 "Device Entry: Special Device", /* 72 */
584 "Device Entry: ACPI HID Named Device", /* 240 */
585 "Unknown/Reserved Device Entry Type" /* Reserved */
588 static const char *AcpiDmLpitSubnames[] =
590 "Native C-state Idle Structure",
591 "Unknown Subtable Type" /* Reserved */
594 static const char *AcpiDmViotSubnames[] =
596 "Unknown Subtable Type", /* 0 -Reserved */
601 "Unknown Subtable Type" /* Reserved */
604 #define ACPI_FADT_PM_RESERVED 9
606 static const char *AcpiDmFadtProfiles[] =
615 "Performance Server",
617 "Unknown Profile Type"
620 #define ACPI_GAS_WIDTH_RESERVED 5
622 static const char *AcpiDmGasAccessWidth[] =
629 "Unknown Width Encoding"
633 /*******************************************************************************
635 * ACPI Table Data, indexed by signature.
637 * Each entry contains: Signature, Table Info, Handler, DtHandler,
638 * Template, Description
640 * Simple tables have only a TableInfo structure, complex tables have a
641 * handler. This table must be NULL terminated. RSDP and FACS are
642 * special-cased elsewhere.
644 * Note: Any tables added here should be duplicated within
645 * AcpiGbl_SupportedTables in the file common/ahtable.c
647 ******************************************************************************/
649 const ACPI_DMTABLE_DATA AcpiDmTableData[] =
651 {ACPI_SIG_AEST, NULL, AcpiDmDumpAest, DtCompileAest, TemplateAest},
652 {ACPI_SIG_AGDI, AcpiDmTableInfoAgdi, NULL, NULL, TemplateAgdi},
653 {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf},
654 {ACPI_SIG_BDAT, AcpiDmTableInfoBdat, NULL, NULL, TemplateBdat},
655 {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
656 {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
657 {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
658 {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt},
659 {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
660 {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
661 {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},
662 {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp},
663 {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar},
664 {ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm},
665 {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt},
666 {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj},
667 {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst},
668 {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt},
669 {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt},
670 {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt},
671 {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest},
672 {ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat},
673 {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet},
674 {ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort},
675 {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs},
676 {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit},
677 {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt},
678 {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg},
679 {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi},
680 {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst},
681 {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct},
682 {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm},
683 {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit},
684 {ACPI_SIG_NHLT, AcpiDmTableInfoNhlt, AcpiDmDumpNhlt, DtCompileNhlt, TemplateNhlt},
685 {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct},
686 {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt},
687 {ACPI_SIG_PHAT, NULL, AcpiDmDumpPhat, DtCompilePhat, TemplatePhat},
688 {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt},
689 {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt},
690 {ACPI_SIG_PRMT, NULL, AcpiDmDumpPrmt, DtCompilePrmt, TemplatePrmt},
691 {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf},
692 {ACPI_SIG_RGRT, NULL, AcpiDmDumpRgrt, DtCompileRgrt, TemplateRgrt},
693 {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},
694 {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},
695 {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},
696 {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei},
697 {ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev},
698 {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic},
699 {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit},
700 {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr},
701 {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi},
702 {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat},
703 {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao},
704 {ACPI_SIG_SVKL, AcpiDmTableInfoSvkl, AcpiDmDumpSvkl, DtCompileSvkl, TemplateSvkl},
705 {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa},
706 {ACPI_SIG_TDEL, AcpiDmTableInfoTdel, NULL, NULL, TemplateTdel},
707 {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2},
708 {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi},
709 {ACPI_SIG_VIOT, AcpiDmTableInfoViot, AcpiDmDumpViot, DtCompileViot, TemplateViot},
710 {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet},
711 {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat},
712 {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt},
713 {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt},
714 {ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt},
715 {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt},
716 {ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv},
717 {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt},
718 {NULL, NULL, NULL, NULL, NULL}
722 /*******************************************************************************
724 * FUNCTION: AcpiDmGenerateChecksum
726 * PARAMETERS: Table - Pointer to table to be checksummed
727 * Length - Length of the table
728 * OriginalChecksum - Value of the checksum field
730 * RETURN: 8 bit checksum of buffer
732 * DESCRIPTION: Computes an 8 bit checksum of the table.
734 ******************************************************************************/
737 AcpiDmGenerateChecksum (
740 UINT8 OriginalChecksum)
745 /* Sum the entire table as-is */
747 Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
749 /* Subtract off the existing checksum value in the table */
751 Checksum = (UINT8) (Checksum - OriginalChecksum);
753 /* Compute the final checksum */
755 Checksum = (UINT8) (0 - Checksum);
760 /*******************************************************************************
762 * FUNCTION: AcpiDmGetTableData
764 * PARAMETERS: Signature - ACPI signature (4 chars) to match
766 * RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.
768 * DESCRIPTION: Find a match in the global table of supported ACPI tables
770 ******************************************************************************/
772 const ACPI_DMTABLE_DATA *
776 const ACPI_DMTABLE_DATA *Info;
779 for (Info = AcpiDmTableData; Info->Signature; Info++)
781 if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature))
791 /*******************************************************************************
793 * FUNCTION: AcpiDmDumpDataTable
795 * PARAMETERS: Table - An ACPI table
799 * DESCRIPTION: Format the contents of an ACPI data table (any table other
800 * than an SSDT or DSDT that does not contain executable AML code)
802 ******************************************************************************/
805 AcpiDmDumpDataTable (
806 ACPI_TABLE_HEADER *Table)
809 const ACPI_DMTABLE_DATA *TableData;
813 /* Ignore tables that contain AML */
815 if (AcpiUtIsAmlTable (Table))
817 if (AslGbl_VerboseTemplates)
819 /* Dump the raw table data */
821 Length = Table->Length;
823 AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
824 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
825 AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
826 Length, DB_BYTE_DISPLAY, 0);
827 AcpiOsPrintf (" */\n");
833 * Handle tables that don't use the common ACPI table header structure.
834 * Currently, these are the FACS, RSDP, and S3PT.
836 if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
838 Length = Table->Length;
839 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
840 if (ACPI_FAILURE (Status))
845 else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP,
848 Length = AcpiDmDumpRsdp (Table);
850 else if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT))
852 Length = AcpiDmDumpS3pt (Table);
857 * All other tables must use the common ACPI table header, dump it now
859 Length = Table->Length;
860 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
861 if (ACPI_FAILURE (Status))
867 /* Match signature and dispatch appropriately */
869 TableData = AcpiDmGetTableData (Table->Signature);
872 if (!strncmp (Table->Signature, "OEM", 3))
874 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
879 AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
882 fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
885 if (!AcpiGbl_ForceAmlDisassembly)
887 fprintf (stderr, "decoding ACPI table header only\n");
891 fprintf (stderr, "assuming table contains valid AML code\n");
895 else if (TableData->TableHandler)
897 /* Complex table, has a handler */
899 TableData->TableHandler (Table);
901 else if (TableData->TableInfo)
903 /* Simple table, just walk the info table */
905 Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
906 if (ACPI_FAILURE (Status))
913 if (!AslGbl_DoTemplates || AslGbl_VerboseTemplates)
915 /* Dump the raw table data */
917 AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
918 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
919 AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
920 Length, DB_BYTE_DISPLAY, 0);
925 /*******************************************************************************
927 * FUNCTION: AcpiDmLineHeader
929 * PARAMETERS: Offset - Current byte offset, from table start
930 * ByteLength - Length of the field in bytes, 0 for flags
931 * Name - Name of this field
935 * DESCRIPTION: Utility routines for formatting output lines. Displays the
936 * current table offset in hex and decimal, the field length,
937 * and the field name.
939 ******************************************************************************/
948 /* Allow a null name for fields that span multiple lines (large buffers) */
955 if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */
959 AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
965 AcpiOsPrintf ("%41s : ", Name);
969 AcpiOsPrintf ("%41s ", Name);
973 else /* Normal disassembler or verbose template */
977 AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
978 Offset, Offset, ByteLength, Name);
984 AcpiOsPrintf ("%44s : ", Name);
988 AcpiOsPrintf ("%44s ", Name);
1002 if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */
1006 AcpiOsPrintf ("[%.4d] %30s %3d : ",
1007 ByteLength, Name, Value);
1011 AcpiOsPrintf ("%36s % 3d : ",
1015 else /* Normal disassembler or verbose template */
1019 AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ",
1020 Offset, Offset, ByteLength, Name, Value);
1024 AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ",
1025 Offset, Offset, Name, Value);
1031 /*******************************************************************************
1033 * FUNCTION: AcpiDmDumpTable
1035 * PARAMETERS: TableLength - Length of the entire ACPI table
1036 * TableOffset - Starting offset within the table for this
1037 * sub-descriptor (0 if main table)
1038 * Table - The ACPI table
1039 * SubtableLength - Length of this sub-descriptor
1040 * Info - Info table for this ACPI table
1044 * DESCRIPTION: Display ACPI table contents by walking the Info table.
1046 * Note: This function must remain in sync with DtGetFieldLength.
1048 ******************************************************************************/
1055 UINT32 SubtableLength,
1056 ACPI_DMTABLE_INFO *Info)
1059 UINT32 CurrentOffset;
1065 const AH_TABLE *TableData;
1067 BOOLEAN LastOutputBlankLine = FALSE;
1069 char RepairedName[8];
1074 AcpiOsPrintf ("Display not implemented\n");
1075 return (AE_NOT_IMPLEMENTED);
1078 /* Walk entire Info table; Null name terminates */
1080 for (; Info->Name; Info++)
1083 * Target points to the field within the ACPI Table. CurrentOffset is
1084 * the offset of the field from the start of the main table.
1086 Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
1087 CurrentOffset = TableOffset + Info->Offset;
1089 /* Check for beyond subtable end or (worse) beyond EOT */
1091 if (SubtableLength && (Info->Offset > SubtableLength))
1094 "/**** ACPI subtable terminates early (Len %u) - "
1095 "may be older version (dump table) */\n", SubtableLength);
1097 /* Move on to next subtable */
1102 if (CurrentOffset >= TableLength)
1105 "/**** ACPI table terminates "
1106 "in the middle of a data structure! (dump table) */\n");
1107 return (AE_BAD_DATA);
1110 /* Generate the byte length for this field */
1112 switch (Info->Opcode)
1114 case ACPI_DMT_UINT8:
1115 case ACPI_DMT_CHKSUM:
1116 case ACPI_DMT_SPACEID:
1117 case ACPI_DMT_ACCWIDTH:
1120 case ACPI_DMT_IVRS_DE:
1123 case ACPI_DMT_NHLT1:
1124 case ACPI_DMT_NHLT1a:
1125 case ACPI_DMT_NHLT1b:
1126 case ACPI_DMT_NHLT1c:
1127 case ACPI_DMT_NHLT1d:
1128 case ACPI_DMT_NHLT1f:
1136 case ACPI_DMT_AEST_RES:
1137 case ACPI_DMT_AEST_XFACE:
1138 case ACPI_DMT_AEST_XRUPT:
1140 case ACPI_DMT_HESTNTYP:
1141 case ACPI_DMT_FADTPM:
1142 case ACPI_DMT_EINJACT:
1143 case ACPI_DMT_EINJINST:
1144 case ACPI_DMT_ERSTACT:
1145 case ACPI_DMT_ERSTINST:
1146 case ACPI_DMT_DMAR_SCOPE:
1152 case ACPI_DMT_UINT16:
1157 case ACPI_DMT_NHLT1e:
1163 case ACPI_DMT_UINT24:
1168 case ACPI_DMT_UINT32:
1169 case ACPI_DMT_AEST_CACHE:
1170 case ACPI_DMT_AEST_GIC:
1171 case ACPI_DMT_NAME4:
1179 case ACPI_DMT_UINT40:
1184 case ACPI_DMT_UINT48:
1185 case ACPI_DMT_NAME6:
1190 case ACPI_DMT_UINT56:
1196 case ACPI_DMT_UINT64:
1197 case ACPI_DMT_NAME8:
1202 case ACPI_DMT_BUF10:
1207 case ACPI_DMT_BUF12:
1212 case ACPI_DMT_BUF16:
1218 case ACPI_DMT_BUF18:
1223 case ACPI_DMT_BUF128:
1228 case ACPI_DMT_WPBT_UNICODE:
1230 ByteLength = SubtableLength;
1231 CurrentOffset = sizeof (ACPI_TABLE_WPBT);
1234 case ACPI_DMT_UNICODE:
1235 case ACPI_DMT_BUFFER:
1236 case ACPI_DMT_RAW_BUFFER:
1238 ByteLength = SubtableLength;
1241 case ACPI_DMT_PMTT_VENDOR:
1243 * Calculate the length of the vendor data for the PMTT table:
1244 * Length = (Current Subtable ptr + Subtable length) -
1245 * Start of the vendor data (Target)
1247 ByteLength = ((ACPI_CAST_PTR (char, Table) +
1248 (ACPI_CAST_PTR (ACPI_PMTT_HEADER, Table)->Length)) -
1249 ACPI_CAST_PTR (char, Target));
1252 case ACPI_DMT_STRING:
1254 ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;
1257 case ACPI_DMT_IVRS_UNTERMINATED_STRING:
1259 ByteLength = ((ACPI_CAST_PTR (ACPI_IVRS_DEVICE_HID, Target) -1)->UidLength);
1264 if (!LastOutputBlankLine)
1266 AcpiOsPrintf ("\n");
1267 LastOutputBlankLine = TRUE;
1270 ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
1273 case ACPI_DMT_HESTNTFY:
1275 if (!LastOutputBlankLine)
1277 AcpiOsPrintf ("\n");
1278 LastOutputBlankLine = TRUE;
1281 ByteLength = sizeof (ACPI_HEST_NOTIFY);
1284 case ACPI_DMT_IORTMEM:
1286 if (!LastOutputBlankLine)
1288 LastOutputBlankLine = FALSE;
1291 ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
1300 /* Check if we are beyond a subtable, or (worse) beyond EOT */
1302 if (CurrentOffset + ByteLength > TableLength)
1307 "/**** ACPI subtable terminates early - "
1308 "may be older version (dump table) */\n");
1310 /* Move on to next subtable */
1316 "/**** ACPI table terminates "
1317 "in the middle of a data structure! */\n");
1318 return (AE_BAD_DATA);
1321 if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)
1323 AcpiOsPrintf ("%s", Info->Name);
1327 /* Start a new line and decode the opcode */
1329 AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
1331 switch (Info->Opcode)
1333 /* Single-bit Flag fields. Note: Opcode is the bit position */
1335 case ACPI_DMT_FLAG0:
1336 case ACPI_DMT_FLAG1:
1337 case ACPI_DMT_FLAG2:
1338 case ACPI_DMT_FLAG3:
1339 case ACPI_DMT_FLAG4:
1340 case ACPI_DMT_FLAG5:
1341 case ACPI_DMT_FLAG6:
1342 case ACPI_DMT_FLAG7:
1344 AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);
1347 /* 2-bit Flag fields */
1349 case ACPI_DMT_FLAGS0:
1351 AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
1354 case ACPI_DMT_FLAGS1:
1356 AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);
1359 case ACPI_DMT_FLAGS2:
1361 AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
1364 case ACPI_DMT_FLAGS4:
1366 AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);
1369 case ACPI_DMT_FLAGS4_0:
1371 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);
1374 case ACPI_DMT_FLAGS4_4:
1376 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);
1379 case ACPI_DMT_FLAGS4_8:
1381 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);
1384 case ACPI_DMT_FLAGS4_12:
1386 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);
1389 case ACPI_DMT_FLAGS16_16:
1391 AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);
1394 /* Integer Data Types */
1396 case ACPI_DMT_UINT8:
1397 case ACPI_DMT_UINT16:
1398 case ACPI_DMT_UINT24:
1399 case ACPI_DMT_UINT32:
1400 case ACPI_DMT_UINT40:
1401 case ACPI_DMT_UINT48:
1402 case ACPI_DMT_UINT56:
1403 case ACPI_DMT_UINT64:
1405 * Dump bytes - high byte first, low byte last.
1406 * Note: All ACPI tables are little-endian.
1409 for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
1411 AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
1412 Value |= Target[Temp8 - 1];
1416 if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
1418 AcpiOsPrintf (" [Optional field not present]");
1421 AcpiOsPrintf ("\n");
1425 case ACPI_DMT_BUF10:
1426 case ACPI_DMT_BUF12:
1427 case ACPI_DMT_BUF16:
1428 case ACPI_DMT_BUF18:
1429 case ACPI_DMT_BUF128:
1431 * Buffer: Size depends on the opcode and was set above.
1432 * Each hex byte is separated with a space.
1433 * Multiple lines are separated by line continuation char.
1435 for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
1437 AcpiOsPrintf ("%2.2X", Target[Temp16]);
1438 if ((UINT32) (Temp16 + 1) < ByteLength)
1440 if ((Temp16 > 0) && (!((Temp16+1) % 16)))
1442 AcpiOsPrintf (" \\\n"); /* Line continuation */
1443 AcpiDmLineHeader (0, 0, NULL);
1452 AcpiOsPrintf ("\n");
1457 /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
1459 (void) AcpiUtConvertUuidToString ((char *) Target, AslGbl_MsgBuffer);
1461 AcpiOsPrintf ("%s\n", AslGbl_MsgBuffer);
1464 case ACPI_DMT_STRING:
1466 AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
1469 case ACPI_DMT_IVRS_UNTERMINATED_STRING:
1471 AcpiOsPrintf ("\"%.*s\"\n", ByteLength, ACPI_CAST_PTR (char, Target));
1474 /* Fixed length ASCII name fields */
1478 AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1479 AcpiOsPrintf ("\"%.4s\" ", RepairedName);
1481 TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
1484 AcpiOsPrintf (STRING_FORMAT, TableData->Description);
1488 AcpiOsPrintf ("\n");
1492 case ACPI_DMT_NAME4:
1494 AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1495 AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
1498 case ACPI_DMT_NAME6:
1500 AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);
1501 AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
1504 case ACPI_DMT_NAME8:
1506 AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);
1507 AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
1510 /* Special Data Types */
1512 case ACPI_DMT_CHKSUM:
1514 /* Checksum, display and validate */
1516 AcpiOsPrintf ("%2.2X", *Target);
1517 Temp8 = AcpiDmGenerateChecksum (Table,
1518 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
1519 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
1521 if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
1524 " /* Incorrect checksum, should be %2.2X */", Temp8);
1527 AcpiOsPrintf ("\n");
1530 case ACPI_DMT_SPACEID:
1532 /* Address Space ID */
1534 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));
1537 case ACPI_DMT_ACCWIDTH:
1539 /* Encoded Access Width */
1542 if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
1544 Temp8 = ACPI_GAS_WIDTH_RESERVED;
1547 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);
1552 /* Generic Address Structure */
1554 AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
1555 Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1556 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
1557 if (ACPI_FAILURE (Status))
1562 AcpiOsPrintf ("\n");
1563 LastOutputBlankLine = TRUE;
1568 /* AEST subtable types */
1571 if (Temp8 > ACPI_AEST_NODE_TYPE_RESERVED)
1573 Temp8 = ACPI_AEST_NODE_TYPE_RESERVED;
1576 AcpiOsPrintf (UINT8_FORMAT, *Target,
1577 AcpiDmAestSubnames[Temp8]);
1580 case ACPI_DMT_AEST_CACHE:
1582 /* AEST cache resource subtable */
1585 if (Temp32 > ACPI_AEST_CACHE_RESERVED)
1587 Temp32 = ACPI_AEST_CACHE_RESERVED;
1590 AcpiOsPrintf (UINT32_FORMAT, *Target,
1591 AcpiDmAestCacheNames[Temp32]);
1594 case ACPI_DMT_AEST_GIC:
1596 /* AEST GIC error subtable */
1599 if (Temp32 > ACPI_AEST_GIC_RESERVED)
1601 Temp32 = ACPI_AEST_GIC_RESERVED;
1604 AcpiOsPrintf (UINT32_FORMAT, *Target,
1605 AcpiDmAestGicNames[Temp32]);
1608 case ACPI_DMT_AEST_RES:
1610 /* AEST resource type subtable */
1613 if (Temp8 > ACPI_AEST_RESOURCE_RESERVED)
1615 Temp8 = ACPI_AEST_RESOURCE_RESERVED;
1618 AcpiOsPrintf (UINT8_FORMAT, *Target,
1619 AcpiDmAestResourceNames[Temp8]);
1622 case ACPI_DMT_AEST_XFACE:
1624 /* AEST interface structure types */
1627 if (Temp8 > ACPI_AEST_XFACE_RESERVED)
1629 Temp8 = ACPI_AEST_XFACE_RESERVED;
1632 AcpiOsPrintf (UINT8_FORMAT, *Target,
1633 AcpiDmAestXfaceNames[Temp8]);
1636 case ACPI_DMT_AEST_XRUPT:
1638 /* AEST interrupt structure types */
1641 if (Temp8 > ACPI_AEST_XRUPT_RESERVED)
1643 Temp8 = ACPI_AEST_XRUPT_RESERVED;
1646 AcpiOsPrintf (UINT8_FORMAT, *Target,
1647 AcpiDmAestXruptNames[Temp8]);
1652 /* ASF subtable types */
1654 Temp16 = (UINT16) ((*Target) & 0x7F); /* Top bit can be zero or one */
1655 if (Temp16 > ACPI_ASF_TYPE_RESERVED)
1657 Temp16 = ACPI_ASF_TYPE_RESERVED;
1660 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
1665 /* CEDT subtable types */
1668 if (Temp8 > ACPI_CEDT_TYPE_RESERVED)
1670 Temp8 = ACPI_CEDT_TYPE_RESERVED;
1673 AcpiOsPrintf (UINT8_FORMAT, *Target,
1674 AcpiDmCedtSubnames[Temp8]);
1679 /* DMAR subtable types */
1681 Temp16 = ACPI_GET16 (Target);
1682 if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
1684 Temp16 = ACPI_DMAR_TYPE_RESERVED;
1687 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1688 AcpiDmDmarSubnames[Temp16]);
1691 case ACPI_DMT_DMAR_SCOPE:
1693 /* DMAR device scope types */
1696 if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
1698 Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
1701 AcpiOsPrintf (UINT8_FORMAT, *Target,
1702 AcpiDmDmarScope[Temp8]);
1705 case ACPI_DMT_EINJACT:
1707 /* EINJ Action types */
1710 if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
1712 Temp8 = ACPI_EINJ_ACTION_RESERVED;
1715 AcpiOsPrintf (UINT8_FORMAT, *Target,
1716 AcpiDmEinjActions[Temp8]);
1719 case ACPI_DMT_EINJINST:
1721 /* EINJ Instruction types */
1724 if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
1726 Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
1729 AcpiOsPrintf (UINT8_FORMAT, *Target,
1730 AcpiDmEinjInstructions[Temp8]);
1733 case ACPI_DMT_ERSTACT:
1735 /* ERST Action types */
1738 if (Temp8 > ACPI_ERST_ACTION_RESERVED)
1740 Temp8 = ACPI_ERST_ACTION_RESERVED;
1743 AcpiOsPrintf (UINT8_FORMAT, *Target,
1744 AcpiDmErstActions[Temp8]);
1747 case ACPI_DMT_ERSTINST:
1749 /* ERST Instruction types */
1752 if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
1754 Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
1757 AcpiOsPrintf (UINT8_FORMAT, *Target,
1758 AcpiDmErstInstructions[Temp8]);
1763 /* GTDT subtable types */
1766 if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
1768 Temp8 = ACPI_GTDT_TYPE_RESERVED;
1771 AcpiOsPrintf (UINT8_FORMAT, *Target,
1772 AcpiDmGtdtSubnames[Temp8]);
1777 /* HEST subtable types */
1779 Temp16 = ACPI_GET16 (Target);
1780 if (Temp16 > ACPI_HEST_TYPE_RESERVED)
1782 Temp16 = ACPI_HEST_TYPE_RESERVED;
1785 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1786 AcpiDmHestSubnames[Temp16]);
1789 case ACPI_DMT_HESTNTFY:
1791 AcpiOsPrintf (STRING_FORMAT,
1792 "Hardware Error Notification Structure");
1794 Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1795 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
1796 if (ACPI_FAILURE (Status))
1801 AcpiOsPrintf ("\n");
1802 LastOutputBlankLine = TRUE;
1805 case ACPI_DMT_HESTNTYP:
1807 /* HEST Notify types */
1810 if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)
1812 Temp8 = ACPI_HEST_NOTIFY_RESERVED;
1815 AcpiOsPrintf (UINT8_FORMAT, *Target,
1816 AcpiDmHestNotifySubnames[Temp8]);
1821 /* HMAT subtable types */
1824 if (Temp16 > ACPI_HMAT_TYPE_RESERVED)
1826 Temp16 = ACPI_HMAT_TYPE_RESERVED;
1829 AcpiOsPrintf (UINT16_FORMAT, *Target,
1830 AcpiDmHmatSubnames[Temp16]);
1833 case ACPI_DMT_IORTMEM:
1835 AcpiOsPrintf (STRING_FORMAT,
1836 "IORT Memory Access Properties");
1838 Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1839 sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
1840 if (ACPI_FAILURE (Status))
1845 LastOutputBlankLine = TRUE;
1850 /* MADT subtable types */
1853 if (Temp8 > ACPI_MADT_TYPE_RESERVED)
1855 Temp8 = ACPI_MADT_TYPE_RESERVED;
1858 AcpiOsPrintf (UINT8_FORMAT, *Target,
1859 AcpiDmMadtSubnames[Temp8]);
1864 /* NFIT subtable types */
1866 Temp16 = ACPI_GET16 (Target);
1867 if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
1869 Temp16 = ACPI_NFIT_TYPE_RESERVED;
1872 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1873 AcpiDmNfitSubnames[Temp16]);
1876 case ACPI_DMT_NHLT1:
1878 /* NHLT link types */
1881 if (Temp8 > ACPI_NHLT_TYPE_RESERVED)
1883 Temp8 = ACPI_NHLT_TYPE_RESERVED;
1886 AcpiOsPrintf (UINT8_FORMAT, *Target,
1887 AcpiDmNhltLinkTypeNames[Temp8]);
1890 case ACPI_DMT_NHLT1a:
1892 /* NHLT direction */
1895 if (Temp8 > ACPI_NHLT_DIR_RESERVED)
1897 Temp8 = ACPI_NHLT_DIR_RESERVED;
1900 AcpiOsPrintf (UINT8_FORMAT, *Target,
1901 AcpiDmNhltDirectionNames[Temp8]);
1904 case ACPI_DMT_NHLT1b:
1906 /* NHLT microphone type */
1909 if (Temp8 > ACPI_NHLT_MIC_RESERVED)
1911 Temp8 = ACPI_NHLT_MIC_RESERVED;
1914 AcpiOsPrintf (UINT8_FORMAT, *Target,
1915 AcpiDmNhltMicTypeNames[Temp8]);
1918 case ACPI_DMT_NHLT1c:
1920 /* NHLT microphone position */
1923 if (Temp8 > ACPI_NHLT_MIC_POSITION_RESERVED)
1925 Temp8 = ACPI_NHLT_MIC_POSITION_RESERVED;
1928 AcpiOsPrintf (UINT8_FORMAT, *Target,
1929 AcpiDmNhltMicPositionNames[Temp8]);
1932 case ACPI_DMT_NHLT1d:
1934 /* NHLT microphone array type */
1936 Temp8 = *Target & ACPI_NHLT_ARRAY_TYPE_MASK;
1937 if (Temp8 < ACPI_NHLT_ARRAY_TYPE_RESERVED)
1939 Temp8 = ACPI_NHLT_ARRAY_TYPE_RESERVED;
1942 AcpiOsPrintf (UINT8_FORMAT_NO_NEWLINE, *Target,
1943 AcpiDmNhltMicArrayTypeNames[Temp8 - ACPI_NHLT_ARRAY_TYPE_RESERVED]);
1946 if (Temp8 & ACPI_NHLT_MIC_SNR_SENSITIVITY_EXT)
1948 AcpiOsPrintf (" [%s]", "SNR and Sensitivity");
1951 AcpiOsPrintf ("\n");
1954 case ACPI_DMT_NHLT1e:
1956 /* NHLT Endpoint Device ID */
1958 Temp16 = ACPI_GET16 (Target);
1959 if (Temp16 == 0xAE20)
1963 else if (Temp16 == 0xAE30)
1965 Name = "BT Sideband";
1967 else if (Temp16 == 0xAE34)
1969 Name = "I2S/TDM Codecs";
1973 Name = "Unknown Device ID";
1976 AcpiOsPrintf (UINT16_FORMAT, Temp16, Name);
1979 case ACPI_DMT_NHLT1f:
1981 /* NHLT ConfigType field */
1984 if (Temp8 > ACPI_NHLT_CONFIG_TYPE_RESERVED)
1986 Temp8 = ACPI_NHLT_CONFIG_TYPE_RESERVED;
1989 AcpiOsPrintf (UINT8_FORMAT, *Target,
1990 AcpiDmNhltConfigTypeNames[Temp8]);
1995 /* PCCT subtable types */
1998 if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
2000 Temp8 = ACPI_PCCT_TYPE_RESERVED;
2003 AcpiOsPrintf (UINT8_FORMAT, *Target,
2004 AcpiDmPcctSubnames[Temp8]);
2009 /* PMTT subtable types */
2012 if (Temp16 > ACPI_PHAT_TYPE_RESERVED)
2014 Temp16 = ACPI_PHAT_TYPE_RESERVED;
2017 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16(Target),
2018 AcpiDmPhatSubnames[Temp16]);
2023 /* PMTT subtable types */
2026 if (Temp8 == ACPI_PMTT_TYPE_VENDOR)
2028 Temp8 = ACPI_PMTT_TYPE_RESERVED + 1;
2030 else if (Temp8 > ACPI_PMTT_TYPE_RESERVED)
2032 Temp8 = ACPI_PMTT_TYPE_RESERVED;
2034 AcpiOsPrintf (UINT8_FORMAT, *Target,
2035 AcpiDmPmttSubnames[Temp8]);
2040 /* PPTT subtable types */
2043 if (Temp8 > ACPI_PPTT_TYPE_RESERVED)
2045 Temp8 = ACPI_PPTT_TYPE_RESERVED;
2048 AcpiOsPrintf (UINT8_FORMAT, *Target,
2049 AcpiDmPpttSubnames[Temp8]);
2052 case ACPI_DMT_UNICODE:
2053 case ACPI_DMT_WPBT_UNICODE:
2055 if (ByteLength == 0)
2057 AcpiOsPrintf ("/* Zero-length Data */\n");
2061 AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength);
2064 case ACPI_DMT_RAW_BUFFER:
2065 case ACPI_DMT_BUFFER:
2066 case ACPI_DMT_PMTT_VENDOR:
2068 if (ByteLength == 0)
2070 AcpiOsPrintf ("/* Zero-length Data */\n");
2074 AcpiDmDumpBuffer (Target, 0, ByteLength, CurrentOffset, NULL);
2079 /* RGRT subtable types */
2082 if (Temp8 >= ACPI_RGRT_TYPE_RESERVED)
2084 Temp8 = ACPI_RGRT_TYPE_RESERVED0;
2087 AcpiOsPrintf (UINT8_FORMAT, *Target,
2088 AcpiDmRgrtSubnames[Temp8]);
2093 /* SDEV subtable types */
2096 if (Temp8 > ACPI_SDEV_TYPE_RESERVED)
2098 Temp8 = ACPI_SDEV_TYPE_RESERVED;
2101 AcpiOsPrintf (UINT8_FORMAT, *Target,
2102 AcpiDmSdevSubnames[Temp8]);
2107 /* SRAT subtable types */
2110 if (Temp8 > ACPI_SRAT_TYPE_RESERVED)
2112 Temp8 = ACPI_SRAT_TYPE_RESERVED;
2115 AcpiOsPrintf (UINT8_FORMAT, *Target,
2116 AcpiDmSratSubnames[Temp8]);
2121 /* TPM2 Start Method types */
2124 if (Temp8 > ACPI_TPM2_RESERVED)
2126 Temp8 = ACPI_TPM2_RESERVED;
2129 AcpiOsPrintf (UINT8_FORMAT, *Target,
2130 AcpiDmTpm2Subnames[Temp8]);
2134 case ACPI_DMT_FADTPM:
2136 /* FADT Preferred PM Profile names */
2139 if (Temp8 > ACPI_FADT_PM_RESERVED)
2141 Temp8 = ACPI_FADT_PM_RESERVED;
2144 AcpiOsPrintf (UINT8_FORMAT, *Target,
2145 AcpiDmFadtProfiles[Temp8]);
2150 /* IVRS subtable types */
2155 case ACPI_IVRS_TYPE_HARDWARE1:
2156 case ACPI_IVRS_TYPE_HARDWARE2:
2158 Name = AcpiDmIvrsSubnames[0];
2161 case ACPI_IVRS_TYPE_HARDWARE3:
2163 Name = AcpiDmIvrsSubnames[1];
2166 case ACPI_IVRS_TYPE_MEMORY1:
2167 case ACPI_IVRS_TYPE_MEMORY2:
2168 case ACPI_IVRS_TYPE_MEMORY3:
2170 Name = AcpiDmIvrsSubnames[2];
2175 Name = AcpiDmIvrsSubnames[3];
2179 AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
2182 case ACPI_DMT_IVRS_DE:
2184 /* IVRS device entry types */
2189 case ACPI_IVRS_TYPE_ALL:
2190 case ACPI_IVRS_TYPE_SELECT:
2191 case ACPI_IVRS_TYPE_START:
2192 case ACPI_IVRS_TYPE_END:
2194 Name = AcpiDmIvrsDevEntryNames[Temp8];
2197 case ACPI_IVRS_TYPE_ALIAS_SELECT:
2198 case ACPI_IVRS_TYPE_ALIAS_START:
2199 case ACPI_IVRS_TYPE_EXT_SELECT:
2200 case ACPI_IVRS_TYPE_EXT_START:
2201 case ACPI_IVRS_TYPE_SPECIAL:
2203 Name = AcpiDmIvrsDevEntryNames[Temp8 - 61];
2206 case ACPI_IVRS_TYPE_HID:
2208 Name = AcpiDmIvrsDevEntryNames[Temp8 - 228];
2212 Name = AcpiDmIvrsDevEntryNames[0]; /* Unknown/Reserved */
2216 AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
2221 /* LPIT subtable types */
2223 Temp32 = ACPI_GET32 (Target);
2224 if (Temp32 > ACPI_LPIT_TYPE_RESERVED)
2226 Temp32 = ACPI_LPIT_TYPE_RESERVED;
2229 AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),
2230 AcpiDmLpitSubnames[Temp32]);
2235 /* VIOT subtable types */
2238 if (Temp8 > ACPI_VIOT_RESERVED)
2240 Temp8 = ACPI_VIOT_RESERVED;
2243 AcpiOsPrintf (UINT8_FORMAT, *Target,
2244 AcpiDmViotSubnames[Temp8]);
2253 ACPI_ERROR ((AE_INFO,
2254 "**** Invalid table opcode [0x%X] ****\n", Info->Opcode));
2255 return (AE_SUPPORT);
2259 if (TableOffset && !SubtableLength)
2262 * If this table is not the main table, the subtable must have a
2265 AcpiOsPrintf ("Invalid zero length subtable\n");
2266 return (AE_BAD_DATA);