xref: /freebsd/sys/contrib/dev/acpica/common/dmtable.c (revision d244b2279c2f63fc930fa1c11a6033b7119d426a)
11a39cfb0SJung-uk Kim /******************************************************************************
21a39cfb0SJung-uk Kim  *
31a39cfb0SJung-uk Kim  * Module Name: dmtable - Support for ACPI tables that contain no AML code
41a39cfb0SJung-uk Kim  *
51a39cfb0SJung-uk Kim  *****************************************************************************/
61a39cfb0SJung-uk Kim 
7*d244b227SJung-uk Kim /*
8*d244b227SJung-uk Kim  * Copyright (C) 2000 - 2011, Intel Corp.
91a39cfb0SJung-uk Kim  * All rights reserved.
101a39cfb0SJung-uk Kim  *
11*d244b227SJung-uk Kim  * Redistribution and use in source and binary forms, with or without
12*d244b227SJung-uk Kim  * modification, are permitted provided that the following conditions
13*d244b227SJung-uk Kim  * are met:
14*d244b227SJung-uk Kim  * 1. Redistributions of source code must retain the above copyright
15*d244b227SJung-uk Kim  *    notice, this list of conditions, and the following disclaimer,
16*d244b227SJung-uk Kim  *    without modification.
17*d244b227SJung-uk Kim  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*d244b227SJung-uk Kim  *    substantially similar to the "NO WARRANTY" disclaimer below
19*d244b227SJung-uk Kim  *    ("Disclaimer") and any redistribution must be conditioned upon
20*d244b227SJung-uk Kim  *    including a substantially similar Disclaimer requirement for further
21*d244b227SJung-uk Kim  *    binary redistribution.
22*d244b227SJung-uk Kim  * 3. Neither the names of the above-listed copyright holders nor the names
23*d244b227SJung-uk Kim  *    of any contributors may be used to endorse or promote products derived
24*d244b227SJung-uk Kim  *    from this software without specific prior written permission.
251a39cfb0SJung-uk Kim  *
26*d244b227SJung-uk Kim  * Alternatively, this software may be distributed under the terms of the
27*d244b227SJung-uk Kim  * GNU General Public License ("GPL") version 2 as published by the Free
28*d244b227SJung-uk Kim  * Software Foundation.
291a39cfb0SJung-uk Kim  *
30*d244b227SJung-uk Kim  * NO WARRANTY
31*d244b227SJung-uk Kim  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*d244b227SJung-uk Kim  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*d244b227SJung-uk Kim  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*d244b227SJung-uk Kim  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*d244b227SJung-uk Kim  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*d244b227SJung-uk Kim  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*d244b227SJung-uk Kim  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*d244b227SJung-uk Kim  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*d244b227SJung-uk Kim  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*d244b227SJung-uk Kim  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*d244b227SJung-uk Kim  * POSSIBILITY OF SUCH DAMAGES.
42*d244b227SJung-uk Kim  */
431a39cfb0SJung-uk Kim 
44ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/acpi.h>
45ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/accommon.h>
46ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/acdisasm.h>
47ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/actables.h>
48a88e22b7SJung-uk Kim #include <contrib/dev/acpica/compiler/aslcompiler.h>
49a88e22b7SJung-uk Kim #include <contrib/dev/acpica/compiler/dtcompiler.h>
501a39cfb0SJung-uk Kim 
511a39cfb0SJung-uk Kim /* This module used for application-level code only */
521a39cfb0SJung-uk Kim 
531a39cfb0SJung-uk Kim #define _COMPONENT          ACPI_CA_DISASSEMBLER
541a39cfb0SJung-uk Kim         ACPI_MODULE_NAME    ("dmtable")
551a39cfb0SJung-uk Kim 
561a39cfb0SJung-uk Kim /* Local Prototypes */
571a39cfb0SJung-uk Kim 
581a39cfb0SJung-uk Kim static void
591a39cfb0SJung-uk Kim AcpiDmCheckAscii (
601a39cfb0SJung-uk Kim     UINT8                   *Target,
61d6dd1baeSJung-uk Kim     char                    *RepairedName,
621a39cfb0SJung-uk Kim     UINT32                  Count);
631a39cfb0SJung-uk Kim 
641a39cfb0SJung-uk Kim 
651a39cfb0SJung-uk Kim /* These tables map a subtable type to a description string */
661a39cfb0SJung-uk Kim 
67a9f12690SJung-uk Kim static const char           *AcpiDmAsfSubnames[] =
68a9f12690SJung-uk Kim {
69a9f12690SJung-uk Kim     "ASF Information",
70a9f12690SJung-uk Kim     "ASF Alerts",
71a9f12690SJung-uk Kim     "ASF Remote Control",
72a9f12690SJung-uk Kim     "ASF RMCP Boot Options",
73a9f12690SJung-uk Kim     "ASF Address",
74a9f12690SJung-uk Kim     "Unknown SubTable Type"         /* Reserved */
75a9f12690SJung-uk Kim };
76a9f12690SJung-uk Kim 
771a39cfb0SJung-uk Kim static const char           *AcpiDmDmarSubnames[] =
781a39cfb0SJung-uk Kim {
791a39cfb0SJung-uk Kim     "Hardware Unit Definition",
801a39cfb0SJung-uk Kim     "Reserved Memory Region",
81a9f12690SJung-uk Kim     "Root Port ATS Capability",
82d6dd1baeSJung-uk Kim     "Remapping Hardware Static Affinity",
831a39cfb0SJung-uk Kim     "Unknown SubTable Type"         /* Reserved */
841a39cfb0SJung-uk Kim };
851a39cfb0SJung-uk Kim 
86a88e22b7SJung-uk Kim static const char           *AcpiDmEinjActions[] =
87a88e22b7SJung-uk Kim {
88a88e22b7SJung-uk Kim     "Begin Operation",
89a88e22b7SJung-uk Kim     "Get Trigger Table",
90a88e22b7SJung-uk Kim     "Set Error Type",
91a88e22b7SJung-uk Kim     "Get Error Type",
92a88e22b7SJung-uk Kim     "End Operation",
93a88e22b7SJung-uk Kim     "Execute Operation",
94a88e22b7SJung-uk Kim     "Check Busy Status",
95a88e22b7SJung-uk Kim     "Get Command Status",
96a88e22b7SJung-uk Kim     "Unknown Action"
97a88e22b7SJung-uk Kim };
98a88e22b7SJung-uk Kim 
99a88e22b7SJung-uk Kim static const char           *AcpiDmEinjInstructions[] =
100a88e22b7SJung-uk Kim {
101a88e22b7SJung-uk Kim     "Read Register",
102a88e22b7SJung-uk Kim     "Read Register Value",
103a88e22b7SJung-uk Kim     "Write Register",
104a88e22b7SJung-uk Kim     "Write Register Value",
105a88e22b7SJung-uk Kim     "Noop",
106a88e22b7SJung-uk Kim     "Unknown Instruction"
107a88e22b7SJung-uk Kim };
108a88e22b7SJung-uk Kim 
109a88e22b7SJung-uk Kim static const char           *AcpiDmErstActions[] =
110a88e22b7SJung-uk Kim {
111a88e22b7SJung-uk Kim     "Begin Write Operation",
112a88e22b7SJung-uk Kim     "Begin Read Operation",
113a88e22b7SJung-uk Kim     "Begin Clear Operation",
114a88e22b7SJung-uk Kim     "End Operation",
115a88e22b7SJung-uk Kim     "Set Record Offset",
116a88e22b7SJung-uk Kim     "Execute Operation",
117a88e22b7SJung-uk Kim     "Check Busy Status",
118a88e22b7SJung-uk Kim     "Get Command Status",
119a88e22b7SJung-uk Kim     "Get Record Identifier",
120a88e22b7SJung-uk Kim     "Set Record Identifier",
121a88e22b7SJung-uk Kim     "Get Record Count",
122a88e22b7SJung-uk Kim     "Begin Dummy Write",
123a88e22b7SJung-uk Kim     "Unused/Unknown Action",
124a88e22b7SJung-uk Kim     "Get Error Address Range",
125a88e22b7SJung-uk Kim     "Get Error Address Length",
126a88e22b7SJung-uk Kim     "Get Error Attributes",
127a88e22b7SJung-uk Kim     "Unknown Action"
128a88e22b7SJung-uk Kim };
129a88e22b7SJung-uk Kim 
130a88e22b7SJung-uk Kim static const char           *AcpiDmErstInstructions[] =
131a88e22b7SJung-uk Kim {
132a88e22b7SJung-uk Kim     "Read Register",
133a88e22b7SJung-uk Kim     "Read Register Value",
134a88e22b7SJung-uk Kim     "Write Register",
135a88e22b7SJung-uk Kim     "Write Register Value",
136a88e22b7SJung-uk Kim     "Noop",
137a88e22b7SJung-uk Kim     "Load Var1",
138a88e22b7SJung-uk Kim     "Load Var2",
139a88e22b7SJung-uk Kim     "Store Var1",
140a88e22b7SJung-uk Kim     "Add",
141a88e22b7SJung-uk Kim     "Subtract",
142a88e22b7SJung-uk Kim     "Add Value",
143a88e22b7SJung-uk Kim     "Subtract Value",
144a88e22b7SJung-uk Kim     "Stall",
145a88e22b7SJung-uk Kim     "Stall While True",
146a88e22b7SJung-uk Kim     "Skip Next If True",
147a88e22b7SJung-uk Kim     "GoTo",
148a88e22b7SJung-uk Kim     "Set Source Address",
149a88e22b7SJung-uk Kim     "Set Destination Address",
150a88e22b7SJung-uk Kim     "Move Data",
151a88e22b7SJung-uk Kim     "Unknown Instruction"
152a88e22b7SJung-uk Kim };
153a88e22b7SJung-uk Kim 
154a9f12690SJung-uk Kim static const char           *AcpiDmHestSubnames[] =
155a9f12690SJung-uk Kim {
156d6dd1baeSJung-uk Kim     "IA-32 Machine Check Exception",
157d6dd1baeSJung-uk Kim     "IA-32 Corrected Machine Check",
158d6dd1baeSJung-uk Kim     "IA-32 Non-Maskable Interrupt",
159d6dd1baeSJung-uk Kim     "Unknown SubTable Type",        /* 3 - Reserved */
160d6dd1baeSJung-uk Kim     "Unknown SubTable Type",        /* 4 - Reserved */
161d6dd1baeSJung-uk Kim     "Unknown SubTable Type",        /* 5 - Reserved */
162a9f12690SJung-uk Kim     "PCI Express Root Port AER",
163a9f12690SJung-uk Kim     "PCI Express AER (AER Endpoint)",
164a9f12690SJung-uk Kim     "PCI Express/PCI-X Bridge AER",
165a9f12690SJung-uk Kim     "Generic Hardware Error Source",
166a9f12690SJung-uk Kim     "Unknown SubTable Type"         /* Reserved */
167a9f12690SJung-uk Kim };
168a9f12690SJung-uk Kim 
169a9f12690SJung-uk Kim static const char           *AcpiDmHestNotifySubnames[] =
170a9f12690SJung-uk Kim {
171a9f12690SJung-uk Kim     "Polled",
172a9f12690SJung-uk Kim     "External Interrupt",
173a9f12690SJung-uk Kim     "Local Interrupt",
174a9f12690SJung-uk Kim     "SCI",
175a9f12690SJung-uk Kim     "NMI",
176a9f12690SJung-uk Kim     "Unknown Notify Type"           /* Reserved */
177a9f12690SJung-uk Kim };
178a9f12690SJung-uk Kim 
1791a39cfb0SJung-uk Kim static const char           *AcpiDmMadtSubnames[] =
1801a39cfb0SJung-uk Kim {
1811a39cfb0SJung-uk Kim     "Processor Local APIC",         /* ACPI_MADT_TYPE_LOCAL_APIC */
1821a39cfb0SJung-uk Kim     "I/O APIC",                     /* ACPI_MADT_TYPE_IO_APIC */
1831a39cfb0SJung-uk Kim     "Interrupt Source Override",    /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
1841a39cfb0SJung-uk Kim     "NMI Source",                   /* ACPI_MADT_TYPE_NMI_SOURCE */
1851a39cfb0SJung-uk Kim     "Local APIC NMI",               /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
1861a39cfb0SJung-uk Kim     "Local APIC Address Override",  /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
1871a39cfb0SJung-uk Kim     "I/O SAPIC",                    /* ACPI_MADT_TYPE_IO_SAPIC */
1881a39cfb0SJung-uk Kim     "Local SAPIC",                  /* ACPI_MADT_TYPE_LOCAL_SAPIC */
1891a39cfb0SJung-uk Kim     "Platform Interrupt Sources",   /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
190a9f12690SJung-uk Kim     "Processor Local x2APIC",       /* ACPI_MADT_TYPE_LOCAL_X2APIC */
191a9f12690SJung-uk Kim     "Local x2APIC NMI",             /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
1921a39cfb0SJung-uk Kim     "Unknown SubTable Type"         /* Reserved */
1931a39cfb0SJung-uk Kim };
1941a39cfb0SJung-uk Kim 
1951a39cfb0SJung-uk Kim static const char           *AcpiDmSratSubnames[] =
1961a39cfb0SJung-uk Kim {
1971a39cfb0SJung-uk Kim     "Processor Local APIC/SAPIC Affinity",
1981a39cfb0SJung-uk Kim     "Memory Affinity",
199a9f12690SJung-uk Kim     "Processor Local x2APIC Affinity",
2001a39cfb0SJung-uk Kim     "Unknown SubTable Type"         /* Reserved */
2011a39cfb0SJung-uk Kim };
2021a39cfb0SJung-uk Kim 
203d6dd1baeSJung-uk Kim static const char           *AcpiDmIvrsSubnames[] =
204d6dd1baeSJung-uk Kim {
205d6dd1baeSJung-uk Kim     "Hardware Definition Block",
206d6dd1baeSJung-uk Kim     "Memory Definition Block",
207d6dd1baeSJung-uk Kim     "Unknown SubTable Type"         /* Reserved */
208d6dd1baeSJung-uk Kim };
209d6dd1baeSJung-uk Kim 
210d6dd1baeSJung-uk Kim 
211a9f12690SJung-uk Kim #define ACPI_FADT_PM_RESERVED       8
212a9f12690SJung-uk Kim 
213a9f12690SJung-uk Kim static const char           *AcpiDmFadtProfiles[] =
214a9f12690SJung-uk Kim {
215a9f12690SJung-uk Kim     "Unspecified",
216a9f12690SJung-uk Kim     "Desktop",
217a9f12690SJung-uk Kim     "Mobile",
218a9f12690SJung-uk Kim     "Workstation",
219a9f12690SJung-uk Kim     "Enterprise Server",
220a9f12690SJung-uk Kim     "SOHO Server",
221a9f12690SJung-uk Kim     "Appliance PC",
222a9f12690SJung-uk Kim     "Performance Server",
223a9f12690SJung-uk Kim     "Unknown Profile Type"
224a9f12690SJung-uk Kim };
225a9f12690SJung-uk Kim 
2265a77b11bSJung-uk Kim #define ACPI_GAS_WIDTH_RESERVED     5
2275a77b11bSJung-uk Kim 
2285a77b11bSJung-uk Kim static const char           *AcpiDmGasAccessWidth[] =
2295a77b11bSJung-uk Kim {
2305a77b11bSJung-uk Kim     "Undefined/Legacy",
2315a77b11bSJung-uk Kim     "Byte Access:8",
2325a77b11bSJung-uk Kim     "Word Access:16",
2335a77b11bSJung-uk Kim     "DWord Access:32",
2345a77b11bSJung-uk Kim     "QWord Access:64",
2355a77b11bSJung-uk Kim     "Unknown Width Encoding"
2365a77b11bSJung-uk Kim };
2375a77b11bSJung-uk Kim 
2385a77b11bSJung-uk Kim 
2391a39cfb0SJung-uk Kim /*******************************************************************************
2401a39cfb0SJung-uk Kim  *
2411a39cfb0SJung-uk Kim  * ACPI Table Data, indexed by signature.
2421a39cfb0SJung-uk Kim  *
243a88e22b7SJung-uk Kim  * Each entry contains: Signature, Table Info, Handler, DtHandler,
244a88e22b7SJung-uk Kim  *  Template, Description
245d6dd1baeSJung-uk Kim  *
246a88e22b7SJung-uk Kim  * Simple tables have only a TableInfo structure, complex tables have a
247a88e22b7SJung-uk Kim  * handler. This table must be NULL terminated. RSDP and FACS are
248a88e22b7SJung-uk Kim  * special-cased elsewhere.
2491a39cfb0SJung-uk Kim  *
2501a39cfb0SJung-uk Kim  ******************************************************************************/
2511a39cfb0SJung-uk Kim 
252a88e22b7SJung-uk Kim ACPI_DMTABLE_DATA    AcpiDmTableData[] =
2531a39cfb0SJung-uk Kim {
254a88e22b7SJung-uk Kim     {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf,    "Alert Standard Format table"},
255a88e22b7SJung-uk Kim     {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
256a88e22b7SJung-uk Kim     {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert,   "Boot Error Record Table"},
257a88e22b7SJung-uk Kim     {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep,   "Corrected Platform Error Polling table"},
258a88e22b7SJung-uk Kim     {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp,   "Debug Port table"},
259a88e22b7SJung-uk Kim     {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar,   "DMA Remapping table"},
260a88e22b7SJung-uk Kim     {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt,   "Embedded Controller Boot Resources Table"},
261a88e22b7SJung-uk Kim     {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj,   "Error Injection table"},
262a88e22b7SJung-uk Kim     {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst,   "Error Record Serialization Table"},
263a88e22b7SJung-uk Kim     {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table"},
264a88e22b7SJung-uk Kim     {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest,   "Hardware Error Source Table"},
265a88e22b7SJung-uk Kim     {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet,   "High Precision Event Timer table"},
266a88e22b7SJung-uk Kim     {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs,   "I/O Virtualization Reporting Structure"},
267a88e22b7SJung-uk Kim     {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt,   "Multiple APIC Description Table"},
268a88e22b7SJung-uk Kim     {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg,   "Memory Mapped Configuration table"},
269a88e22b7SJung-uk Kim     {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi,   "Management Controller Host Interface table"},
270a88e22b7SJung-uk Kim     {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct,   "Maximum System Characteristics Table"},
271a88e22b7SJung-uk Kim     {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt,   "Root System Description Table"},
272a88e22b7SJung-uk Kim     {ACPI_SIG_SBST, AcpiDmTableInfoSbst,    NULL,           NULL,           TemplateSbst,   "Smart Battery Specification Table"},
273a88e22b7SJung-uk Kim     {ACPI_SIG_SLIC, AcpiDmTableInfoSlic,    NULL,           NULL,           NULL,           "Software Licensing Description Table"},
274a88e22b7SJung-uk Kim     {ACPI_SIG_SLIT, NULL,                   AcpiDmDumpSlit, DtCompileSlit,  TemplateSlit,   "System Locality Information Table"},
275a88e22b7SJung-uk Kim     {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr,    NULL,           NULL,           TemplateSpcr,   "Serial Port Console Redirection table"},
276a88e22b7SJung-uk Kim     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi,   "Server Platform Management Interface table"},
277a88e22b7SJung-uk Kim     {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat,   "System Resource Affinity Table"},
278a88e22b7SJung-uk Kim     {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa,    NULL,           NULL,           TemplateTcpa,   "Trusted Computing Platform Alliance table"},
279*d244b227SJung-uk Kim     {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi,   "UEFI Boot Optimization Table"},
280a88e22b7SJung-uk Kim     {ACPI_SIG_WAET, AcpiDmTableInfoWaet,    NULL,           NULL,           TemplateWaet,   "Windows ACPI Emulated Devices Table"},
281a88e22b7SJung-uk Kim     {ACPI_SIG_WDAT, NULL,                   AcpiDmDumpWdat, DtCompileWdat,  TemplateWdat,   "Watchdog Action Table"},
282a88e22b7SJung-uk Kim     {ACPI_SIG_WDDT, AcpiDmTableInfoWddt,    NULL,           NULL,           TemplateWddt,   "Watchdog Description Table"},
283a88e22b7SJung-uk Kim     {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt,    NULL,           NULL,           TemplateWdrt,   "Watchdog Resource Table"},
284a88e22b7SJung-uk Kim     {ACPI_SIG_XSDT, NULL,                   AcpiDmDumpXsdt, DtCompileXsdt,  TemplateXsdt,   "Extended System Description Table"},
285a88e22b7SJung-uk Kim     {NULL,          NULL,                   NULL,           NULL,           NULL,           NULL}
2861a39cfb0SJung-uk Kim };
2871a39cfb0SJung-uk Kim 
2881a39cfb0SJung-uk Kim 
2891a39cfb0SJung-uk Kim /*******************************************************************************
2901a39cfb0SJung-uk Kim  *
291a88e22b7SJung-uk Kim  * FUNCTION:    AcpiDmGenerateChecksum
2921a39cfb0SJung-uk Kim  *
293a88e22b7SJung-uk Kim  * PARAMETERS:  Table               - Pointer to table to be checksummed
294a88e22b7SJung-uk Kim  *              Length              - Length of the table
295a88e22b7SJung-uk Kim  *              OriginalChecksum    - Value of the checksum field
2961a39cfb0SJung-uk Kim  *
2971a39cfb0SJung-uk Kim  * RETURN:      8 bit checksum of buffer
2981a39cfb0SJung-uk Kim  *
2991a39cfb0SJung-uk Kim  * DESCRIPTION: Computes an 8 bit checksum of the table.
3001a39cfb0SJung-uk Kim  *
3011a39cfb0SJung-uk Kim  ******************************************************************************/
3021a39cfb0SJung-uk Kim 
3031a39cfb0SJung-uk Kim UINT8
304a88e22b7SJung-uk Kim AcpiDmGenerateChecksum (
305a88e22b7SJung-uk Kim     void                    *Table,
306a88e22b7SJung-uk Kim     UINT32                  Length,
307a88e22b7SJung-uk Kim     UINT8                   OriginalChecksum)
3081a39cfb0SJung-uk Kim {
3091a39cfb0SJung-uk Kim     UINT8                   Checksum;
3101a39cfb0SJung-uk Kim 
3111a39cfb0SJung-uk Kim 
3121a39cfb0SJung-uk Kim     /* Sum the entire table as-is */
3131a39cfb0SJung-uk Kim 
314a88e22b7SJung-uk Kim     Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
3151a39cfb0SJung-uk Kim 
3161a39cfb0SJung-uk Kim     /* Subtract off the existing checksum value in the table */
3171a39cfb0SJung-uk Kim 
318a88e22b7SJung-uk Kim     Checksum = (UINT8) (Checksum - OriginalChecksum);
3191a39cfb0SJung-uk Kim 
3201a39cfb0SJung-uk Kim     /* Compute the final checksum */
3211a39cfb0SJung-uk Kim 
3221a39cfb0SJung-uk Kim     Checksum = (UINT8) (0 - Checksum);
3231a39cfb0SJung-uk Kim     return (Checksum);
3241a39cfb0SJung-uk Kim }
3251a39cfb0SJung-uk Kim 
3261a39cfb0SJung-uk Kim 
3271a39cfb0SJung-uk Kim /*******************************************************************************
3281a39cfb0SJung-uk Kim  *
3291a39cfb0SJung-uk Kim  * FUNCTION:    AcpiDmGetTableData
3301a39cfb0SJung-uk Kim  *
3311a39cfb0SJung-uk Kim  * PARAMETERS:  Signature           - ACPI signature (4 chars) to match
3321a39cfb0SJung-uk Kim  *
3331a39cfb0SJung-uk Kim  * RETURN:      Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.
3341a39cfb0SJung-uk Kim  *
3351a39cfb0SJung-uk Kim  * DESCRIPTION: Find a match in the global table of supported ACPI tables
3361a39cfb0SJung-uk Kim  *
3371a39cfb0SJung-uk Kim  ******************************************************************************/
3381a39cfb0SJung-uk Kim 
339a88e22b7SJung-uk Kim ACPI_DMTABLE_DATA *
3401a39cfb0SJung-uk Kim AcpiDmGetTableData (
3411a39cfb0SJung-uk Kim     char                    *Signature)
3421a39cfb0SJung-uk Kim {
3431a39cfb0SJung-uk Kim     ACPI_DMTABLE_DATA       *TableData;
3441a39cfb0SJung-uk Kim 
3451a39cfb0SJung-uk Kim 
3461a39cfb0SJung-uk Kim     for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
3471a39cfb0SJung-uk Kim     {
3481a39cfb0SJung-uk Kim         if (ACPI_COMPARE_NAME (Signature, TableData->Signature))
3491a39cfb0SJung-uk Kim         {
3501a39cfb0SJung-uk Kim             return (TableData);
3511a39cfb0SJung-uk Kim         }
3521a39cfb0SJung-uk Kim     }
3531a39cfb0SJung-uk Kim 
3541a39cfb0SJung-uk Kim     return (NULL);
3551a39cfb0SJung-uk Kim }
3561a39cfb0SJung-uk Kim 
3571a39cfb0SJung-uk Kim 
3581a39cfb0SJung-uk Kim /*******************************************************************************
3591a39cfb0SJung-uk Kim  *
3601a39cfb0SJung-uk Kim  * FUNCTION:    AcpiDmDumpDataTable
3611a39cfb0SJung-uk Kim  *
3621a39cfb0SJung-uk Kim  * PARAMETERS:  Table               - An ACPI table
3631a39cfb0SJung-uk Kim  *
3641a39cfb0SJung-uk Kim  * RETURN:      None.
3651a39cfb0SJung-uk Kim  *
3661a39cfb0SJung-uk Kim  * DESCRIPTION: Format the contents of an ACPI data table (any table other
3671a39cfb0SJung-uk Kim  *              than an SSDT or DSDT that does not contain executable AML code)
3681a39cfb0SJung-uk Kim  *
3691a39cfb0SJung-uk Kim  ******************************************************************************/
3701a39cfb0SJung-uk Kim 
3711a39cfb0SJung-uk Kim void
3721a39cfb0SJung-uk Kim AcpiDmDumpDataTable (
3731a39cfb0SJung-uk Kim     ACPI_TABLE_HEADER       *Table)
3741a39cfb0SJung-uk Kim {
375a9f12690SJung-uk Kim     ACPI_STATUS             Status;
3761a39cfb0SJung-uk Kim     ACPI_DMTABLE_DATA       *TableData;
3771a39cfb0SJung-uk Kim     UINT32                  Length;
3781a39cfb0SJung-uk Kim 
3791a39cfb0SJung-uk Kim 
3801a39cfb0SJung-uk Kim     /* Ignore tables that contain AML */
3811a39cfb0SJung-uk Kim 
3821a39cfb0SJung-uk Kim     if (AcpiUtIsAmlTable (Table))
3831a39cfb0SJung-uk Kim     {
3841a39cfb0SJung-uk Kim         return;
3851a39cfb0SJung-uk Kim     }
3861a39cfb0SJung-uk Kim 
3871a39cfb0SJung-uk Kim     /*
3881a39cfb0SJung-uk Kim      * Handle tables that don't use the common ACPI table header structure.
3891a39cfb0SJung-uk Kim      * Currently, these are the FACS and RSDP.
3901a39cfb0SJung-uk Kim      */
3911a39cfb0SJung-uk Kim     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
3921a39cfb0SJung-uk Kim     {
3931a39cfb0SJung-uk Kim         Length = Table->Length;
3941a39cfb0SJung-uk Kim         AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
3951a39cfb0SJung-uk Kim     }
3961a39cfb0SJung-uk Kim     else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_RSDP))
3971a39cfb0SJung-uk Kim     {
3981a39cfb0SJung-uk Kim         Length = AcpiDmDumpRsdp (Table);
3991a39cfb0SJung-uk Kim     }
4001a39cfb0SJung-uk Kim     else
4011a39cfb0SJung-uk Kim     {
4021a39cfb0SJung-uk Kim         /*
4031a39cfb0SJung-uk Kim          * All other tables must use the common ACPI table header, dump it now
4041a39cfb0SJung-uk Kim          */
4051a39cfb0SJung-uk Kim         Length = Table->Length;
406a9f12690SJung-uk Kim         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
407a9f12690SJung-uk Kim         if (ACPI_FAILURE (Status))
408a9f12690SJung-uk Kim         {
409a9f12690SJung-uk Kim             return;
410a9f12690SJung-uk Kim         }
4111a39cfb0SJung-uk Kim         AcpiOsPrintf ("\n");
4121a39cfb0SJung-uk Kim 
4131a39cfb0SJung-uk Kim         /* Match signature and dispatch appropriately */
4141a39cfb0SJung-uk Kim 
4151a39cfb0SJung-uk Kim         TableData = AcpiDmGetTableData (Table->Signature);
4161a39cfb0SJung-uk Kim         if (!TableData)
4171a39cfb0SJung-uk Kim         {
4181a39cfb0SJung-uk Kim             if (!ACPI_STRNCMP (Table->Signature, "OEM", 3))
4191a39cfb0SJung-uk Kim             {
4201a39cfb0SJung-uk Kim                 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
4211a39cfb0SJung-uk Kim                     Table->Signature);
4221a39cfb0SJung-uk Kim             }
4231a39cfb0SJung-uk Kim             else
4241a39cfb0SJung-uk Kim             {
4251a39cfb0SJung-uk Kim                 AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n",
4261a39cfb0SJung-uk Kim                     Table->Signature);
4271a39cfb0SJung-uk Kim             }
4281a39cfb0SJung-uk Kim         }
4291a39cfb0SJung-uk Kim         else if (TableData->TableHandler)
4301a39cfb0SJung-uk Kim         {
4311a39cfb0SJung-uk Kim             /* Complex table, has a handler */
4321a39cfb0SJung-uk Kim 
4331a39cfb0SJung-uk Kim             TableData->TableHandler (Table);
4341a39cfb0SJung-uk Kim         }
4351a39cfb0SJung-uk Kim         else if (TableData->TableInfo)
4361a39cfb0SJung-uk Kim         {
4371a39cfb0SJung-uk Kim             /* Simple table, just walk the info table */
4381a39cfb0SJung-uk Kim 
4391a39cfb0SJung-uk Kim             AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
4401a39cfb0SJung-uk Kim         }
4411a39cfb0SJung-uk Kim     }
4421a39cfb0SJung-uk Kim 
443a88e22b7SJung-uk Kim     if (!Gbl_DoTemplates || Gbl_VerboseTemplates)
444a88e22b7SJung-uk Kim     {
445a88e22b7SJung-uk Kim         /* Dump the raw table data */
4461a39cfb0SJung-uk Kim 
447*d244b227SJung-uk Kim         AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
448*d244b227SJung-uk Kim             ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
4491a39cfb0SJung-uk Kim         AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
4501a39cfb0SJung-uk Kim     }
451a88e22b7SJung-uk Kim }
4521a39cfb0SJung-uk Kim 
4531a39cfb0SJung-uk Kim 
4541a39cfb0SJung-uk Kim /*******************************************************************************
4551a39cfb0SJung-uk Kim  *
4561a39cfb0SJung-uk Kim  * FUNCTION:    AcpiDmLineHeader
4571a39cfb0SJung-uk Kim  *
4581a39cfb0SJung-uk Kim  * PARAMETERS:  Offset              - Current byte offset, from table start
4591a39cfb0SJung-uk Kim  *              ByteLength          - Length of the field in bytes, 0 for flags
4601a39cfb0SJung-uk Kim  *              Name                - Name of this field
4611a39cfb0SJung-uk Kim  *              Value               - Optional value, displayed on left of ':'
4621a39cfb0SJung-uk Kim  *
4631a39cfb0SJung-uk Kim  * RETURN:      None
4641a39cfb0SJung-uk Kim  *
4651a39cfb0SJung-uk Kim  * DESCRIPTION: Utility routines for formatting output lines. Displays the
4661a39cfb0SJung-uk Kim  *              current table offset in hex and decimal, the field length,
4671a39cfb0SJung-uk Kim  *              and the field name.
4681a39cfb0SJung-uk Kim  *
4691a39cfb0SJung-uk Kim  ******************************************************************************/
4701a39cfb0SJung-uk Kim 
4711a39cfb0SJung-uk Kim void
4721a39cfb0SJung-uk Kim AcpiDmLineHeader (
4731a39cfb0SJung-uk Kim     UINT32                  Offset,
4741a39cfb0SJung-uk Kim     UINT32                  ByteLength,
4751a39cfb0SJung-uk Kim     char                    *Name)
4761a39cfb0SJung-uk Kim {
4771a39cfb0SJung-uk Kim 
478a88e22b7SJung-uk Kim     if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
479a88e22b7SJung-uk Kim     {
480a88e22b7SJung-uk Kim         if (ByteLength)
481a88e22b7SJung-uk Kim         {
482a88e22b7SJung-uk Kim             AcpiOsPrintf ("[%.3d] %34s : ",
483a88e22b7SJung-uk Kim                 ByteLength, Name);
484a88e22b7SJung-uk Kim         }
485a88e22b7SJung-uk Kim         else
486a88e22b7SJung-uk Kim         {
487a88e22b7SJung-uk Kim             AcpiOsPrintf ("%40s : ",
488a88e22b7SJung-uk Kim                 Name);
489a88e22b7SJung-uk Kim         }
490a88e22b7SJung-uk Kim     }
491a88e22b7SJung-uk Kim     else /* Normal disassembler or verbose template */
492a88e22b7SJung-uk Kim     {
4931a39cfb0SJung-uk Kim         if (ByteLength)
4941a39cfb0SJung-uk Kim         {
495a9f12690SJung-uk Kim             AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
4961a39cfb0SJung-uk Kim                 Offset, Offset, ByteLength, Name);
4971a39cfb0SJung-uk Kim         }
4981a39cfb0SJung-uk Kim         else
4991a39cfb0SJung-uk Kim         {
500a9f12690SJung-uk Kim             AcpiOsPrintf ("%43s : ",
5011a39cfb0SJung-uk Kim                 Name);
5021a39cfb0SJung-uk Kim         }
5031a39cfb0SJung-uk Kim     }
504a88e22b7SJung-uk Kim }
5051a39cfb0SJung-uk Kim 
5061a39cfb0SJung-uk Kim void
5071a39cfb0SJung-uk Kim AcpiDmLineHeader2 (
5081a39cfb0SJung-uk Kim     UINT32                  Offset,
5091a39cfb0SJung-uk Kim     UINT32                  ByteLength,
5101a39cfb0SJung-uk Kim     char                    *Name,
5111a39cfb0SJung-uk Kim     UINT32                  Value)
5121a39cfb0SJung-uk Kim {
5131a39cfb0SJung-uk Kim 
514a88e22b7SJung-uk Kim     if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
515a88e22b7SJung-uk Kim     {
516a88e22b7SJung-uk Kim         if (ByteLength)
517a88e22b7SJung-uk Kim         {
518a88e22b7SJung-uk Kim             AcpiOsPrintf ("[%.3d] %30s % 3d : ",
519a88e22b7SJung-uk Kim                 ByteLength, Name, Value);
520a88e22b7SJung-uk Kim         }
521a88e22b7SJung-uk Kim         else
522a88e22b7SJung-uk Kim         {
523a88e22b7SJung-uk Kim             AcpiOsPrintf ("%36s % 3d : ",
524a88e22b7SJung-uk Kim                 Name, Value);
525a88e22b7SJung-uk Kim         }
526a88e22b7SJung-uk Kim     }
527a88e22b7SJung-uk Kim     else /* Normal disassembler or verbose template */
528a88e22b7SJung-uk Kim     {
5291a39cfb0SJung-uk Kim         if (ByteLength)
5301a39cfb0SJung-uk Kim         {
531a9f12690SJung-uk Kim             AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ",
5321a39cfb0SJung-uk Kim                 Offset, Offset, ByteLength, Name, Value);
5331a39cfb0SJung-uk Kim         }
5341a39cfb0SJung-uk Kim         else
5351a39cfb0SJung-uk Kim         {
536a9f12690SJung-uk Kim             AcpiOsPrintf ("[%3.3Xh %4.4d   ] %24s % 3d : ",
5371a39cfb0SJung-uk Kim                 Offset, Offset, Name, Value);
5381a39cfb0SJung-uk Kim         }
5391a39cfb0SJung-uk Kim     }
540a88e22b7SJung-uk Kim }
5411a39cfb0SJung-uk Kim 
5421a39cfb0SJung-uk Kim 
5431a39cfb0SJung-uk Kim /*******************************************************************************
5441a39cfb0SJung-uk Kim  *
5451a39cfb0SJung-uk Kim  * FUNCTION:    AcpiDmDumpTable
5461a39cfb0SJung-uk Kim  *
5471a39cfb0SJung-uk Kim  * PARAMETERS:  TableLength         - Length of the entire ACPI table
5481a39cfb0SJung-uk Kim  *              TableOffset         - Starting offset within the table for this
5491a39cfb0SJung-uk Kim  *                                    sub-descriptor (0 if main table)
5501a39cfb0SJung-uk Kim  *              Table               - The ACPI table
551a9f12690SJung-uk Kim  *              SubtableLength      - Length of this sub-descriptor
5521a39cfb0SJung-uk Kim  *              Info                - Info table for this ACPI table
5531a39cfb0SJung-uk Kim  *
5541a39cfb0SJung-uk Kim  * RETURN:      None
5551a39cfb0SJung-uk Kim  *
5561a39cfb0SJung-uk Kim  * DESCRIPTION: Display ACPI table contents by walking the Info table.
5571a39cfb0SJung-uk Kim  *
558a88e22b7SJung-uk Kim  * Note: This function must remain in sync with DtGetFieldLength.
559a88e22b7SJung-uk Kim  *
5601a39cfb0SJung-uk Kim  ******************************************************************************/
5611a39cfb0SJung-uk Kim 
562a9f12690SJung-uk Kim ACPI_STATUS
5631a39cfb0SJung-uk Kim AcpiDmDumpTable (
5641a39cfb0SJung-uk Kim     UINT32                  TableLength,
5651a39cfb0SJung-uk Kim     UINT32                  TableOffset,
5661a39cfb0SJung-uk Kim     void                    *Table,
5671a39cfb0SJung-uk Kim     UINT32                  SubtableLength,
5681a39cfb0SJung-uk Kim     ACPI_DMTABLE_INFO       *Info)
5691a39cfb0SJung-uk Kim {
5701a39cfb0SJung-uk Kim     UINT8                   *Target;
5711a39cfb0SJung-uk Kim     UINT32                  CurrentOffset;
5721a39cfb0SJung-uk Kim     UINT32                  ByteLength;
5731a39cfb0SJung-uk Kim     UINT8                   Temp8;
5741a39cfb0SJung-uk Kim     UINT16                  Temp16;
5751a39cfb0SJung-uk Kim     ACPI_DMTABLE_DATA       *TableData;
576d6dd1baeSJung-uk Kim     const char              *Name;
577a9f12690SJung-uk Kim     BOOLEAN                 LastOutputBlankLine = FALSE;
578d6dd1baeSJung-uk Kim     char                    RepairedName[8];
5791a39cfb0SJung-uk Kim 
5801a39cfb0SJung-uk Kim 
5811a39cfb0SJung-uk Kim     if (!Info)
5821a39cfb0SJung-uk Kim     {
5831a39cfb0SJung-uk Kim         AcpiOsPrintf ("Display not implemented\n");
584a9f12690SJung-uk Kim         return (AE_NOT_IMPLEMENTED);
5851a39cfb0SJung-uk Kim     }
5861a39cfb0SJung-uk Kim 
5871a39cfb0SJung-uk Kim     /* Walk entire Info table; Null name terminates */
5881a39cfb0SJung-uk Kim 
5891a39cfb0SJung-uk Kim     for (; Info->Name; Info++)
5901a39cfb0SJung-uk Kim     {
5911a39cfb0SJung-uk Kim         /*
5921a39cfb0SJung-uk Kim          * Target points to the field within the ACPI Table. CurrentOffset is
5931a39cfb0SJung-uk Kim          * the offset of the field from the start of the main table.
5941a39cfb0SJung-uk Kim          */
5951a39cfb0SJung-uk Kim         Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
5961a39cfb0SJung-uk Kim         CurrentOffset = TableOffset + Info->Offset;
5971a39cfb0SJung-uk Kim 
5981a39cfb0SJung-uk Kim         /* Check for beyond EOT or beyond subtable end */
5991a39cfb0SJung-uk Kim 
6001a39cfb0SJung-uk Kim         if ((CurrentOffset >= TableLength) ||
6011a39cfb0SJung-uk Kim             (SubtableLength && (Info->Offset >= SubtableLength)))
6021a39cfb0SJung-uk Kim         {
603a9f12690SJung-uk Kim             AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
604a9f12690SJung-uk Kim             return (AE_BAD_DATA);
6051a39cfb0SJung-uk Kim         }
6061a39cfb0SJung-uk Kim 
6071a39cfb0SJung-uk Kim         /* Generate the byte length for this field */
6081a39cfb0SJung-uk Kim 
6091a39cfb0SJung-uk Kim         switch (Info->Opcode)
6101a39cfb0SJung-uk Kim         {
6111a39cfb0SJung-uk Kim         case ACPI_DMT_UINT8:
6121a39cfb0SJung-uk Kim         case ACPI_DMT_CHKSUM:
6131a39cfb0SJung-uk Kim         case ACPI_DMT_SPACEID:
6145a77b11bSJung-uk Kim         case ACPI_DMT_ACCWIDTH:
615d6dd1baeSJung-uk Kim         case ACPI_DMT_IVRS:
6161a39cfb0SJung-uk Kim         case ACPI_DMT_MADT:
6171a39cfb0SJung-uk Kim         case ACPI_DMT_SRAT:
618a9f12690SJung-uk Kim         case ACPI_DMT_ASF:
619a9f12690SJung-uk Kim         case ACPI_DMT_HESTNTYP:
620a9f12690SJung-uk Kim         case ACPI_DMT_FADTPM:
621a88e22b7SJung-uk Kim         case ACPI_DMT_EINJACT:
622a88e22b7SJung-uk Kim         case ACPI_DMT_EINJINST:
623a88e22b7SJung-uk Kim         case ACPI_DMT_ERSTACT:
624a88e22b7SJung-uk Kim         case ACPI_DMT_ERSTINST:
6251a39cfb0SJung-uk Kim             ByteLength = 1;
6261a39cfb0SJung-uk Kim             break;
6271a39cfb0SJung-uk Kim         case ACPI_DMT_UINT16:
6281a39cfb0SJung-uk Kim         case ACPI_DMT_DMAR:
629a9f12690SJung-uk Kim         case ACPI_DMT_HEST:
6301a39cfb0SJung-uk Kim             ByteLength = 2;
6311a39cfb0SJung-uk Kim             break;
6321a39cfb0SJung-uk Kim         case ACPI_DMT_UINT24:
6331a39cfb0SJung-uk Kim             ByteLength = 3;
6341a39cfb0SJung-uk Kim             break;
6351a39cfb0SJung-uk Kim         case ACPI_DMT_UINT32:
6361a39cfb0SJung-uk Kim         case ACPI_DMT_NAME4:
6371a39cfb0SJung-uk Kim         case ACPI_DMT_SIG:
6381a39cfb0SJung-uk Kim             ByteLength = 4;
6391a39cfb0SJung-uk Kim             break;
6401a39cfb0SJung-uk Kim         case ACPI_DMT_NAME6:
6411a39cfb0SJung-uk Kim             ByteLength = 6;
6421a39cfb0SJung-uk Kim             break;
6431a39cfb0SJung-uk Kim         case ACPI_DMT_UINT56:
6441a39cfb0SJung-uk Kim             ByteLength = 7;
6451a39cfb0SJung-uk Kim             break;
6461a39cfb0SJung-uk Kim         case ACPI_DMT_UINT64:
6471a39cfb0SJung-uk Kim         case ACPI_DMT_NAME8:
6481a39cfb0SJung-uk Kim             ByteLength = 8;
6491a39cfb0SJung-uk Kim             break;
650d6dd1baeSJung-uk Kim         case ACPI_DMT_BUF16:
651*d244b227SJung-uk Kim         case ACPI_DMT_UUID:
652d6dd1baeSJung-uk Kim             ByteLength = 16;
653d6dd1baeSJung-uk Kim             break;
6541a39cfb0SJung-uk Kim         case ACPI_DMT_STRING:
6551a39cfb0SJung-uk Kim             ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
6561a39cfb0SJung-uk Kim             break;
6571a39cfb0SJung-uk Kim         case ACPI_DMT_GAS:
658a9f12690SJung-uk Kim             if (!LastOutputBlankLine)
659a9f12690SJung-uk Kim             {
6601a39cfb0SJung-uk Kim                 AcpiOsPrintf ("\n");
661a9f12690SJung-uk Kim                 LastOutputBlankLine = TRUE;
662a9f12690SJung-uk Kim             }
6631a39cfb0SJung-uk Kim             ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
6641a39cfb0SJung-uk Kim             break;
665a9f12690SJung-uk Kim         case ACPI_DMT_HESTNTFY:
666a9f12690SJung-uk Kim             if (!LastOutputBlankLine)
667a9f12690SJung-uk Kim             {
668a9f12690SJung-uk Kim                 AcpiOsPrintf ("\n");
669a9f12690SJung-uk Kim                 LastOutputBlankLine = TRUE;
670a9f12690SJung-uk Kim             }
671a9f12690SJung-uk Kim             ByteLength = sizeof (ACPI_HEST_NOTIFY);
672a9f12690SJung-uk Kim             break;
6731a39cfb0SJung-uk Kim         default:
6741a39cfb0SJung-uk Kim             ByteLength = 0;
6751a39cfb0SJung-uk Kim             break;
6761a39cfb0SJung-uk Kim         }
6771a39cfb0SJung-uk Kim 
678a9f12690SJung-uk Kim         if (CurrentOffset + ByteLength > TableLength)
679a9f12690SJung-uk Kim         {
680a9f12690SJung-uk Kim             AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
681a9f12690SJung-uk Kim             return (AE_BAD_DATA);
682a9f12690SJung-uk Kim         }
683a9f12690SJung-uk Kim 
6841a39cfb0SJung-uk Kim         /* Start a new line and decode the opcode */
6851a39cfb0SJung-uk Kim 
6861a39cfb0SJung-uk Kim         AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
6871a39cfb0SJung-uk Kim 
6881a39cfb0SJung-uk Kim         switch (Info->Opcode)
6891a39cfb0SJung-uk Kim         {
6901a39cfb0SJung-uk Kim         /* Single-bit Flag fields. Note: Opcode is the bit position */
6911a39cfb0SJung-uk Kim 
6921a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG0:
6931a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG1:
6941a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG2:
6951a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG3:
6961a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG4:
6971a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG5:
6981a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG6:
6991a39cfb0SJung-uk Kim         case ACPI_DMT_FLAG7:
7001a39cfb0SJung-uk Kim 
7011a39cfb0SJung-uk Kim             AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);
7021a39cfb0SJung-uk Kim             break;
7031a39cfb0SJung-uk Kim 
7041a39cfb0SJung-uk Kim         /* 2-bit Flag fields */
7051a39cfb0SJung-uk Kim 
7061a39cfb0SJung-uk Kim         case ACPI_DMT_FLAGS0:
7071a39cfb0SJung-uk Kim 
7081a39cfb0SJung-uk Kim             AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
7091a39cfb0SJung-uk Kim             break;
7101a39cfb0SJung-uk Kim 
7111a39cfb0SJung-uk Kim         case ACPI_DMT_FLAGS2:
7121a39cfb0SJung-uk Kim 
7131a39cfb0SJung-uk Kim             AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
7141a39cfb0SJung-uk Kim             break;
7151a39cfb0SJung-uk Kim 
7161a39cfb0SJung-uk Kim         /* Standard Data Types */
7171a39cfb0SJung-uk Kim 
7181a39cfb0SJung-uk Kim         case ACPI_DMT_UINT8:
7191a39cfb0SJung-uk Kim 
7201a39cfb0SJung-uk Kim             AcpiOsPrintf ("%2.2X\n", *Target);
7211a39cfb0SJung-uk Kim             break;
7221a39cfb0SJung-uk Kim 
7231a39cfb0SJung-uk Kim         case ACPI_DMT_UINT16:
7241a39cfb0SJung-uk Kim 
7251a39cfb0SJung-uk Kim             AcpiOsPrintf ("%4.4X\n", ACPI_GET16 (Target));
7261a39cfb0SJung-uk Kim             break;
7271a39cfb0SJung-uk Kim 
7281a39cfb0SJung-uk Kim         case ACPI_DMT_UINT24:
7291a39cfb0SJung-uk Kim 
7301a39cfb0SJung-uk Kim             AcpiOsPrintf ("%2.2X%2.2X%2.2X\n",
7311a39cfb0SJung-uk Kim                 *Target, *(Target + 1), *(Target + 2));
7321a39cfb0SJung-uk Kim             break;
7331a39cfb0SJung-uk Kim 
7341a39cfb0SJung-uk Kim         case ACPI_DMT_UINT32:
7351a39cfb0SJung-uk Kim 
7361a39cfb0SJung-uk Kim             AcpiOsPrintf ("%8.8X\n", ACPI_GET32 (Target));
7371a39cfb0SJung-uk Kim             break;
7381a39cfb0SJung-uk Kim 
7391a39cfb0SJung-uk Kim         case ACPI_DMT_UINT56:
7401a39cfb0SJung-uk Kim 
741a9f12690SJung-uk Kim             for (Temp8 = 0; Temp8 < 7; Temp8++)
742a9f12690SJung-uk Kim             {
743a9f12690SJung-uk Kim                 AcpiOsPrintf ("%2.2X", Target[Temp8]);
744a9f12690SJung-uk Kim             }
745a9f12690SJung-uk Kim             AcpiOsPrintf ("\n");
7461a39cfb0SJung-uk Kim             break;
7471a39cfb0SJung-uk Kim 
7481a39cfb0SJung-uk Kim         case ACPI_DMT_UINT64:
7491a39cfb0SJung-uk Kim 
7501a39cfb0SJung-uk Kim             AcpiOsPrintf ("%8.8X%8.8X\n",
7511a39cfb0SJung-uk Kim                 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target)));
7521a39cfb0SJung-uk Kim             break;
7531a39cfb0SJung-uk Kim 
754d6dd1baeSJung-uk Kim         case ACPI_DMT_BUF16:
755d6dd1baeSJung-uk Kim 
756d6dd1baeSJung-uk Kim             /* Buffer of length 16 */
757d6dd1baeSJung-uk Kim 
758d6dd1baeSJung-uk Kim             for (Temp8 = 0; Temp8 < 16; Temp8++)
759d6dd1baeSJung-uk Kim             {
760a88e22b7SJung-uk Kim                 AcpiOsPrintf ("%2.2X", Target[Temp8]);
761a88e22b7SJung-uk Kim                 if ((Temp8 + 1) < 16)
762a88e22b7SJung-uk Kim                 {
763a88e22b7SJung-uk Kim                     AcpiOsPrintf (",");
764a88e22b7SJung-uk Kim                 }
765d6dd1baeSJung-uk Kim             }
766d6dd1baeSJung-uk Kim             AcpiOsPrintf ("\n");
767d6dd1baeSJung-uk Kim             break;
768d6dd1baeSJung-uk Kim 
769*d244b227SJung-uk Kim         case ACPI_DMT_UUID:
770*d244b227SJung-uk Kim 
771*d244b227SJung-uk Kim             /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
772*d244b227SJung-uk Kim 
773*d244b227SJung-uk Kim             (void) AuConvertUuidToString ((char *) Target, MsgBuffer);
774*d244b227SJung-uk Kim 
775*d244b227SJung-uk Kim             AcpiOsPrintf ("%s\n", MsgBuffer);
776*d244b227SJung-uk Kim             break;
777*d244b227SJung-uk Kim 
7781a39cfb0SJung-uk Kim         case ACPI_DMT_STRING:
7791a39cfb0SJung-uk Kim 
780d6dd1baeSJung-uk Kim             AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
7811a39cfb0SJung-uk Kim             break;
7821a39cfb0SJung-uk Kim 
7831a39cfb0SJung-uk Kim         /* Fixed length ASCII name fields */
7841a39cfb0SJung-uk Kim 
7851a39cfb0SJung-uk Kim         case ACPI_DMT_SIG:
7861a39cfb0SJung-uk Kim 
787d6dd1baeSJung-uk Kim             AcpiDmCheckAscii (Target, RepairedName, 4);
788d6dd1baeSJung-uk Kim             AcpiOsPrintf ("\"%.4s\"    ", RepairedName);
7891a39cfb0SJung-uk Kim             TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target));
7901a39cfb0SJung-uk Kim             if (TableData)
7911a39cfb0SJung-uk Kim             {
7921a39cfb0SJung-uk Kim                 AcpiOsPrintf ("/* %s */", TableData->Name);
7931a39cfb0SJung-uk Kim             }
7941a39cfb0SJung-uk Kim             AcpiOsPrintf ("\n");
7951a39cfb0SJung-uk Kim             break;
7961a39cfb0SJung-uk Kim 
7971a39cfb0SJung-uk Kim         case ACPI_DMT_NAME4:
7981a39cfb0SJung-uk Kim 
799d6dd1baeSJung-uk Kim             AcpiDmCheckAscii (Target, RepairedName, 4);
800d6dd1baeSJung-uk Kim             AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
8011a39cfb0SJung-uk Kim             break;
8021a39cfb0SJung-uk Kim 
8031a39cfb0SJung-uk Kim         case ACPI_DMT_NAME6:
8041a39cfb0SJung-uk Kim 
805d6dd1baeSJung-uk Kim             AcpiDmCheckAscii (Target, RepairedName, 6);
806d6dd1baeSJung-uk Kim             AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
8071a39cfb0SJung-uk Kim             break;
8081a39cfb0SJung-uk Kim 
8091a39cfb0SJung-uk Kim         case ACPI_DMT_NAME8:
8101a39cfb0SJung-uk Kim 
811d6dd1baeSJung-uk Kim             AcpiDmCheckAscii (Target, RepairedName, 8);
812d6dd1baeSJung-uk Kim             AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
8131a39cfb0SJung-uk Kim             break;
8141a39cfb0SJung-uk Kim 
8151a39cfb0SJung-uk Kim         /* Special Data Types */
8161a39cfb0SJung-uk Kim 
8171a39cfb0SJung-uk Kim         case ACPI_DMT_CHKSUM:
8181a39cfb0SJung-uk Kim 
8191a39cfb0SJung-uk Kim             /* Checksum, display and validate */
8201a39cfb0SJung-uk Kim 
8211a39cfb0SJung-uk Kim             AcpiOsPrintf ("%2.2X", *Target);
822a88e22b7SJung-uk Kim             Temp8 = AcpiDmGenerateChecksum (Table,
823a88e22b7SJung-uk Kim                         ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
824a88e22b7SJung-uk Kim                         ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
8251a39cfb0SJung-uk Kim             if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
8261a39cfb0SJung-uk Kim             {
8271a39cfb0SJung-uk Kim                 AcpiOsPrintf (
8281a39cfb0SJung-uk Kim                     "     /* Incorrect checksum, should be %2.2X */", Temp8);
8291a39cfb0SJung-uk Kim             }
8301a39cfb0SJung-uk Kim             AcpiOsPrintf ("\n");
8311a39cfb0SJung-uk Kim             break;
8321a39cfb0SJung-uk Kim 
8331a39cfb0SJung-uk Kim         case ACPI_DMT_SPACEID:
8341a39cfb0SJung-uk Kim 
8351a39cfb0SJung-uk Kim             /* Address Space ID */
8361a39cfb0SJung-uk Kim 
8371a39cfb0SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiUtGetRegionName (*Target));
8381a39cfb0SJung-uk Kim             break;
8391a39cfb0SJung-uk Kim 
8405a77b11bSJung-uk Kim         case ACPI_DMT_ACCWIDTH:
8415a77b11bSJung-uk Kim 
8425a77b11bSJung-uk Kim             /* Encoded Access Width */
8435a77b11bSJung-uk Kim 
8445a77b11bSJung-uk Kim             Temp8 = *Target;
8455a77b11bSJung-uk Kim             if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
8465a77b11bSJung-uk Kim             {
8475a77b11bSJung-uk Kim                 Temp8 = ACPI_GAS_WIDTH_RESERVED;
8485a77b11bSJung-uk Kim             }
8495a77b11bSJung-uk Kim 
8505a77b11bSJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", Temp8, AcpiDmGasAccessWidth[Temp8]);
8515a77b11bSJung-uk Kim             break;
8525a77b11bSJung-uk Kim 
8531a39cfb0SJung-uk Kim         case ACPI_DMT_GAS:
8541a39cfb0SJung-uk Kim 
8551a39cfb0SJung-uk Kim             /* Generic Address Structure */
8561a39cfb0SJung-uk Kim 
8571a39cfb0SJung-uk Kim             AcpiOsPrintf ("<Generic Address Structure>\n");
858d6dd1baeSJung-uk Kim             AcpiDmDumpTable (TableLength, CurrentOffset, Target,
859d6dd1baeSJung-uk Kim                 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
860a9f12690SJung-uk Kim             AcpiOsPrintf ("\n");
861a9f12690SJung-uk Kim             LastOutputBlankLine = TRUE;
862a9f12690SJung-uk Kim             break;
863a9f12690SJung-uk Kim 
864a9f12690SJung-uk Kim         case ACPI_DMT_ASF:
865a9f12690SJung-uk Kim 
866a9f12690SJung-uk Kim             /* ASF subtable types */
867a9f12690SJung-uk Kim 
868a9f12690SJung-uk Kim             Temp16 = (UINT16) ((*Target) & 0x7F);  /* Top bit can be zero or one */
869a9f12690SJung-uk Kim             if (Temp16 > ACPI_ASF_TYPE_RESERVED)
870a9f12690SJung-uk Kim             {
871a9f12690SJung-uk Kim                 Temp16 = ACPI_ASF_TYPE_RESERVED;
872a9f12690SJung-uk Kim             }
873a9f12690SJung-uk Kim 
874a9f12690SJung-uk Kim             AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmAsfSubnames[Temp16]);
8751a39cfb0SJung-uk Kim             break;
8761a39cfb0SJung-uk Kim 
8771a39cfb0SJung-uk Kim         case ACPI_DMT_DMAR:
8781a39cfb0SJung-uk Kim 
8791a39cfb0SJung-uk Kim             /* DMAR subtable types */
8801a39cfb0SJung-uk Kim 
881a9f12690SJung-uk Kim             Temp16 = ACPI_GET16 (Target);
8821a39cfb0SJung-uk Kim             if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
8831a39cfb0SJung-uk Kim             {
8841a39cfb0SJung-uk Kim                 Temp16 = ACPI_DMAR_TYPE_RESERVED;
8851a39cfb0SJung-uk Kim             }
8861a39cfb0SJung-uk Kim 
887a9f12690SJung-uk Kim             AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
8881a39cfb0SJung-uk Kim             break;
8891a39cfb0SJung-uk Kim 
890a88e22b7SJung-uk Kim         case ACPI_DMT_EINJACT:
891a88e22b7SJung-uk Kim 
892a88e22b7SJung-uk Kim             /* EINJ Action types */
893a88e22b7SJung-uk Kim 
894a88e22b7SJung-uk Kim             Temp8 = *Target;
895a88e22b7SJung-uk Kim             if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
896a88e22b7SJung-uk Kim             {
897a88e22b7SJung-uk Kim                 Temp8 = ACPI_EINJ_ACTION_RESERVED;
898a88e22b7SJung-uk Kim             }
899a88e22b7SJung-uk Kim 
900a88e22b7SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjActions[Temp8]);
901a88e22b7SJung-uk Kim             break;
902a88e22b7SJung-uk Kim 
903a88e22b7SJung-uk Kim         case ACPI_DMT_EINJINST:
904a88e22b7SJung-uk Kim 
905a88e22b7SJung-uk Kim             /* EINJ Instruction types */
906a88e22b7SJung-uk Kim 
907a88e22b7SJung-uk Kim             Temp8 = *Target;
908a88e22b7SJung-uk Kim             if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
909a88e22b7SJung-uk Kim             {
910a88e22b7SJung-uk Kim                 Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
911a88e22b7SJung-uk Kim             }
912a88e22b7SJung-uk Kim 
913a88e22b7SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjInstructions[Temp8]);
914a88e22b7SJung-uk Kim             break;
915a88e22b7SJung-uk Kim 
916a88e22b7SJung-uk Kim         case ACPI_DMT_ERSTACT:
917a88e22b7SJung-uk Kim 
918a88e22b7SJung-uk Kim             /* ERST Action types */
919a88e22b7SJung-uk Kim 
920a88e22b7SJung-uk Kim             Temp8 = *Target;
921a88e22b7SJung-uk Kim             if (Temp8 > ACPI_ERST_ACTION_RESERVED)
922a88e22b7SJung-uk Kim             {
923a88e22b7SJung-uk Kim                 Temp8 = ACPI_ERST_ACTION_RESERVED;
924a88e22b7SJung-uk Kim             }
925a88e22b7SJung-uk Kim 
926a88e22b7SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstActions[Temp8]);
927a88e22b7SJung-uk Kim             break;
928a88e22b7SJung-uk Kim 
929a88e22b7SJung-uk Kim         case ACPI_DMT_ERSTINST:
930a88e22b7SJung-uk Kim 
931a88e22b7SJung-uk Kim             /* ERST Instruction types */
932a88e22b7SJung-uk Kim 
933a88e22b7SJung-uk Kim             Temp8 = *Target;
934a88e22b7SJung-uk Kim             if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
935a88e22b7SJung-uk Kim             {
936a88e22b7SJung-uk Kim                 Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
937a88e22b7SJung-uk Kim             }
938a88e22b7SJung-uk Kim 
939a88e22b7SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstInstructions[Temp8]);
940a88e22b7SJung-uk Kim             break;
941a88e22b7SJung-uk Kim 
942a9f12690SJung-uk Kim         case ACPI_DMT_HEST:
943a9f12690SJung-uk Kim 
944a9f12690SJung-uk Kim             /* HEST subtable types */
945a9f12690SJung-uk Kim 
946a9f12690SJung-uk Kim             Temp16 = ACPI_GET16 (Target);
947a9f12690SJung-uk Kim             if (Temp16 > ACPI_HEST_TYPE_RESERVED)
948a9f12690SJung-uk Kim             {
949a9f12690SJung-uk Kim                 Temp16 = ACPI_HEST_TYPE_RESERVED;
950a9f12690SJung-uk Kim             }
951a9f12690SJung-uk Kim 
952a9f12690SJung-uk Kim             AcpiOsPrintf ("%4.4X (%s)\n", ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]);
953a9f12690SJung-uk Kim             break;
954a9f12690SJung-uk Kim 
955a9f12690SJung-uk Kim         case ACPI_DMT_HESTNTFY:
956a9f12690SJung-uk Kim 
957a9f12690SJung-uk Kim             AcpiOsPrintf ("<Hardware Error Notification Structure>\n");
958d6dd1baeSJung-uk Kim             AcpiDmDumpTable (TableLength, CurrentOffset, Target,
959d6dd1baeSJung-uk Kim                 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
960a9f12690SJung-uk Kim             AcpiOsPrintf ("\n");
961a9f12690SJung-uk Kim             LastOutputBlankLine = TRUE;
962a9f12690SJung-uk Kim             break;
963a9f12690SJung-uk Kim 
964a9f12690SJung-uk Kim         case ACPI_DMT_HESTNTYP:
965a9f12690SJung-uk Kim 
966a9f12690SJung-uk Kim             /* HEST Notify types */
967a9f12690SJung-uk Kim 
968a9f12690SJung-uk Kim             Temp8 = *Target;
969a9f12690SJung-uk Kim             if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)
970a9f12690SJung-uk Kim             {
971a9f12690SJung-uk Kim                 Temp8 = ACPI_HEST_NOTIFY_RESERVED;
972a9f12690SJung-uk Kim             }
973a9f12690SJung-uk Kim 
974a9f12690SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmHestNotifySubnames[Temp8]);
975a9f12690SJung-uk Kim             break;
976a9f12690SJung-uk Kim 
9771a39cfb0SJung-uk Kim         case ACPI_DMT_MADT:
9781a39cfb0SJung-uk Kim 
9791a39cfb0SJung-uk Kim             /* MADT subtable types */
9801a39cfb0SJung-uk Kim 
9811a39cfb0SJung-uk Kim             Temp8 = *Target;
9821a39cfb0SJung-uk Kim             if (Temp8 > ACPI_MADT_TYPE_RESERVED)
9831a39cfb0SJung-uk Kim             {
9841a39cfb0SJung-uk Kim                 Temp8 = ACPI_MADT_TYPE_RESERVED;
9851a39cfb0SJung-uk Kim             }
9861a39cfb0SJung-uk Kim 
9871a39cfb0SJung-uk Kim             AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]);
9881a39cfb0SJung-uk Kim             break;
9891a39cfb0SJung-uk Kim 
9901a39cfb0SJung-uk Kim         case ACPI_DMT_SRAT:
9911a39cfb0SJung-uk Kim 
9921a39cfb0SJung-uk Kim             /* SRAT subtable types */
9931a39cfb0SJung-uk Kim 
9941a39cfb0SJung-uk Kim             Temp8 = *Target;
9951a39cfb0SJung-uk Kim             if (Temp8 > ACPI_SRAT_TYPE_RESERVED)
9961a39cfb0SJung-uk Kim             {
9971a39cfb0SJung-uk Kim                 Temp8 = ACPI_SRAT_TYPE_RESERVED;
9981a39cfb0SJung-uk Kim             }
9991a39cfb0SJung-uk Kim 
10001a39cfb0SJung-uk Kim             AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmSratSubnames[Temp8]);
10011a39cfb0SJung-uk Kim             break;
10021a39cfb0SJung-uk Kim 
1003a9f12690SJung-uk Kim         case ACPI_DMT_FADTPM:
1004a9f12690SJung-uk Kim 
1005a9f12690SJung-uk Kim             /* FADT Preferred PM Profile names */
1006a9f12690SJung-uk Kim 
1007a9f12690SJung-uk Kim             Temp8 = *Target;
1008a9f12690SJung-uk Kim             if (Temp8 > ACPI_FADT_PM_RESERVED)
1009a9f12690SJung-uk Kim             {
1010a9f12690SJung-uk Kim                 Temp8 = ACPI_FADT_PM_RESERVED;
1011a9f12690SJung-uk Kim             }
1012a9f12690SJung-uk Kim 
1013a9f12690SJung-uk Kim             AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]);
1014a9f12690SJung-uk Kim             break;
1015a9f12690SJung-uk Kim 
1016d6dd1baeSJung-uk Kim         case ACPI_DMT_IVRS:
1017d6dd1baeSJung-uk Kim 
1018d6dd1baeSJung-uk Kim             /* IVRS subtable types */
1019d6dd1baeSJung-uk Kim 
1020d6dd1baeSJung-uk Kim             Temp8 = *Target;
1021d6dd1baeSJung-uk Kim             switch (Temp8)
1022d6dd1baeSJung-uk Kim             {
1023d6dd1baeSJung-uk Kim             case ACPI_IVRS_TYPE_HARDWARE:
1024d6dd1baeSJung-uk Kim                 Name = AcpiDmIvrsSubnames[0];
1025d6dd1baeSJung-uk Kim                 break;
1026d6dd1baeSJung-uk Kim 
1027d6dd1baeSJung-uk Kim             case ACPI_IVRS_TYPE_MEMORY1:
1028d6dd1baeSJung-uk Kim             case ACPI_IVRS_TYPE_MEMORY2:
1029d6dd1baeSJung-uk Kim             case ACPI_IVRS_TYPE_MEMORY3:
1030d6dd1baeSJung-uk Kim                 Name = AcpiDmIvrsSubnames[1];
1031d6dd1baeSJung-uk Kim                 break;
1032d6dd1baeSJung-uk Kim 
1033d6dd1baeSJung-uk Kim             default:
1034d6dd1baeSJung-uk Kim                 Name = AcpiDmIvrsSubnames[2];
1035d6dd1baeSJung-uk Kim                 break;
1036d6dd1baeSJung-uk Kim             }
1037d6dd1baeSJung-uk Kim 
1038d6dd1baeSJung-uk Kim             AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name);
1039d6dd1baeSJung-uk Kim             break;
1040d6dd1baeSJung-uk Kim 
10411a39cfb0SJung-uk Kim         case ACPI_DMT_EXIT:
1042a9f12690SJung-uk Kim             return (AE_OK);
10431a39cfb0SJung-uk Kim 
10441a39cfb0SJung-uk Kim         default:
10451a39cfb0SJung-uk Kim             ACPI_ERROR ((AE_INFO,
1046ca3cf4faSJung-uk Kim                 "**** Invalid table opcode [0x%X] ****\n", Info->Opcode));
1047a9f12690SJung-uk Kim             return (AE_SUPPORT);
10481a39cfb0SJung-uk Kim         }
10491a39cfb0SJung-uk Kim     }
1050a9f12690SJung-uk Kim 
1051a9f12690SJung-uk Kim     if (TableOffset && !SubtableLength)
1052a9f12690SJung-uk Kim     {
1053a9f12690SJung-uk Kim         /* If this table is not the main table, subtable must have valid length */
1054a9f12690SJung-uk Kim 
1055a9f12690SJung-uk Kim         AcpiOsPrintf ("Invalid zero length subtable\n");
1056a9f12690SJung-uk Kim         return (AE_BAD_DATA);
1057a9f12690SJung-uk Kim     }
1058a9f12690SJung-uk Kim 
1059a9f12690SJung-uk Kim     return (AE_OK);
10601a39cfb0SJung-uk Kim }
10611a39cfb0SJung-uk Kim 
10621a39cfb0SJung-uk Kim 
10631a39cfb0SJung-uk Kim /*******************************************************************************
10641a39cfb0SJung-uk Kim  *
10651a39cfb0SJung-uk Kim  * FUNCTION:    AcpiDmCheckAscii
10661a39cfb0SJung-uk Kim  *
10671a39cfb0SJung-uk Kim  * PARAMETERS:  Name                - Ascii string
10681a39cfb0SJung-uk Kim  *              Count               - Number of characters to check
10691a39cfb0SJung-uk Kim  *
10701a39cfb0SJung-uk Kim  * RETURN:      None
10711a39cfb0SJung-uk Kim  *
10721a39cfb0SJung-uk Kim  * DESCRIPTION: Ensure that the requested number of characters are printable
10731a39cfb0SJung-uk Kim  *              Ascii characters. Sets non-printable and null chars to <space>.
10741a39cfb0SJung-uk Kim  *
10751a39cfb0SJung-uk Kim  ******************************************************************************/
10761a39cfb0SJung-uk Kim 
10771a39cfb0SJung-uk Kim static void
10781a39cfb0SJung-uk Kim AcpiDmCheckAscii (
10791a39cfb0SJung-uk Kim     UINT8                   *Name,
1080d6dd1baeSJung-uk Kim     char                    *RepairedName,
10811a39cfb0SJung-uk Kim     UINT32                  Count)
10821a39cfb0SJung-uk Kim {
10831a39cfb0SJung-uk Kim     UINT32                  i;
10841a39cfb0SJung-uk Kim 
10851a39cfb0SJung-uk Kim 
10861a39cfb0SJung-uk Kim     for (i = 0; i < Count; i++)
10871a39cfb0SJung-uk Kim     {
1088f556842eSJung-uk Kim         RepairedName[i] = (char) Name[i];
1089d6dd1baeSJung-uk Kim 
1090d6dd1baeSJung-uk Kim         if (!Name[i])
10911a39cfb0SJung-uk Kim         {
1092d6dd1baeSJung-uk Kim             return;
1093d6dd1baeSJung-uk Kim         }
1094d6dd1baeSJung-uk Kim         if (!isprint (Name[i]))
1095d6dd1baeSJung-uk Kim         {
1096d6dd1baeSJung-uk Kim             RepairedName[i] = ' ';
10971a39cfb0SJung-uk Kim         }
10981a39cfb0SJung-uk Kim     }
10991a39cfb0SJung-uk Kim }
1100