1 /******************************************************************************
3 * Module Name: dmtable - Support for ACPI tables that contain no AML code
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2011, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #include <contrib/dev/acpica/include/acpi.h>
45 #include <contrib/dev/acpica/include/accommon.h>
46 #include <contrib/dev/acpica/include/acdisasm.h>
47 #include <contrib/dev/acpica/include/actables.h>
48 #include <contrib/dev/acpica/compiler/aslcompiler.h>
49 #include <contrib/dev/acpica/compiler/dtcompiler.h>
51 /* This module used for application-level code only */
53 #define _COMPONENT ACPI_CA_DISASSEMBLER
54 ACPI_MODULE_NAME ("dmtable")
56 /* Local Prototypes */
65 /* Common format strings for commented values */
67 #define UINT8_FORMAT "%2.2X [%s]\n"
68 #define UINT16_FORMAT "%4.4X [%s]\n"
69 #define UINT32_FORMAT "%8.8X [%s]\n"
70 #define STRING_FORMAT "[%s]\n"
72 /* These tables map a subtable type to a description string */
74 static const char *AcpiDmAsfSubnames[] =
79 "ASF RMCP Boot Options",
81 "Unknown SubTable Type" /* Reserved */
84 static const char *AcpiDmDmarSubnames[] =
86 "Hardware Unit Definition",
87 "Reserved Memory Region",
88 "Root Port ATS Capability",
89 "Remapping Hardware Static Affinity",
90 "Unknown SubTable Type" /* Reserved */
93 static const char *AcpiDmEinjActions[] =
102 "Get Command Status",
106 static const char *AcpiDmEinjInstructions[] =
109 "Read Register Value",
111 "Write Register Value",
113 "Unknown Instruction"
116 static const char *AcpiDmErstActions[] =
118 "Begin Write Operation",
119 "Begin Read Operation",
120 "Begin Clear Operation",
125 "Get Command Status",
126 "Get Record Identifier",
127 "Set Record Identifier",
130 "Unused/Unknown Action",
131 "Get Error Address Range",
132 "Get Error Address Length",
133 "Get Error Attributes",
137 static const char *AcpiDmErstInstructions[] =
140 "Read Register Value",
142 "Write Register Value",
155 "Set Source Address",
156 "Set Destination Address",
158 "Unknown Instruction"
161 static const char *AcpiDmHestSubnames[] =
163 "IA-32 Machine Check Exception",
164 "IA-32 Corrected Machine Check",
165 "IA-32 Non-Maskable Interrupt",
166 "Unknown SubTable Type", /* 3 - Reserved */
167 "Unknown SubTable Type", /* 4 - Reserved */
168 "Unknown SubTable Type", /* 5 - Reserved */
169 "PCI Express Root Port AER",
170 "PCI Express AER (AER Endpoint)",
171 "PCI Express/PCI-X Bridge AER",
172 "Generic Hardware Error Source",
173 "Unknown SubTable Type" /* Reserved */
176 static const char *AcpiDmHestNotifySubnames[] =
179 "External Interrupt",
183 "Unknown Notify Type" /* Reserved */
186 static const char *AcpiDmMadtSubnames[] =
188 "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
189 "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
190 "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
191 "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
192 "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
193 "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
194 "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
195 "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
196 "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
197 "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
198 "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
199 "Unknown SubTable Type" /* Reserved */
202 static const char *AcpiDmSlicSubnames[] =
204 "Public Key Structure",
205 "Windows Marker Structure",
206 "Unknown SubTable Type" /* Reserved */
209 static const char *AcpiDmSratSubnames[] =
211 "Processor Local APIC/SAPIC Affinity",
213 "Processor Local x2APIC Affinity",
214 "Unknown SubTable Type" /* Reserved */
217 static const char *AcpiDmIvrsSubnames[] =
219 "Hardware Definition Block",
220 "Memory Definition Block",
221 "Unknown SubTable Type" /* Reserved */
225 #define ACPI_FADT_PM_RESERVED 8
227 static const char *AcpiDmFadtProfiles[] =
236 "Performance Server",
237 "Unknown Profile Type"
240 #define ACPI_GAS_WIDTH_RESERVED 5
242 static const char *AcpiDmGasAccessWidth[] =
249 "Unknown Width Encoding"
253 /*******************************************************************************
255 * ACPI Table Data, indexed by signature.
257 * Each entry contains: Signature, Table Info, Handler, DtHandler,
258 * Template, Description
260 * Simple tables have only a TableInfo structure, complex tables have a
261 * handler. This table must be NULL terminated. RSDP and FACS are
262 * special-cased elsewhere.
264 ******************************************************************************/
266 ACPI_DMTABLE_DATA AcpiDmTableData[] =
268 {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"},
269 {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
270 {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"},
271 {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
272 {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
273 {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
274 {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
275 {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"},
276 {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
277 {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"},
278 {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
279 {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
280 {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
281 {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"},
282 {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
283 {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
284 {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
285 {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
286 {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"},
287 {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"},
288 {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"},
289 {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"},
290 {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"},
291 {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"},
292 {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"},
293 {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi, "UEFI Boot Optimization Table"},
294 {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"},
295 {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"},
296 {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"},
297 {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"},
298 {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"},
299 {NULL, NULL, NULL, NULL, NULL, NULL}
303 /*******************************************************************************
305 * FUNCTION: AcpiDmGenerateChecksum
307 * PARAMETERS: Table - Pointer to table to be checksummed
308 * Length - Length of the table
309 * OriginalChecksum - Value of the checksum field
311 * RETURN: 8 bit checksum of buffer
313 * DESCRIPTION: Computes an 8 bit checksum of the table.
315 ******************************************************************************/
318 AcpiDmGenerateChecksum (
321 UINT8 OriginalChecksum)
326 /* Sum the entire table as-is */
328 Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
330 /* Subtract off the existing checksum value in the table */
332 Checksum = (UINT8) (Checksum - OriginalChecksum);
334 /* Compute the final checksum */
336 Checksum = (UINT8) (0 - Checksum);
341 /*******************************************************************************
343 * FUNCTION: AcpiDmGetTableData
345 * PARAMETERS: Signature - ACPI signature (4 chars) to match
347 * RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.
349 * DESCRIPTION: Find a match in the global table of supported ACPI tables
351 ******************************************************************************/
357 ACPI_DMTABLE_DATA *TableData;
360 for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
362 if (ACPI_COMPARE_NAME (Signature, TableData->Signature))
372 /*******************************************************************************
374 * FUNCTION: AcpiDmDumpDataTable
376 * PARAMETERS: Table - An ACPI table
380 * DESCRIPTION: Format the contents of an ACPI data table (any table other
381 * than an SSDT or DSDT that does not contain executable AML code)
383 ******************************************************************************/
386 AcpiDmDumpDataTable (
387 ACPI_TABLE_HEADER *Table)
390 ACPI_DMTABLE_DATA *TableData;
394 /* Ignore tables that contain AML */
396 if (AcpiUtIsAmlTable (Table))
402 * Handle tables that don't use the common ACPI table header structure.
403 * Currently, these are the FACS and RSDP.
405 if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
407 Length = Table->Length;
408 AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
410 else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_RSDP))
412 Length = AcpiDmDumpRsdp (Table);
417 * All other tables must use the common ACPI table header, dump it now
419 Length = Table->Length;
420 Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
421 if (ACPI_FAILURE (Status))
427 /* Match signature and dispatch appropriately */
429 TableData = AcpiDmGetTableData (Table->Signature);
432 if (!ACPI_STRNCMP (Table->Signature, "OEM", 3))
434 AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
439 AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n",
443 else if (TableData->TableHandler)
445 /* Complex table, has a handler */
447 TableData->TableHandler (Table);
449 else if (TableData->TableInfo)
451 /* Simple table, just walk the info table */
453 AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
457 if (!Gbl_DoTemplates || Gbl_VerboseTemplates)
459 /* Dump the raw table data */
461 AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
462 ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
463 AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
468 /*******************************************************************************
470 * FUNCTION: AcpiDmLineHeader
472 * PARAMETERS: Offset - Current byte offset, from table start
473 * ByteLength - Length of the field in bytes, 0 for flags
474 * Name - Name of this field
475 * Value - Optional value, displayed on left of ':'
479 * DESCRIPTION: Utility routines for formatting output lines. Displays the
480 * current table offset in hex and decimal, the field length,
481 * and the field name.
483 ******************************************************************************/
492 /* Allow a null name for fields that span multiple lines (large buffers) */
499 if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
503 AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
509 AcpiOsPrintf ("%41s : ", Name);
513 AcpiOsPrintf ("%41s ", Name);
517 else /* Normal disassembler or verbose template */
521 AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
522 Offset, Offset, ByteLength, Name);
528 AcpiOsPrintf ("%44s : ", Name);
532 AcpiOsPrintf ("%44s ", Name);
546 if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
550 AcpiOsPrintf ("[%.4d] %30s %3d : ",
551 ByteLength, Name, Value);
555 AcpiOsPrintf ("%36s % 3d : ",
559 else /* Normal disassembler or verbose template */
563 AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ",
564 Offset, Offset, ByteLength, Name, Value);
568 AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ",
569 Offset, Offset, Name, Value);
575 /*******************************************************************************
577 * FUNCTION: AcpiDmDumpTable
579 * PARAMETERS: TableLength - Length of the entire ACPI table
580 * TableOffset - Starting offset within the table for this
581 * sub-descriptor (0 if main table)
582 * Table - The ACPI table
583 * SubtableLength - Length of this sub-descriptor
584 * Info - Info table for this ACPI table
588 * DESCRIPTION: Display ACPI table contents by walking the Info table.
590 * Note: This function must remain in sync with DtGetFieldLength.
592 ******************************************************************************/
599 UINT32 SubtableLength,
600 ACPI_DMTABLE_INFO *Info)
603 UINT32 CurrentOffset;
607 ACPI_DMTABLE_DATA *TableData;
609 BOOLEAN LastOutputBlankLine = FALSE;
610 char RepairedName[8];
615 AcpiOsPrintf ("Display not implemented\n");
616 return (AE_NOT_IMPLEMENTED);
619 /* Walk entire Info table; Null name terminates */
621 for (; Info->Name; Info++)
624 * Target points to the field within the ACPI Table. CurrentOffset is
625 * the offset of the field from the start of the main table.
627 Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);
628 CurrentOffset = TableOffset + Info->Offset;
630 /* Check for beyond EOT or beyond subtable end */
632 if ((CurrentOffset >= TableLength) ||
633 (SubtableLength && (Info->Offset >= SubtableLength)))
635 AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
636 return (AE_BAD_DATA);
639 /* Generate the byte length for this field */
641 switch (Info->Opcode)
644 case ACPI_DMT_CHKSUM:
645 case ACPI_DMT_SPACEID:
646 case ACPI_DMT_ACCWIDTH:
651 case ACPI_DMT_HESTNTYP:
652 case ACPI_DMT_FADTPM:
653 case ACPI_DMT_EINJACT:
654 case ACPI_DMT_EINJINST:
655 case ACPI_DMT_ERSTACT:
656 case ACPI_DMT_ERSTINST:
659 case ACPI_DMT_UINT16:
664 case ACPI_DMT_UINT24:
667 case ACPI_DMT_UINT32:
676 case ACPI_DMT_UINT56:
680 case ACPI_DMT_UINT64:
688 case ACPI_DMT_BUF128:
691 case ACPI_DMT_STRING:
692 ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
695 if (!LastOutputBlankLine)
698 LastOutputBlankLine = TRUE;
700 ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
702 case ACPI_DMT_HESTNTFY:
703 if (!LastOutputBlankLine)
706 LastOutputBlankLine = TRUE;
708 ByteLength = sizeof (ACPI_HEST_NOTIFY);
715 if (CurrentOffset + ByteLength > TableLength)
717 AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
718 return (AE_BAD_DATA);
721 /* Start a new line and decode the opcode */
723 AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
725 switch (Info->Opcode)
727 /* Single-bit Flag fields. Note: Opcode is the bit position */
738 AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);
741 /* 2-bit Flag fields */
743 case ACPI_DMT_FLAGS0:
745 AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
748 case ACPI_DMT_FLAGS2:
750 AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
753 /* Standard Data Types */
757 AcpiOsPrintf ("%2.2X\n", *Target);
760 case ACPI_DMT_UINT16:
762 AcpiOsPrintf ("%4.4X\n", ACPI_GET16 (Target));
765 case ACPI_DMT_UINT24:
767 AcpiOsPrintf ("%2.2X%2.2X%2.2X\n",
768 *Target, *(Target + 1), *(Target + 2));
771 case ACPI_DMT_UINT32:
773 AcpiOsPrintf ("%8.8X\n", ACPI_GET32 (Target));
776 case ACPI_DMT_UINT56:
778 for (Temp8 = 0; Temp8 < 7; Temp8++)
780 AcpiOsPrintf ("%2.2X", Target[Temp8]);
785 case ACPI_DMT_UINT64:
787 AcpiOsPrintf ("%8.8X%8.8X\n",
788 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target)));
793 case ACPI_DMT_BUF128:
796 * Buffer: Size depends on the opcode and was set above.
797 * Each hex byte is separated with a space.
798 * Multiple lines are separated by line continuation char.
800 for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
802 AcpiOsPrintf ("%2.2X", Target[Temp16]);
803 if ((UINT32) (Temp16 + 1) < ByteLength)
805 if ((Temp16 > 0) && (!((Temp16+1) % 16)))
807 AcpiOsPrintf (" \\\n"); /* Line continuation */
808 AcpiDmLineHeader (0, 0, NULL);
821 /* Convert 16-byte UUID buffer to 36-byte formatted UUID string */
823 (void) AuConvertUuidToString ((char *) Target, MsgBuffer);
825 AcpiOsPrintf ("%s\n", MsgBuffer);
828 case ACPI_DMT_STRING:
830 AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
833 /* Fixed length ASCII name fields */
837 AcpiDmCheckAscii (Target, RepairedName, 4);
838 AcpiOsPrintf ("\"%.4s\" ", RepairedName);
839 TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target));
842 AcpiOsPrintf (STRING_FORMAT, TableData->Name);
852 AcpiDmCheckAscii (Target, RepairedName, 4);
853 AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
858 AcpiDmCheckAscii (Target, RepairedName, 6);
859 AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
864 AcpiDmCheckAscii (Target, RepairedName, 8);
865 AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
868 /* Special Data Types */
870 case ACPI_DMT_CHKSUM:
872 /* Checksum, display and validate */
874 AcpiOsPrintf ("%2.2X", *Target);
875 Temp8 = AcpiDmGenerateChecksum (Table,
876 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
877 ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
878 if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
881 " /* Incorrect checksum, should be %2.2X */", Temp8);
886 case ACPI_DMT_SPACEID:
888 /* Address Space ID */
890 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));
893 case ACPI_DMT_ACCWIDTH:
895 /* Encoded Access Width */
898 if (Temp8 > ACPI_GAS_WIDTH_RESERVED)
900 Temp8 = ACPI_GAS_WIDTH_RESERVED;
903 AcpiOsPrintf (UINT8_FORMAT, Temp8, AcpiDmGasAccessWidth[Temp8]);
908 /* Generic Address Structure */
910 AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
911 AcpiDmDumpTable (TableLength, CurrentOffset, Target,
912 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
914 LastOutputBlankLine = TRUE;
919 /* ASF subtable types */
921 Temp16 = (UINT16) ((*Target) & 0x7F); /* Top bit can be zero or one */
922 if (Temp16 > ACPI_ASF_TYPE_RESERVED)
924 Temp16 = ACPI_ASF_TYPE_RESERVED;
927 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
932 /* DMAR subtable types */
934 Temp16 = ACPI_GET16 (Target);
935 if (Temp16 > ACPI_DMAR_TYPE_RESERVED)
937 Temp16 = ACPI_DMAR_TYPE_RESERVED;
940 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
943 case ACPI_DMT_EINJACT:
945 /* EINJ Action types */
948 if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
950 Temp8 = ACPI_EINJ_ACTION_RESERVED;
953 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]);
956 case ACPI_DMT_EINJINST:
958 /* EINJ Instruction types */
961 if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
963 Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
966 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]);
969 case ACPI_DMT_ERSTACT:
971 /* ERST Action types */
974 if (Temp8 > ACPI_ERST_ACTION_RESERVED)
976 Temp8 = ACPI_ERST_ACTION_RESERVED;
979 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]);
982 case ACPI_DMT_ERSTINST:
984 /* ERST Instruction types */
987 if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
989 Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
992 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
997 /* HEST subtable types */
999 Temp16 = ACPI_GET16 (Target);
1000 if (Temp16 > ACPI_HEST_TYPE_RESERVED)
1002 Temp16 = ACPI_HEST_TYPE_RESERVED;
1005 AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]);
1008 case ACPI_DMT_HESTNTFY:
1010 AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure");
1011 AcpiDmDumpTable (TableLength, CurrentOffset, Target,
1012 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
1013 AcpiOsPrintf ("\n");
1014 LastOutputBlankLine = TRUE;
1017 case ACPI_DMT_HESTNTYP:
1019 /* HEST Notify types */
1022 if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)
1024 Temp8 = ACPI_HEST_NOTIFY_RESERVED;
1027 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]);
1032 /* MADT subtable types */
1035 if (Temp8 > ACPI_MADT_TYPE_RESERVED)
1037 Temp8 = ACPI_MADT_TYPE_RESERVED;
1040 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
1045 /* SLIC subtable types */
1048 if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
1050 Temp8 = ACPI_SLIC_TYPE_RESERVED;
1053 AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmSlicSubnames[Temp8]);
1058 /* SRAT subtable types */
1061 if (Temp8 > ACPI_SRAT_TYPE_RESERVED)
1063 Temp8 = ACPI_SRAT_TYPE_RESERVED;
1066 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]);
1069 case ACPI_DMT_FADTPM:
1071 /* FADT Preferred PM Profile names */
1074 if (Temp8 > ACPI_FADT_PM_RESERVED)
1076 Temp8 = ACPI_FADT_PM_RESERVED;
1079 AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]);
1084 /* IVRS subtable types */
1089 case ACPI_IVRS_TYPE_HARDWARE:
1090 Name = AcpiDmIvrsSubnames[0];
1093 case ACPI_IVRS_TYPE_MEMORY1:
1094 case ACPI_IVRS_TYPE_MEMORY2:
1095 case ACPI_IVRS_TYPE_MEMORY3:
1096 Name = AcpiDmIvrsSubnames[1];
1100 Name = AcpiDmIvrsSubnames[2];
1104 AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
1111 ACPI_ERROR ((AE_INFO,
1112 "**** Invalid table opcode [0x%X] ****\n", Info->Opcode));
1113 return (AE_SUPPORT);
1117 if (TableOffset && !SubtableLength)
1119 /* If this table is not the main table, subtable must have valid length */
1121 AcpiOsPrintf ("Invalid zero length subtable\n");
1122 return (AE_BAD_DATA);
1129 /*******************************************************************************
1131 * FUNCTION: AcpiDmCheckAscii
1133 * PARAMETERS: Name - Ascii string
1134 * Count - Number of characters to check
1138 * DESCRIPTION: Ensure that the requested number of characters are printable
1139 * Ascii characters. Sets non-printable and null chars to <space>.
1141 ******************************************************************************/
1152 for (i = 0; i < Count; i++)
1154 RepairedName[i] = (char) Name[i];
1160 if (!isprint (Name[i]))
1162 RepairedName[i] = ' ';