Sync ACPICA with Intel's version 20180927:
[dragonfly.git] / sys / contrib / dev / acpica / source / common / dmtable.c
blob5bdf4780503968a6c31376a4673e53bb5103e1ef
1 /******************************************************************************
3 * Module Name: dmtable - Support for ACPI tables that contain no AML code
5 *****************************************************************************/
7 /******************************************************************************
9 * 1. Copyright Notice
11 * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12 * All rights reserved.
14 * 2. License
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.
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
38 * conditions are met:
40 * 3. Conditions
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
64 * make.
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.
72 * 3.4. Intel retains all right, title, and interest in and to the Original
73 * Intel Code.
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
88 * PARTICULAR PURPOSE.
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.
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
117 * following license:
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.
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 *****************************************************************************/
152 #include "acpi.h"
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")
163 const AH_TABLE *
164 AcpiAhGetTableInfo (
165 char *Signature);
168 /* Common format strings for commented values */
170 #define UINT8_FORMAT "%2.2X [%s]\n"
171 #define UINT16_FORMAT "%4.4X [%s]\n"
172 #define UINT32_FORMAT "%8.8X [%s]\n"
173 #define STRING_FORMAT "[%s]\n"
175 /* These tables map a subtable type to a description string */
177 static const char *AcpiDmAsfSubnames[] =
179 "ASF Information",
180 "ASF Alerts",
181 "ASF Remote Control",
182 "ASF RMCP Boot Options",
183 "ASF Address",
184 "Unknown Subtable Type" /* Reserved */
187 static const char *AcpiDmDmarSubnames[] =
189 "Hardware Unit Definition",
190 "Reserved Memory Region",
191 "Root Port ATS Capability",
192 "Remapping Hardware Static Affinity",
193 "ACPI Namespace Device Declaration",
194 "Unknown Subtable Type" /* Reserved */
197 static const char *AcpiDmDmarScope[] =
199 "Reserved value",
200 "PCI Endpoint Device",
201 "PCI Bridge Device",
202 "IOAPIC Device",
203 "Message-capable HPET Device",
204 "Namespace Device",
205 "Unknown Scope Type" /* Reserved */
208 static const char *AcpiDmEinjActions[] =
210 "Begin Operation",
211 "Get Trigger Table",
212 "Set Error Type",
213 "Get Error Type",
214 "End Operation",
215 "Execute Operation",
216 "Check Busy Status",
217 "Get Command Status",
218 "Set Error Type With Address",
219 "Get Execute Timings",
220 "Unknown Action"
223 static const char *AcpiDmEinjInstructions[] =
225 "Read Register",
226 "Read Register Value",
227 "Write Register",
228 "Write Register Value",
229 "Noop",
230 "Flush Cacheline",
231 "Unknown Instruction"
234 static const char *AcpiDmErstActions[] =
236 "Begin Write Operation",
237 "Begin Read Operation",
238 "Begin Clear Operation",
239 "End Operation",
240 "Set Record Offset",
241 "Execute Operation",
242 "Check Busy Status",
243 "Get Command Status",
244 "Get Record Identifier",
245 "Set Record Identifier",
246 "Get Record Count",
247 "Begin Dummy Write",
248 "Unused/Unknown Action",
249 "Get Error Address Range",
250 "Get Error Address Length",
251 "Get Error Attributes",
252 "Execute Timings",
253 "Unknown Action"
256 static const char *AcpiDmErstInstructions[] =
258 "Read Register",
259 "Read Register Value",
260 "Write Register",
261 "Write Register Value",
262 "Noop",
263 "Load Var1",
264 "Load Var2",
265 "Store Var1",
266 "Add",
267 "Subtract",
268 "Add Value",
269 "Subtract Value",
270 "Stall",
271 "Stall While True",
272 "Skip Next If True",
273 "GoTo",
274 "Set Source Address",
275 "Set Destination Address",
276 "Move Data",
277 "Unknown Instruction"
280 static const char *AcpiDmGtdtSubnames[] =
282 "Generic Timer Block",
283 "Generic Watchdog Timer",
284 "Unknown Subtable Type" /* Reserved */
287 static const char *AcpiDmHestSubnames[] =
289 "IA-32 Machine Check Exception",
290 "IA-32 Corrected Machine Check",
291 "IA-32 Non-Maskable Interrupt",
292 "Unknown Subtable Type", /* 3 - Reserved */
293 "Unknown Subtable Type", /* 4 - Reserved */
294 "Unknown Subtable Type", /* 5 - Reserved */
295 "PCI Express Root Port AER",
296 "PCI Express AER (AER Endpoint)",
297 "PCI Express/PCI-X Bridge AER",
298 "Generic Hardware Error Source",
299 "Generic Hardware Error Source V2",
300 "IA-32 Deferred Machine Check",
301 "Unknown Subtable Type" /* Reserved */
304 static const char *AcpiDmHestNotifySubnames[] =
306 "Polled",
307 "External Interrupt",
308 "Local Interrupt",
309 "SCI",
310 "NMI",
311 "CMCI", /* ACPI 5.0 */
312 "MCE", /* ACPI 5.0 */
313 "GPIO", /* ACPI 6.0 */
314 "SEA", /* ACPI 6.1 */
315 "SEI", /* ACPI 6.1 */
316 "GSIV", /* ACPI 6.1 */
317 "Software Delegated Exception", /* ACPI 6.2 */
318 "Unknown Notify Type" /* Reserved */
321 static const char *AcpiDmHmatSubnames[] =
323 "Memory Subystem Address Range",
324 "System Locality Latency and Bandwidth Information",
325 "Memory Side Cache Information",
326 "Unknown Structure Type" /* Reserved */
329 static const char *AcpiDmMadtSubnames[] =
331 "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
332 "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
333 "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
334 "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
335 "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
336 "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
337 "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
338 "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
339 "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
340 "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
341 "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
342 "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
343 "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */
344 "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */
345 "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
346 "Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */
347 "Unknown Subtable Type" /* Reserved */
350 static const char *AcpiDmNfitSubnames[] =
352 "System Physical Address Range", /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */
353 "Memory Range Map", /* ACPI_NFIT_TYPE_MEMORY_MAP */
354 "Interleave Info", /* ACPI_NFIT_TYPE_INTERLEAVE */
355 "SMBIOS Information", /* ACPI_NFIT_TYPE_SMBIOS */
356 "NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */
357 "NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */
358 "Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */
359 "Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */
360 "Unknown Subtable Type" /* Reserved */
363 static const char *AcpiDmPcctSubnames[] =
365 "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
366 "HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
367 "HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */
368 "Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */
369 "Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */
370 "Unknown Subtable Type" /* Reserved */
373 static const char *AcpiDmPmttSubnames[] =
375 "Socket", /* ACPI_PMTT_TYPE_SOCKET */
376 "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */
377 "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */
378 "Unknown Subtable Type" /* Reserved */
381 static const char *AcpiDmPpttSubnames[] =
383 "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */
384 "Cache Type", /* ACPI_PPTT_TYPE_CACHE */
385 "ID", /* ACPI_PPTT_TYPE_ID */
386 "Unknown Subtable Type" /* Reserved */
389 static const char *AcpiDmSdevSubnames[] =
391 "Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */
392 "PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */
393 "Unknown Subtable Type" /* Reserved */
396 static const char *AcpiDmSratSubnames[] =
398 "Processor Local APIC/SAPIC Affinity",
399 "Memory Affinity",
400 "Processor Local x2APIC Affinity",
401 "GICC Affinity",
402 "GIC ITS Affinity", /* Acpi 6.2 */
403 "Unknown Subtable Type" /* Reserved */
406 static const char *AcpiDmTpm2Subnames[] =
408 "Illegal Start Method value",
409 "Reserved",
410 "ACPI Start Method",
411 "Reserved",
412 "Reserved",
413 "Reserved",
414 "Memory Mapped I/O",
415 "Command Response Buffer",
416 "Command Response Buffer with ACPI Start Method",
417 "Reserved",
418 "Reserved",
419 "Command Response Buffer with ARM SMC",
420 "Unknown Subtable Type" /* Reserved */
423 static const char *AcpiDmIvrsSubnames[] =
425 "Hardware Definition Block",
426 "Memory Definition Block",
427 "Unknown Subtable Type" /* Reserved */
430 static const char *AcpiDmLpitSubnames[] =
432 "Native C-state Idle Structure",
433 "Unknown Subtable Type" /* Reserved */
436 #define ACPI_FADT_PM_RESERVED 9
438 static const char *AcpiDmFadtProfiles[] =
440 "Unspecified",
441 "Desktop",
442 "Mobile",
443 "Workstation",
444 "Enterprise Server",
445 "SOHO Server",
446 "Appliance PC",
447 "Performance Server",
448 "Tablet",
449 "Unknown Profile Type"
452 #define ACPI_GAS_WIDTH_RESERVED 5
454 static const char *AcpiDmGasAccessWidth[] =
456 "Undefined/Legacy",
457 "Byte Access:8",
458 "Word Access:16",
459 "DWord Access:32",
460 "QWord Access:64",
461 "Unknown Width Encoding"
465 /*******************************************************************************
467 * ACPI Table Data, indexed by signature.
469 * Each entry contains: Signature, Table Info, Handler, DtHandler,
470 * Template, Description
472 * Simple tables have only a TableInfo structure, complex tables have a
473 * handler. This table must be NULL terminated. RSDP and FACS are
474 * special-cased elsewhere.
476 * Note: Any tables added here should be duplicated within AcpiSupportedTables
477 * in the file common/ahtable.c
479 ******************************************************************************/
481 const ACPI_DMTABLE_DATA AcpiDmTableData[] =
483 {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf},
484 {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
485 {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
486 {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
487 {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
488 {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
489 {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},
490 {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp},
491 {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar},
492 {ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm},
493 {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt},
494 {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj},
495 {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst},
496 {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt},
497 {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt},
498 {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt},
499 {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest},
500 {ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat},
501 {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet},
502 {ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort},
503 {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs},
504 {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit},
505 {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt},
506 {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg},
507 {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi},
508 {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst},
509 {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct},
510 {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm},
511 {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr},
512 {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit},
513 {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct},
514 {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt},
515 {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt},
516 {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt},
517 {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf},
518 {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},
519 {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},
520 {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},
521 {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei},
522 {ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev},
523 {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic},
524 {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit},
525 {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr},
526 {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi},
527 {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat},
528 {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao},
529 {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa},
530 {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2},
531 {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi},
532 {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc},
533 {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet},
534 {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat},
535 {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt},
536 {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt},
537 {ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt},
538 {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt},
539 {ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv},
540 {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt},
541 {NULL, NULL, NULL, NULL, NULL}
545 /*******************************************************************************
547 * FUNCTION: AcpiDmGenerateChecksum
549 * PARAMETERS: Table - Pointer to table to be checksummed
550 * Length - Length of the table
551 * OriginalChecksum - Value of the checksum field
553 * RETURN: 8 bit checksum of buffer
555 * DESCRIPTION: Computes an 8 bit checksum of the table.
557 ******************************************************************************/
559 UINT8
560 AcpiDmGenerateChecksum (
561 void *Table,
562 UINT32 Length,
563 UINT8 OriginalChecksum)
565 UINT8 Checksum;
568 /* Sum the entire table as-is */
570 Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
572 /* Subtract off the existing checksum value in the table */
574 Checksum = (UINT8) (Checksum - OriginalChecksum);
576 /* Compute the final checksum */
578 Checksum = (UINT8) (0 - Checksum);
579 return (Checksum);
583 /*******************************************************************************
585 * FUNCTION: AcpiDmGetTableData
587 * PARAMETERS: Signature - ACPI signature (4 chars) to match
589 * RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.
591 * DESCRIPTION: Find a match in the global table of supported ACPI tables
593 ******************************************************************************/
595 const ACPI_DMTABLE_DATA *
596 AcpiDmGetTableData (
597 char *Signature)
599 const ACPI_DMTABLE_DATA *Info;
602 for (Info = AcpiDmTableData; Info->Signature; Info++)
604 if (ACPI_COMPARE_NAME (Signature, Info->Signature))
606 return (Info);
610 return (NULL);
614 /*******************************************************************************
616 * FUNCTION: AcpiDmDumpDataTable
618 * PARAMETERS: Table - An ACPI table
620 * RETURN: None.
622 * DESCRIPTION: Format the contents of an ACPI data table (any table other
623 * than an SSDT or DSDT that does not contain executable AML code)
625 ******************************************************************************/
627 void
628 AcpiDmDumpDataTable (
629 ACPI_TABLE_HEADER *Table)
631 ACPI_STATUS Status;
632 const ACPI_DMTABLE_DATA *TableData;
633 UINT32 Length;
636 /* Ignore tables that contain AML */
638 if (AcpiUtIsAmlTable (Table))
640 if (AslGbl_VerboseTemplates)
642 /* Dump the raw table data */
644 Length = Table->Length;
646 AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
647 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
648 AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
649 Length, DB_BYTE_DISPLAY, 0);
650 AcpiOsPrintf (" */\n");
652 return;
656 * Handle tables that don't use the common ACPI table header structure.
657 * Currently, these are the FACS, RSDP, and S3PT.
659 if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
661 Length = Table->Length;
662 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
663 if (ACPI_FAILURE (Status))
665 return;
668 else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
670 Length = AcpiDmDumpRsdp (Table);
672 else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT))
674 Length = AcpiDmDumpS3pt (Table);
676 else
679 * All other tables must use the common ACPI table header, dump it now
681 Length = Table->Length;
682 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
683 if (ACPI_FAILURE (Status))
685 return;
687 AcpiOsPrintf ("\n");
689 /* Match signature and dispatch appropriately */
691 TableData = AcpiDmGetTableData (Table->Signature);
692 if (!TableData)
694 if (!strncmp (Table->Signature, "OEM", 3))
696 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
697 Table->Signature);
699 else
701 AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
702 Table->Signature);
704 fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
705 Table->Signature);
707 if (!AcpiGbl_ForceAmlDisassembly)
709 fprintf (stderr, "decoding ACPI table header only\n");
711 else
713 fprintf (stderr, "assuming table contains valid AML code\n");
717 else if (TableData->TableHandler)
719 /* Complex table, has a handler */
721 TableData->TableHandler (Table);
723 else if (TableData->TableInfo)
725 /* Simple table, just walk the info table */
727 Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
728 if (ACPI_FAILURE (Status))
730 return;
735 if (!AslGbl_DoTemplates || AslGbl_VerboseTemplates)
737 /* Dump the raw table data */
739 AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
740 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
741 AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
742 Length, DB_BYTE_DISPLAY, 0);
747 /*******************************************************************************
749 * FUNCTION: AcpiDmLineHeader
751 * PARAMETERS: Offset - Current byte offset, from table start
752 * ByteLength - Length of the field in bytes, 0 for flags
753 * Name - Name of this field
755 * RETURN: None
757 * DESCRIPTION: Utility routines for formatting output lines. Displays the
758 * current table offset in hex and decimal, the field length,
759 * and the field name.
761 ******************************************************************************/
763 void
764 AcpiDmLineHeader (
765 UINT32 Offset,
766 UINT32 ByteLength,
767 char *Name)
770 /* Allow a null name for fields that span multiple lines (large buffers) */
772 if (!Name)
774 Name = "";
777 if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */
779 if (ByteLength)
781 AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
783 else
785 if (*Name)
787 AcpiOsPrintf ("%41s : ", Name);
789 else
791 AcpiOsPrintf ("%41s ", Name);
795 else /* Normal disassembler or verbose template */
797 if (ByteLength)
799 AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
800 Offset, Offset, ByteLength, Name);
802 else
804 if (*Name)
806 AcpiOsPrintf ("%44s : ", Name);
808 else
810 AcpiOsPrintf ("%44s ", Name);
816 void
817 AcpiDmLineHeader2 (
818 UINT32 Offset,
819 UINT32 ByteLength,
820 char *Name,
821 UINT32 Value)
824 if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */
826 if (ByteLength)
828 AcpiOsPrintf ("[%.4d] %30s %3d : ",
829 ByteLength, Name, Value);
831 else
833 AcpiOsPrintf ("%36s % 3d : ",
834 Name, Value);
837 else /* Normal disassembler or verbose template */
839 if (ByteLength)
841 AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ",
842 Offset, Offset, ByteLength, Name, Value);
844 else
846 AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ",
847 Offset, Offset, Name, Value);
853 /*******************************************************************************
855 * FUNCTION: AcpiDmDumpTable
857 * PARAMETERS: TableLength - Length of the entire ACPI table
858 * TableOffset - Starting offset within the table for this
859 * sub-descriptor (0 if main table)
860 * Table - The ACPI table
861 * SubtableLength - Length of this sub-descriptor
862 * Info - Info table for this ACPI table
864 * RETURN: Status
866 * DESCRIPTION: Display ACPI table contents by walking the Info table.
868 * Note: This function must remain in sync with DtGetFieldLength.
870 ******************************************************************************/
872 ACPI_STATUS
873 AcpiDmDumpTable (
874 UINT32 TableLength,
875 UINT32 TableOffset,
876 void *Table,
877 UINT32 SubtableLength,
878 ACPI_DMTABLE_INFO *Info)
880 UINT8 *Target;
881 UINT32 CurrentOffset;
882 UINT32 ByteLength;
883 UINT8 Temp8;
884 UINT16 Temp16;
885 UINT32 Temp32;
886 UINT64 Value;
887 const AH_TABLE *TableData;
888 const char *Name;
889 BOOLEAN LastOutputBlankLine = FALSE;
890 ACPI_STATUS Status;
891 char RepairedName[8];
894 if (!Info)
896 AcpiOsPrintf ("Display not implemented\n");
897 return (AE_NOT_IMPLEMENTED);
900 /* Walk entire Info table; Null name terminates */
902 for (; Info->Name; Info++)
905 * Target points to the field within the ACPI Table. CurrentOffset is
906 * the offset of the field from the start of the main table.
908 Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
909 CurrentOffset = TableOffset + Info->Offset;
911 /* Check for beyond subtable end or (worse) beyond EOT */
913 if (SubtableLength && (Info->Offset >= SubtableLength))
915 AcpiOsPrintf (
916 "/**** ACPI subtable terminates early - "
917 "may be older version (dump table) */\n");
919 /* Move on to next subtable */
921 return (AE_OK);
924 if (CurrentOffset >= TableLength)
926 AcpiOsPrintf (
927 "/**** ACPI table terminates "
928 "in the middle of a data structure! (dump table) */\n");
929 return (AE_BAD_DATA);
932 /* Generate the byte length for this field */
934 switch (Info->Opcode)
936 case ACPI_DMT_UINT8:
937 case ACPI_DMT_CHKSUM:
938 case ACPI_DMT_SPACEID:
939 case ACPI_DMT_ACCWIDTH:
940 case ACPI_DMT_IVRS:
941 case ACPI_DMT_GTDT:
942 case ACPI_DMT_MADT:
943 case ACPI_DMT_PCCT:
944 case ACPI_DMT_PMTT:
945 case ACPI_DMT_PPTT:
946 case ACPI_DMT_SDEV:
947 case ACPI_DMT_SRAT:
948 case ACPI_DMT_ASF:
949 case ACPI_DMT_HESTNTYP:
950 case ACPI_DMT_FADTPM:
951 case ACPI_DMT_EINJACT:
952 case ACPI_DMT_EINJINST:
953 case ACPI_DMT_ERSTACT:
954 case ACPI_DMT_ERSTINST:
955 case ACPI_DMT_DMAR_SCOPE:
957 ByteLength = 1;
958 break;
960 case ACPI_DMT_UINT16:
961 case ACPI_DMT_DMAR:
962 case ACPI_DMT_HEST:
963 case ACPI_DMT_HMAT:
964 case ACPI_DMT_NFIT:
966 ByteLength = 2;
967 break;
969 case ACPI_DMT_UINT24:
971 ByteLength = 3;
972 break;
974 case ACPI_DMT_UINT32:
975 case ACPI_DMT_NAME4:
976 case ACPI_DMT_SIG:
977 case ACPI_DMT_LPIT:
978 case ACPI_DMT_TPM2:
980 ByteLength = 4;
981 break;
983 case ACPI_DMT_UINT40:
985 ByteLength = 5;
986 break;
988 case ACPI_DMT_UINT48:
989 case ACPI_DMT_NAME6:
991 ByteLength = 6;
992 break;
994 case ACPI_DMT_UINT56:
995 case ACPI_DMT_BUF7:
997 ByteLength = 7;
998 break;
1000 case ACPI_DMT_UINT64:
1001 case ACPI_DMT_NAME8:
1003 ByteLength = 8;
1004 break;
1006 case ACPI_DMT_BUF10:
1008 ByteLength = 10;
1009 break;
1011 case ACPI_DMT_BUF12:
1013 ByteLength = 12;
1014 break;
1016 case ACPI_DMT_BUF16:
1017 case ACPI_DMT_UUID:
1019 ByteLength = 16;
1020 break;
1022 case ACPI_DMT_BUF128:
1024 ByteLength = 128;
1025 break;
1027 case ACPI_DMT_UNICODE:
1028 case ACPI_DMT_BUFFER:
1029 case ACPI_DMT_RAW_BUFFER:
1031 ByteLength = SubtableLength;
1032 break;
1034 case ACPI_DMT_STRING:
1036 ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;
1037 break;
1039 case ACPI_DMT_GAS:
1041 if (!LastOutputBlankLine)
1043 AcpiOsPrintf ("\n");
1044 LastOutputBlankLine = TRUE;
1047 ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
1048 break;
1050 case ACPI_DMT_HESTNTFY:
1052 if (!LastOutputBlankLine)
1054 AcpiOsPrintf ("\n");
1055 LastOutputBlankLine = TRUE;
1058 ByteLength = sizeof (ACPI_HEST_NOTIFY);
1059 break;
1061 case ACPI_DMT_IORTMEM:
1063 if (!LastOutputBlankLine)
1065 LastOutputBlankLine = FALSE;
1068 ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
1069 break;
1071 default:
1073 ByteLength = 0;
1074 break;
1077 /* Check if we are beyond a subtable, or (worse) beyond EOT */
1079 if (CurrentOffset + ByteLength > TableLength)
1081 if (SubtableLength)
1083 AcpiOsPrintf (
1084 "/**** ACPI subtable terminates early - "
1085 "may be older version (dump table) */\n");
1087 /* Move on to next subtable */
1089 return (AE_OK);
1092 AcpiOsPrintf (
1093 "/**** ACPI table terminates "
1094 "in the middle of a data structure! */\n");
1095 return (AE_BAD_DATA);
1098 if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)
1100 AcpiOsPrintf ("%s", Info->Name);
1101 continue;
1104 /* Start a new line and decode the opcode */
1106 AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
1108 switch (Info->Opcode)
1110 /* Single-bit Flag fields. Note: Opcode is the bit position */
1112 case ACPI_DMT_FLAG0:
1113 case ACPI_DMT_FLAG1:
1114 case ACPI_DMT_FLAG2:
1115 case ACPI_DMT_FLAG3:
1116 case ACPI_DMT_FLAG4:
1117 case ACPI_DMT_FLAG5:
1118 case ACPI_DMT_FLAG6:
1119 case ACPI_DMT_FLAG7:
1121 AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);
1122 break;
1124 /* 2-bit Flag fields */
1126 case ACPI_DMT_FLAGS0:
1128 AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
1129 break;
1131 case ACPI_DMT_FLAGS1:
1133 AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);
1134 break;
1136 case ACPI_DMT_FLAGS2:
1138 AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
1139 break;
1141 case ACPI_DMT_FLAGS4:
1143 AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);
1144 break;
1146 case ACPI_DMT_FLAGS4_0:
1148 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);
1149 break;
1151 case ACPI_DMT_FLAGS4_4:
1153 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);
1154 break;
1156 case ACPI_DMT_FLAGS4_8:
1158 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);
1159 break;
1161 case ACPI_DMT_FLAGS4_12:
1163 AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);
1164 break;
1166 case ACPI_DMT_FLAGS16_16:
1168 AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);
1169 break;
1171 /* Integer Data Types */
1173 case ACPI_DMT_UINT8:
1174 case ACPI_DMT_UINT16:
1175 case ACPI_DMT_UINT24:
1176 case ACPI_DMT_UINT32:
1177 case ACPI_DMT_UINT40:
1178 case ACPI_DMT_UINT48:
1179 case ACPI_DMT_UINT56:
1180 case ACPI_DMT_UINT64:
1182 * Dump bytes - high byte first, low byte last.
1183 * Note: All ACPI tables are little-endian.
1185 Value = 0;
1186 for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
1188 AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
1189 Value |= Target[Temp8 - 1];
1190 Value <<= 8;
1193 if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
1195 AcpiOsPrintf (" [Optional field not present]");
1198 AcpiOsPrintf ("\n");
1199 break;
1201 case ACPI_DMT_BUF7:
1202 case ACPI_DMT_BUF10:
1203 case ACPI_DMT_BUF12:
1204 case ACPI_DMT_BUF16:
1205 case ACPI_DMT_BUF128:
1207 * Buffer: Size depends on the opcode and was set above.
1208 * Each hex byte is separated with a space.
1209 * Multiple lines are separated by line continuation char.
1211 for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
1213 AcpiOsPrintf ("%2.2X", Target[Temp16]);
1214 if ((UINT32) (Temp16 + 1) < ByteLength)
1216 if ((Temp16 > 0) && (!((Temp16+1) % 16)))
1218 AcpiOsPrintf (" \\\n"); /* Line continuation */
1219 AcpiDmLineHeader (0, 0, NULL);
1221 else
1223 AcpiOsPrintf (" ");
1228 AcpiOsPrintf ("\n");
1229 break;
1231 case ACPI_DMT_UUID:
1233 /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
1235 (void) AuConvertUuidToString ((char *) Target, AslGbl_MsgBuffer);
1237 AcpiOsPrintf ("%s\n", AslGbl_MsgBuffer);
1238 break;
1240 case ACPI_DMT_STRING:
1242 AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
1243 break;
1245 /* Fixed length ASCII name fields */
1247 case ACPI_DMT_SIG:
1249 AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1250 AcpiOsPrintf ("\"%.4s\" ", RepairedName);
1252 TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));
1253 if (TableData)
1255 AcpiOsPrintf (STRING_FORMAT, TableData->Description);
1257 else
1259 AcpiOsPrintf ("\n");
1261 break;
1263 case ACPI_DMT_NAME4:
1265 AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);
1266 AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
1267 break;
1269 case ACPI_DMT_NAME6:
1271 AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);
1272 AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
1273 break;
1275 case ACPI_DMT_NAME8:
1277 AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);
1278 AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
1279 break;
1281 /* Special Data Types */
1283 case ACPI_DMT_CHKSUM:
1285 /* Checksum, display and validate */
1287 AcpiOsPrintf ("%2.2X", *Target);
1288 Temp8 = AcpiDmGenerateChecksum (Table,
1289 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
1290 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
1292 if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
1294 AcpiOsPrintf (
1295 " /* Incorrect checksum, should be %2.2X */", Temp8);
1298 AcpiOsPrintf ("\n");
1299 break;
1301 case ACPI_DMT_SPACEID:
1303 /* Address Space ID */
1305 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));
1306 break;
1308 case ACPI_DMT_ACCWIDTH:
1310 /* Encoded Access Width */
1312 Temp8 = *Target;
1313 if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
1315 Temp8 = ACPI_GAS_WIDTH_RESERVED;
1318 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);
1319 break;
1321 case ACPI_DMT_GAS:
1323 /* Generic Address Structure */
1325 AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
1326 Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1327 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
1328 if (ACPI_FAILURE (Status))
1330 return (Status);
1333 AcpiOsPrintf ("\n");
1334 LastOutputBlankLine = TRUE;
1335 break;
1337 case ACPI_DMT_ASF:
1339 /* ASF subtable types */
1341 Temp16 = (UINT16) ((*Target) & 0x7F); /* Top bit can be zero or one */
1342 if (Temp16 > ACPI_ASF_TYPE_RESERVED)
1344 Temp16 = ACPI_ASF_TYPE_RESERVED;
1347 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
1348 break;
1350 case ACPI_DMT_DMAR:
1352 /* DMAR subtable types */
1354 Temp16 = ACPI_GET16 (Target);
1355 if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
1357 Temp16 = ACPI_DMAR_TYPE_RESERVED;
1360 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1361 AcpiDmDmarSubnames[Temp16]);
1362 break;
1364 case ACPI_DMT_DMAR_SCOPE:
1366 /* DMAR device scope types */
1368 Temp8 = *Target;
1369 if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
1371 Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
1374 AcpiOsPrintf (UINT8_FORMAT, *Target,
1375 AcpiDmDmarScope[Temp8]);
1376 break;
1378 case ACPI_DMT_EINJACT:
1380 /* EINJ Action types */
1382 Temp8 = *Target;
1383 if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
1385 Temp8 = ACPI_EINJ_ACTION_RESERVED;
1388 AcpiOsPrintf (UINT8_FORMAT, *Target,
1389 AcpiDmEinjActions[Temp8]);
1390 break;
1392 case ACPI_DMT_EINJINST:
1394 /* EINJ Instruction types */
1396 Temp8 = *Target;
1397 if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
1399 Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
1402 AcpiOsPrintf (UINT8_FORMAT, *Target,
1403 AcpiDmEinjInstructions[Temp8]);
1404 break;
1406 case ACPI_DMT_ERSTACT:
1408 /* ERST Action types */
1410 Temp8 = *Target;
1411 if (Temp8 > ACPI_ERST_ACTION_RESERVED)
1413 Temp8 = ACPI_ERST_ACTION_RESERVED;
1416 AcpiOsPrintf (UINT8_FORMAT, *Target,
1417 AcpiDmErstActions[Temp8]);
1418 break;
1420 case ACPI_DMT_ERSTINST:
1422 /* ERST Instruction types */
1424 Temp8 = *Target;
1425 if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
1427 Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
1430 AcpiOsPrintf (UINT8_FORMAT, *Target,
1431 AcpiDmErstInstructions[Temp8]);
1432 break;
1434 case ACPI_DMT_GTDT:
1436 /* GTDT subtable types */
1438 Temp8 = *Target;
1439 if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
1441 Temp8 = ACPI_GTDT_TYPE_RESERVED;
1444 AcpiOsPrintf (UINT8_FORMAT, *Target,
1445 AcpiDmGtdtSubnames[Temp8]);
1446 break;
1448 case ACPI_DMT_HEST:
1450 /* HEST subtable types */
1452 Temp16 = ACPI_GET16 (Target);
1453 if (Temp16 > ACPI_HEST_TYPE_RESERVED)
1455 Temp16 = ACPI_HEST_TYPE_RESERVED;
1458 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1459 AcpiDmHestSubnames[Temp16]);
1460 break;
1462 case ACPI_DMT_HESTNTFY:
1464 AcpiOsPrintf (STRING_FORMAT,
1465 "Hardware Error Notification Structure");
1467 Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1468 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
1469 if (ACPI_FAILURE (Status))
1471 return (Status);
1474 AcpiOsPrintf ("\n");
1475 LastOutputBlankLine = TRUE;
1476 break;
1478 case ACPI_DMT_HESTNTYP:
1480 /* HEST Notify types */
1482 Temp8 = *Target;
1483 if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)
1485 Temp8 = ACPI_HEST_NOTIFY_RESERVED;
1488 AcpiOsPrintf (UINT8_FORMAT, *Target,
1489 AcpiDmHestNotifySubnames[Temp8]);
1490 break;
1492 case ACPI_DMT_HMAT:
1494 /* HMAT subtable types */
1496 Temp16 = *Target;
1497 if (Temp16 > ACPI_HMAT_TYPE_RESERVED)
1499 Temp16 = ACPI_HMAT_TYPE_RESERVED;
1502 AcpiOsPrintf (UINT16_FORMAT, *Target,
1503 AcpiDmHmatSubnames[Temp16]);
1504 break;
1506 case ACPI_DMT_IORTMEM:
1508 AcpiOsPrintf (STRING_FORMAT,
1509 "IORT Memory Access Properties");
1511 Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1512 sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
1513 if (ACPI_FAILURE (Status))
1515 return (Status);
1518 LastOutputBlankLine = TRUE;
1519 break;
1521 case ACPI_DMT_MADT:
1523 /* MADT subtable types */
1525 Temp8 = *Target;
1526 if (Temp8 > ACPI_MADT_TYPE_RESERVED)
1528 Temp8 = ACPI_MADT_TYPE_RESERVED;
1531 AcpiOsPrintf (UINT8_FORMAT, *Target,
1532 AcpiDmMadtSubnames[Temp8]);
1533 break;
1535 case ACPI_DMT_NFIT:
1537 /* NFIT subtable types */
1539 Temp16 = ACPI_GET16 (Target);
1540 if (Temp16 > ACPI_NFIT_TYPE_RESERVED)
1542 Temp16 = ACPI_NFIT_TYPE_RESERVED;
1545 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
1546 AcpiDmNfitSubnames[Temp16]);
1547 break;
1549 case ACPI_DMT_PCCT:
1551 /* PCCT subtable types */
1553 Temp8 = *Target;
1554 if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
1556 Temp8 = ACPI_PCCT_TYPE_RESERVED;
1559 AcpiOsPrintf (UINT8_FORMAT, *Target,
1560 AcpiDmPcctSubnames[Temp8]);
1561 break;
1563 case ACPI_DMT_PMTT:
1565 /* PMTT subtable types */
1567 Temp8 = *Target;
1568 if (Temp8 > ACPI_PMTT_TYPE_RESERVED)
1570 Temp8 = ACPI_PMTT_TYPE_RESERVED;
1573 AcpiOsPrintf (UINT8_FORMAT, *Target,
1574 AcpiDmPmttSubnames[Temp8]);
1575 break;
1577 case ACPI_DMT_PPTT:
1579 /* PPTT subtable types */
1581 Temp8 = *Target;
1582 if (Temp8 > ACPI_PPTT_TYPE_RESERVED)
1584 Temp8 = ACPI_PPTT_TYPE_RESERVED;
1587 AcpiOsPrintf (UINT8_FORMAT, *Target,
1588 AcpiDmPpttSubnames[Temp8]);
1589 break;
1591 case ACPI_DMT_UNICODE:
1593 if (ByteLength == 0)
1595 AcpiOsPrintf ("/* Zero-length Data */\n");
1596 break;
1599 AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength);
1600 break;
1602 case ACPI_DMT_RAW_BUFFER:
1604 if (ByteLength == 0)
1606 AcpiOsPrintf ("/* Zero-length Data */\n");
1607 break;
1610 AcpiDmDumpBuffer (Table, CurrentOffset, ByteLength,
1611 CurrentOffset, NULL);
1612 break;
1614 case ACPI_DMT_SDEV:
1616 /* SDEV subtable types */
1618 Temp8 = *Target;
1619 if (Temp8 > ACPI_SDEV_TYPE_RESERVED)
1621 Temp8 = ACPI_SDEV_TYPE_RESERVED;
1624 AcpiOsPrintf (UINT8_FORMAT, *Target,
1625 AcpiDmSdevSubnames[Temp8]);
1626 break;
1628 case ACPI_DMT_SRAT:
1630 /* SRAT subtable types */
1632 Temp8 = *Target;
1633 if (Temp8 > ACPI_SRAT_TYPE_RESERVED)
1635 Temp8 = ACPI_SRAT_TYPE_RESERVED;
1638 AcpiOsPrintf (UINT8_FORMAT, *Target,
1639 AcpiDmSratSubnames[Temp8]);
1640 break;
1642 case ACPI_DMT_TPM2:
1644 /* TPM2 Start Method types */
1646 Temp8 = *Target;
1647 if (Temp8 > ACPI_TPM2_RESERVED)
1649 Temp8 = ACPI_TPM2_RESERVED;
1652 AcpiOsPrintf (UINT8_FORMAT, *Target,
1653 AcpiDmTpm2Subnames[Temp8]);
1654 break;
1657 case ACPI_DMT_FADTPM:
1659 /* FADT Preferred PM Profile names */
1661 Temp8 = *Target;
1662 if (Temp8 > ACPI_FADT_PM_RESERVED)
1664 Temp8 = ACPI_FADT_PM_RESERVED;
1667 AcpiOsPrintf (UINT8_FORMAT, *Target,
1668 AcpiDmFadtProfiles[Temp8]);
1669 break;
1671 case ACPI_DMT_IVRS:
1673 /* IVRS subtable types */
1675 Temp8 = *Target;
1676 switch (Temp8)
1678 case ACPI_IVRS_TYPE_HARDWARE:
1680 Name = AcpiDmIvrsSubnames[0];
1681 break;
1683 case ACPI_IVRS_TYPE_MEMORY1:
1684 case ACPI_IVRS_TYPE_MEMORY2:
1685 case ACPI_IVRS_TYPE_MEMORY3:
1687 Name = AcpiDmIvrsSubnames[1];
1688 break;
1690 default:
1692 Name = AcpiDmIvrsSubnames[2];
1693 break;
1696 AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
1697 break;
1699 case ACPI_DMT_LPIT:
1701 /* LPIT subtable types */
1703 Temp32 = ACPI_GET32 (Target);
1704 if (Temp32 > ACPI_LPIT_TYPE_RESERVED)
1706 Temp32 = ACPI_LPIT_TYPE_RESERVED;
1709 AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),
1710 AcpiDmLpitSubnames[Temp32]);
1711 break;
1713 case ACPI_DMT_EXIT:
1715 return (AE_OK);
1717 default:
1719 ACPI_ERROR ((AE_INFO,
1720 "**** Invalid table opcode [0x%X] ****\n", Info->Opcode));
1721 return (AE_SUPPORT);
1725 if (TableOffset && !SubtableLength)
1728 * If this table is not the main table, the subtable must have a
1729 * valid length
1731 AcpiOsPrintf ("Invalid zero length subtable\n");
1732 return (AE_BAD_DATA);
1735 return (AE_OK);