Path: blob/main/sys/contrib/dev/acpica/common/dmtable.c
48375 views
/******************************************************************************1*2* Module Name: dmtable - Support for ACPI tables that contain no AML code3*4*****************************************************************************/56/******************************************************************************7*8* 1. Copyright Notice9*10* Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.11* All rights reserved.12*13* 2. License14*15* 2.1. This is your license from Intel Corp. under its intellectual property16* rights. You may have additional license terms from the party that provided17* you this software, covering your right to use that party's intellectual18* property rights.19*20* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a21* copy of the source code appearing in this file ("Covered Code") an22* irrevocable, perpetual, worldwide license under Intel's copyrights in the23* base code distributed originally by Intel ("Original Intel Code") to copy,24* make derivatives, distribute, use and display any portion of the Covered25* Code in any form, with the right to sublicense such rights; and26*27* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent28* license (with the right to sublicense), under only those claims of Intel29* patents that are infringed by the Original Intel Code, to make, use, sell,30* offer to sell, and import the Covered Code and derivative works thereof31* solely to the minimum extent necessary to exercise the above copyright32* license, and in no event shall the patent license extend to any additions33* to or modifications of the Original Intel Code. No other license or right34* is granted directly or by implication, estoppel or otherwise;35*36* The above copyright and patent license is granted only if the following37* conditions are met:38*39* 3. Conditions40*41* 3.1. Redistribution of Source with Rights to Further Distribute Source.42* Redistribution of source code of any substantial portion of the Covered43* Code or modification with rights to further distribute source must include44* the above Copyright Notice, the above License, this list of Conditions,45* and the following Disclaimer and Export Compliance provision. In addition,46* Licensee must cause all Covered Code to which Licensee contributes to47* contain a file documenting the changes Licensee made to create that Covered48* Code and the date of any change. Licensee must include in that file the49* documentation of any changes made by any predecessor Licensee. Licensee50* must include a prominent statement that the modification is derived,51* directly or indirectly, from Original Intel Code.52*53* 3.2. Redistribution of Source with no Rights to Further Distribute Source.54* Redistribution of source code of any substantial portion of the Covered55* Code or modification without rights to further distribute source must56* include the following Disclaimer and Export Compliance provision in the57* documentation and/or other materials provided with distribution. In58* addition, Licensee may not authorize further sublicense of source of any59* portion of the Covered Code, and must include terms to the effect that the60* license from Licensee to its licensee is limited to the intellectual61* property embodied in the software Licensee provides to its licensee, and62* not to intellectual property embodied in modifications its licensee may63* make.64*65* 3.3. Redistribution of Executable. Redistribution in executable form of any66* substantial portion of the Covered Code or modification must reproduce the67* above Copyright Notice, and the following Disclaimer and Export Compliance68* provision in the documentation and/or other materials provided with the69* distribution.70*71* 3.4. Intel retains all right, title, and interest in and to the Original72* Intel Code.73*74* 3.5. Neither the name Intel nor any other trademark owned or controlled by75* Intel shall be used in advertising or otherwise to promote the sale, use or76* other dealings in products derived from or relating to the Covered Code77* without prior written authorization from Intel.78*79* 4. Disclaimer and Export Compliance80*81* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED82* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE83* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,84* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY85* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY86* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A87* PARTICULAR PURPOSE.88*89* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES90* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR91* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,92* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY93* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL94* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS95* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY96* LIMITED REMEDY.97*98* 4.3. Licensee shall not export, either directly or indirectly, any of this99* software or system incorporating such software without first obtaining any100* required license or other approval from the U. S. Department of Commerce or101* any other agency or department of the United States Government. In the102* event Licensee exports any such software from the United States or103* re-exports any such software from a foreign destination, Licensee shall104* ensure that the distribution and export/re-export of the software is in105* compliance with all laws, regulations, orders, or other restrictions of the106* U.S. Export Administration Regulations. Licensee agrees that neither it nor107* any of its subsidiaries will export/re-export any technical data, process,108* software, or service, directly or indirectly, to any country for which the109* United States government or any agency thereof requires an export license,110* other governmental approval, or letter of assurance, without first obtaining111* such license, approval or letter.112*113*****************************************************************************114*115* Alternatively, you may choose to be licensed under the terms of the116* following license:117*118* Redistribution and use in source and binary forms, with or without119* modification, are permitted provided that the following conditions120* are met:121* 1. Redistributions of source code must retain the above copyright122* notice, this list of conditions, and the following disclaimer,123* without modification.124* 2. Redistributions in binary form must reproduce at minimum a disclaimer125* substantially similar to the "NO WARRANTY" disclaimer below126* ("Disclaimer") and any redistribution must be conditioned upon127* including a substantially similar Disclaimer requirement for further128* binary redistribution.129* 3. Neither the names of the above-listed copyright holders nor the names130* of any contributors may be used to endorse or promote products derived131* from this software without specific prior written permission.132*133* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS134* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT135* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR136* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT137* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,138* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT139* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,140* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY141* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT142* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE143* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.144*145* Alternatively, you may choose to be licensed under the terms of the146* GNU General Public License ("GPL") version 2 as published by the Free147* Software Foundation.148*149*****************************************************************************/150151#include <contrib/dev/acpica/include/acpi.h>152#include <contrib/dev/acpica/include/accommon.h>153#include <contrib/dev/acpica/include/acdisasm.h>154#include <contrib/dev/acpica/include/actables.h>155#include <contrib/dev/acpica/compiler/aslcompiler.h>156157/* This module used for application-level code only */158159#define _COMPONENT ACPI_CA_DISASSEMBLER160ACPI_MODULE_NAME ("dmtable")161162const AH_TABLE *163AcpiAhGetTableInfo (164char *Signature);165166167/* Common format strings for commented values */168169#define UINT8_FORMAT "%2.2X [%s]\n"170#define UINT8_FORMAT_NO_NEWLINE "%2.2X [%s]"171#define UINT16_FORMAT "%4.4X [%s]\n"172#define UINT32_FORMAT "%8.8X [%s]\n"173#define STRING_FORMAT "[%s]\n"174175/* These tables map a subtable type to a description string */176177static const char *AcpiDmAestResourceNames[] =178{179"Cache Resource",180"TLB Resource",181"Generic Resource",182"Unknown Resource Type" /* Reserved */183};184185static const char *AcpiDmAestSubnames[] =186{187"Processor Error Node",188"Memory Error Node",189"SMMU Error Node",190"Vendor-defined Error Node",191"GIC Error Node",192"PCIE Error Node",193"PROXY Error Node",194"Unknown Subtable Type" /* Reserved */195};196197static const char *AcpiDmAestCacheNames[] =198{199"Data Cache",200"Instruction Cache",201"Unified Cache",202"Unknown Cache Type" /* Reserved */203};204205static const char *AcpiDmAestGicNames[] =206{207"GIC CPU",208"GIC Distributor",209"GIC Redistributor",210"GIC ITS",211"Unknown GIC Interface Type" /* Reserved */212};213214static const char *AcpiDmAestXfaceNames[] =215{216"System Register Interface",217"Memory Mapped Interface",218"Single Record Memory Mapped Interface",219"Unknown Interface Type" /* Reserved */220};221222static const char *AcpiDmAestXruptNames[] =223{224"Fault Handling Interrupt",225"Error Recovery Interrupt",226"Unknown Interrupt Type" /* Reserved */227};228229static const char *AcpiDmAsfSubnames[] =230{231"ASF Information",232"ASF Alerts",233"ASF Remote Control",234"ASF RMCP Boot Options",235"ASF Address",236"Unknown Subtable Type" /* Reserved */237};238239static const char *AcpiDmAsptSubnames[] =240{241"ASPT Global Registers",242"ASPT SEV Mailbox Registers",243"ASPT ACPI Mailbox Registers",244"Unknown Subtable Type" /* Reserved */245};246247static const char *AcpiDmCdatSubnames[] =248{249"Device Scoped Memory Affinity Structure (DSMAS)",250"Device scoped Latency and Bandwidth Information Structure (DSLBIS)",251"Device Scoped Memory Side Cache Information Structure (DSMSCIS)",252"Device Scoped Initiator Structure (DSIS)",253"Device Scoped EFI Memory Type Structure (DSEMTS)",254"Switch Scoped Latency and Bandwidth Information Structure (SSLBIS)",255"Unknown Subtable Type" /* Reserved */256};257258static const char *AcpiDmCedtSubnames[] =259{260"CXL Host Bridge Structure",261"CXL Fixed Memory Window Structure",262"CXL XOR Interleave Math Structure",263"Unknown Subtable Type" /* Reserved */264};265266static const char *AcpiDmDmarSubnames[] =267{268"Hardware Unit Definition",269"Reserved Memory Region",270"Root Port ATS Capability",271"Remapping Hardware Static Affinity",272"ACPI Namespace Device Declaration",273"SoC Integrated Address Translation Cache",274"SoC Integrated Device Property",275"Unknown Subtable Type" /* Reserved */276};277278static const char *AcpiDmDmarScope[] =279{280"Reserved value",281"PCI Endpoint Device",282"PCI Bridge Device",283"IOAPIC Device",284"Message-capable HPET Device",285"Namespace Device",286"Unknown Scope Type" /* Reserved */287};288289static const char *AcpiDmEinjActions[] =290{291"Begin Operation",292"Get Trigger Table",293"Set Error Type",294"Get Error Type",295"End Operation",296"Execute Operation",297"Check Busy Status",298"Get Command Status",299"Set Error Type With Address",300"Get Execute Timings",301"Unknown Action"302};303304static const char *AcpiDmEinjInstructions[] =305{306"Read Register",307"Read Register Value",308"Write Register",309"Write Register Value",310"Noop",311"Flush Cacheline",312"Unknown Instruction"313};314315static const char *AcpiDmErdtSubnames[] =316{317"RMDD",318"CACD",319"DACD",320"CMRC",321"MMRC",322"MARC",323"CARC",324"CMRD",325"IBRD",326"IBAD",327"CARD",328"RESERVED"329};330331static const char *AcpiDmErstActions[] =332{333"Begin Write Operation",334"Begin Read Operation",335"Begin Clear Operation",336"End Operation",337"Set Record Offset",338"Execute Operation",339"Check Busy Status",340"Get Command Status",341"Get Record Identifier",342"Set Record Identifier",343"Get Record Count",344"Begin Dummy Write",345"Unused/Unknown Action",346"Get Error Address Range",347"Get Error Address Length",348"Get Error Attributes",349"Execute Timings",350"Unknown Action"351};352353static const char *AcpiDmErstInstructions[] =354{355"Read Register",356"Read Register Value",357"Write Register",358"Write Register Value",359"Noop",360"Load Var1",361"Load Var2",362"Store Var1",363"Add",364"Subtract",365"Add Value",366"Subtract Value",367"Stall",368"Stall While True",369"Skip Next If True",370"GoTo",371"Set Source Address",372"Set Destination Address",373"Move Data",374"Unknown Instruction"375};376377static const char *AcpiDmGtdtSubnames[] =378{379"Generic Timer Block",380"Generic Watchdog Timer",381"Unknown Subtable Type" /* Reserved */382};383384static const char *AcpiDmHestSubnames[] =385{386"IA-32 Machine Check Exception",387"IA-32 Corrected Machine Check",388"IA-32 Non-Maskable Interrupt",389"Unknown Subtable Type", /* 3 - Reserved */390"Unknown Subtable Type", /* 4 - Reserved */391"Unknown Subtable Type", /* 5 - Reserved */392"PCI Express Root Port AER",393"PCI Express AER (AER Endpoint)",394"PCI Express/PCI-X Bridge AER",395"Generic Hardware Error Source",396"Generic Hardware Error Source V2",397"IA-32 Deferred Machine Check",398"Unknown Subtable Type" /* Reserved */399};400401static const char *AcpiDmHestNotifySubnames[] =402{403"Polled",404"External Interrupt",405"Local Interrupt",406"SCI",407"NMI",408"CMCI", /* ACPI 5.0 */409"MCE", /* ACPI 5.0 */410"GPIO", /* ACPI 6.0 */411"SEA", /* ACPI 6.1 */412"SEI", /* ACPI 6.1 */413"GSIV", /* ACPI 6.1 */414"Software Delegated Exception", /* ACPI 6.2 */415"Unknown Notify Type" /* Reserved */416};417418static const char *AcpiDmHmatSubnames[] =419{420"Memory Proximity Domain Attributes",421"System Locality Latency and Bandwidth Information",422"Memory Side Cache Information",423"Unknown Structure Type" /* Reserved */424};425426static const char *AcpiDmMadtSubnames[] =427{428"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */429"I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */430"Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */431"NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */432"Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */433"Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */434"I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */435"Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */436"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */437"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */438"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */439"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */440"Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */441"Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */442"Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */443"Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */444"Mutiprocessor Wakeup", /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */445"CPU Core Interrupt Controller", /* ACPI_MADT_TYPE_CORE_PIC */446"Legacy I/O Interrupt Controller", /* ACPI_MADT_TYPE_LIO_PIC */447"HT Interrupt Controller", /* ACPI_MADT_TYPE_HT_PIC */448"Extend I/O Interrupt Controller", /* ACPI_MADT_TYPE_EIO_PIC */449"MSI Interrupt Controller", /* ACPI_MADT_TYPE_MSI_PIC */450"Bridge I/O Interrupt Controller", /* ACPI_MADT_TYPE_BIO_PIC */451"LPC Interrupt Controller", /* ACPI_MADT_TYPE_LPC_PIC */452"RISC-V Interrupt Controller", /* ACPI_MADT_TYPE_RINTC */453"RISC-V Incoming MSI Controller", /* ACPI_MADT_TYPE_IMSIC */454"RISC-V APLIC Controller", /* ACPI_MADT_TYPE_APLIC */455"RISC-V PLIC Controller", /* ACPI_MADT_TYPE_PLIC */456"Unknown Subtable Type", /* Reserved */457"Types 80-FF are used for OEM data" /* Reserved for OEM data */458};459460static const char *AcpiDmMpamSubnames[] =461{462"Processor cache", /* ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE */463"Memory", /* ACPI_MPAM_LOCATION_TYPE_MEMORY */464"SMMU", /* ACPI_MPAM_LOCATION_TYPE_SMMU */465"Memory-side cache", /* ACPI_MPAM_LOCATION_TYPE_MEMORY_CACHE */466"ACPI device", /* ACPI_MPAM_LOCATION_TYPE_ACPI_DEVICE */467"Interconnect", /* ACPI_MPAM_LOCATION_TYPE_INTERCONNECT */468"Unknown" /* ACPI_MPAM_LOCATION_TYPE_UNKNOWN */469};470471static const char *AcpiDmNfitSubnames[] =472{473"System Physical Address Range", /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */474"Memory Range Map", /* ACPI_NFIT_TYPE_MEMORY_MAP */475"Interleave Info", /* ACPI_NFIT_TYPE_INTERLEAVE */476"SMBIOS Information", /* ACPI_NFIT_TYPE_SMBIOS */477"NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */478"NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */479"Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */480"Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */481"Unknown Subtable Type" /* Reserved */482};483484static const char *AcpiDmPcctSubnames[] =485{486"Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */487"HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */488"HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */489"Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */490"Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */491"HW Registers based Comm Subspace", /* ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE */492"Unknown Subtable Type" /* Reserved */493};494495static const char *AcpiDmPhatSubnames[] =496{497"Firmware Version Data", /* ACPI_PHAT_TYPE_FW_VERSION_DATA */498"Firmware Health Data", /* ACPI_PHAT_TYPE_FW_HEALTH_DATA */499"Unknown Subtable Type" /* Reserved */500};501502static const char *AcpiDmPmttSubnames[] =503{504"Socket", /* ACPI_PMTT_TYPE_SOCKET */505"Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */506"Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */507"Unknown Subtable Type", /* Reserved */508"Vendor Specific" /* ACPI_PMTT_TYPE_VENDOR */509};510511static const char *AcpiDmPpttSubnames[] =512{513"Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */514"Cache Type", /* ACPI_PPTT_TYPE_CACHE */515"ID", /* ACPI_PPTT_TYPE_ID */516"Unknown Subtable Type" /* Reserved */517};518519static const char *AcpiDmRgrtSubnames[] =520{521"Unknown/Reserved Image Type", /* ACPI_RGRT_TYPE_RESERVED0 */522"Type PNG" /* ACPI_RGRT_IMAGE_TYPE_PNG */523};524525static const char *AcpiDmSdevSubnames[] =526{527"Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */528"PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */529"Unknown Subtable Type" /* Reserved */530};531532static const char *AcpiDmSratSubnames[] =533{534"Processor Local APIC/SAPIC Affinity",535"Memory Affinity",536"Processor Local x2APIC Affinity",537"GICC Affinity",538"GIC ITS Affinity", /* Acpi 6.2 */539"Generic Initiator Affinity", /* Acpi 6.3 */540"Generic Port Affinity", /* Acpi 6.4 */541"RINTC Affinity", /* Acpi 6.6 */542"Unknown Subtable Type" /* Reserved */543};544545static const char *AcpiDmTpm2Subnames[] =546{547"Illegal Start Method value",548"Reserved",549"ACPI Start Method",550"Reserved",551"Reserved",552"Reserved",553"Memory Mapped I/O",554"Command Response Buffer",555"Command Response Buffer with ACPI Start Method",556"Reserved",557"Reserved",558"Command Response Buffer with ARM SMC",559"Unknown Subtable Type" /* Reserved */560};561562static const char *AcpiDmIvrsSubnames[] =563{564"Hardware Definition Block (IVHD)",565"Hardware Definition Block - Mixed Format (IVHD)",566"Memory Definition Block (IVMD)",567"Unknown/Reserved Subtable Type" /* Reserved */568};569570static const char *AcpiDmIvrsDevEntryNames[] =571{572"Unknown/Reserved Device Entry Type", /* 0- Reserved */573"Device Entry: Select All Devices", /* 1 */574"Device Entry: Select One Device", /* 2 */575"Device Entry: Start of Range", /* 3 */576"Device Entry: End of Range", /* 4 */577"Device Entry: Alias Select", /* 66 */578"Device Entry: Alias Start of Range", /* 67 */579"Unknown/Reserved Device Entry Type", /* 68- Reserved */580"Unknown/Reserved Device Entry Type", /* 69- Reserved */581"Device Entry: Extended Select", /* 70 */582"Device Entry: Extended Start of Range", /* 71 */583"Device Entry: Special Device", /* 72 */584"Device Entry: ACPI HID Named Device", /* 240 */585"Unknown/Reserved Device Entry Type" /* Reserved */586};587588static const char *AcpiDmLpitSubnames[] =589{590"Native C-state Idle Structure",591"Unknown Subtable Type" /* Reserved */592};593594static const char *AcpiDmViotSubnames[] =595{596"Unknown Subtable Type", /* 0 -Reserved */597"PCI Range",598"MMIO Endpoint",599"VirtIO-PCI IOMMU",600"VirtIO-MMIO IOMMU",601"Unknown Subtable Type" /* Reserved */602};603604#define ACPI_FADT_PM_RESERVED 9605606static const char *AcpiDmFadtProfiles[] =607{608"Unspecified",609"Desktop",610"Mobile",611"Workstation",612"Enterprise Server",613"SOHO Server",614"Appliance PC",615"Performance Server",616"Tablet",617"Unknown Profile Type"618};619620#define ACPI_GAS_WIDTH_RESERVED 5621622static const char *AcpiDmGasAccessWidth[] =623{624"Undefined/Legacy",625"Byte Access:8",626"Word Access:16",627"DWord Access:32",628"QWord Access:64",629"Unknown Width Encoding"630};631632static const char *AcpiDmRhctSubnames[] =633{634"RISC-V ISA string structure", /* ACPI_RHCT_ISA_STRING */635"RISC-V CMO node structure", /* ACPI_RHCT_CMO_NODE */636"RISC-V MMU node structure", /* ACPI_RHCT_MMU_NODE */637"RISC-V Hart Info structure", /* ACPI_RHCT_HART_INFO */638};639640641/*******************************************************************************642*643* ACPI Table Data, indexed by signature.644*645* Each entry contains: Signature, Table Info, Handler, DtHandler,646* Template, Description647*648* Simple tables have only a TableInfo structure, complex tables have a649* handler. This table must be NULL terminated. RSDP and FACS are650* special-cased elsewhere.651*652* Note: Any tables added here should be duplicated within653* AcpiGbl_SupportedTables in the file common/ahtable.c654*655******************************************************************************/656657const ACPI_DMTABLE_DATA AcpiDmTableData[] =658{659{ACPI_SIG_AEST, NULL, AcpiDmDumpAest, DtCompileAest, TemplateAest},660{ACPI_SIG_AGDI, AcpiDmTableInfoAgdi, NULL, NULL, TemplateAgdi},661{ACPI_SIG_APMT, NULL, AcpiDmDumpApmt, DtCompileApmt, TemplateApmt},662{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf},663{ACPI_SIG_ASPT, NULL, AcpiDmDumpAspt, DtCompileAspt, TemplateAspt},664{ACPI_SIG_BDAT, AcpiDmTableInfoBdat, NULL, NULL, TemplateBdat},665{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},666{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},667{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},668{ACPI_SIG_CCEL, AcpiDmTableInfoCcel, NULL, NULL, TemplateCcel},669{ACPI_SIG_CDAT, NULL, AcpiDmDumpCdat, NULL, TemplateCdat},670{ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt},671{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},672{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},673{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},674{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp},675{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar},676{ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm},677{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt},678{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj},679{ACPI_SIG_ERDT, NULL, AcpiDmDumpErdt, DtCompileErdt, TemplateErdt},680{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst},681{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt},682{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt},683{ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt},684{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest},685{ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat},686{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet},687{ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort},688{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs},689{ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit},690{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt},691{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg},692{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi},693{ACPI_SIG_MPAM, NULL, AcpiDmDumpMpam, DtCompileMpam, TemplateMpam},694{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst},695{ACPI_SIG_MRRM, NULL, AcpiDmDumpMrrm, DtCompileMrrm, TemplateMrrm},696{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct},697{ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm},698{ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit},699{ACPI_SIG_NHLT, NULL, NULL, NULL, NULL},700{ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct},701{ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt},702{ACPI_SIG_PHAT, NULL, AcpiDmDumpPhat, DtCompilePhat, TemplatePhat},703{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt},704{ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt},705{ACPI_SIG_PRMT, NULL, AcpiDmDumpPrmt, DtCompilePrmt, TemplatePrmt},706{ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf},707{ACPI_SIG_RAS2, AcpiDmTableInfoRas2, AcpiDmDumpRas2, DtCompileRas2, TemplateRas2},708{ACPI_SIG_RGRT, NULL, AcpiDmDumpRgrt, DtCompileRgrt, TemplateRgrt},709{ACPI_SIG_RHCT, NULL, AcpiDmDumpRhct, DtCompileRhct, TemplateRhct},710{ACPI_SIG_RIMT, NULL, AcpiDmDumpRimt, DtCompileRimt, TemplateRimt},711{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},712{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},713{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},714{ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei},715{ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev},716{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic},717{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit},718{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr},719{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi},720{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat},721{ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao},722{ACPI_SIG_SVKL, AcpiDmTableInfoSvkl, AcpiDmDumpSvkl, DtCompileSvkl, TemplateSvkl},723{ACPI_SIG_SWFT, NULL, NULL, NULL, NULL},724{ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa},725{ACPI_SIG_TDEL, AcpiDmTableInfoTdel, NULL, NULL, TemplateTdel},726{ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2},727{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi},728{ACPI_SIG_VIOT, AcpiDmTableInfoViot, AcpiDmDumpViot, DtCompileViot, TemplateViot},729{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet},730{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat},731{ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt},732{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt},733{ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt},734{ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt},735{ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv},736{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt},737{NULL, NULL, NULL, NULL, NULL}738};739740741/*******************************************************************************742*743* FUNCTION: AcpiDmGetTableData744*745* PARAMETERS: Signature - ACPI signature (4 chars) to match746*747* RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.748*749* DESCRIPTION: Find a match in the global table of supported ACPI tables750*751******************************************************************************/752753const ACPI_DMTABLE_DATA *754AcpiDmGetTableData (755char *Signature)756{757const ACPI_DMTABLE_DATA *Info;758759760for (Info = AcpiDmTableData; Info->Signature; Info++)761{762if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature))763{764return (Info);765}766}767768return (NULL);769}770771772/*******************************************************************************773*774* FUNCTION: AcpiDmDumpDataTable775*776* PARAMETERS: Table - An ACPI table777*778* RETURN: None.779*780* DESCRIPTION: Format the contents of an ACPI data table (any table other781* than an SSDT or DSDT that does not contain executable AML code)782*783******************************************************************************/784785void786AcpiDmDumpDataTable (787ACPI_TABLE_HEADER *Table)788{789ACPI_STATUS Status;790const ACPI_DMTABLE_DATA *TableData;791UINT32 Length;792793794/* Ignore tables that contain AML */795796if (AcpiUtIsAmlTable (Table))797{798if (AslGbl_VerboseTemplates)799{800/* Dump the raw table data */801802Length = Table->Length;803804AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",805ACPI_RAW_TABLE_DATA_HEADER, Length, Length);806AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),807Length, DB_BYTE_DISPLAY, 0);808AcpiOsPrintf (" */\n");809}810return;811}812813/*814* Handle tables that don't use the common ACPI table header structure.815* Currently, these are the FACS, RSDP, S3PT and CDAT.816*/817if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))818{819Length = Table->Length;820Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);821if (ACPI_FAILURE (Status))822{823return;824}825}826else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP,827Table)->Signature))828{829Length = AcpiDmDumpRsdp (Table);830}831else if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT))832{833Length = AcpiDmDumpS3pt (Table);834}835else if (!AcpiUtValidNameseg (Table->Signature))836{837/*838* For CDAT we are assuming that there should be at least one non-ASCII839* byte in the (normally) 4-character Signature field (at least the840* high-order byte should be zero).841*/842if (AcpiGbl_CDAT)843{844/*845* Invalid signature and <-ds CDAT> was specified on the command line.846* Therefore, we have a CDAT table.847*/848AcpiDmDumpCdat (Table);849}850else851{852fprintf (stderr, "Table has an invalid signature\n");853}854855return;856}857else858{859/*860* All other tables must use the common ACPI table header, dump it now861*/862Length = Table->Length;863Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);864if (ACPI_FAILURE (Status))865{866return;867}868AcpiOsPrintf ("\n");869870/* Match signature and dispatch appropriately */871872TableData = AcpiDmGetTableData (Table->Signature);873if (!TableData)874{875if (!strncmp (Table->Signature, "OEM", 3))876{877AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",878Table->Signature);879}880else881{882AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",883Table->Signature);884885fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",886Table->Signature);887888if (!AcpiGbl_ForceAmlDisassembly)889{890fprintf (stderr, "decoding ACPI table header only\n");891}892else893{894fprintf (stderr, "assuming table contains valid AML code\n");895}896}897}898else if (TableData->TableHandler)899{900/* Complex table, has a handler */901902TableData->TableHandler (Table);903}904else if (TableData->TableInfo)905{906/* Simple table, just walk the info table */907908Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);909if (ACPI_FAILURE (Status))910{911return;912}913}914}915916if (!AslGbl_DoTemplates || AslGbl_VerboseTemplates)917{918/* Dump the raw table data */919920AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",921ACPI_RAW_TABLE_DATA_HEADER, Length, Length);922AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),923Length, DB_BYTE_DISPLAY, 0);924}925}926927928/*******************************************************************************929*930* FUNCTION: AcpiDmLineHeader931*932* PARAMETERS: Offset - Current byte offset, from table start933* ByteLength - Length of the field in bytes, 0 for flags934* Name - Name of this field935*936* RETURN: None937*938* DESCRIPTION: Utility routines for formatting output lines. Displays the939* current table offset in hex and decimal, the field length,940* and the field name.941*942******************************************************************************/943944void945AcpiDmLineHeader (946UINT32 Offset,947UINT32 ByteLength,948char *Name)949{950951/* Allow a null name for fields that span multiple lines (large buffers) */952953if (!Name)954{955Name = "";956}957958if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */959{960if (ByteLength)961{962AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);963}964else965{966if (*Name)967{968AcpiOsPrintf ("%41s : ", Name);969}970else971{972AcpiOsPrintf ("%41s ", Name);973}974}975}976else /* Normal disassembler or verbose template */977{978if (ByteLength)979{980AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %27s : ",981Offset, Offset, ByteLength, Name);982}983else984{985if (*Name)986{987AcpiOsPrintf ("%44s : ", Name);988}989else990{991AcpiOsPrintf ("%44s ", Name);992}993}994}995}996997void998AcpiDmLineHeader2 (999UINT32 Offset,1000UINT32 ByteLength,1001char *Name,1002UINT32 Value)1003{10041005if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */1006{1007if (ByteLength)1008{1009AcpiOsPrintf ("[%.4d] %30s %3d : ",1010ByteLength, Name, Value);1011}1012else1013{1014AcpiOsPrintf ("%36s % 3d : ",1015Name, Value);1016}1017}1018else /* Normal disassembler or verbose template */1019{1020if (ByteLength)1021{1022AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %24s %3d : ",1023Offset, Offset, ByteLength, Name, Value);1024}1025else1026{1027AcpiOsPrintf ("[%3.3Xh %4.4u ] %24s %3d : ",1028Offset, Offset, Name, Value);1029}1030}1031}103210331034/*******************************************************************************1035*1036* FUNCTION: AcpiDmDumpTable1037*1038* PARAMETERS: TableLength - Length of the entire ACPI table1039* TableOffset - Starting offset within the table for this1040* sub-descriptor (0 if main table)1041* Table - The ACPI table1042* SubtableLength - Length of this sub-descriptor1043* Info - Info table for this ACPI table1044*1045* RETURN: Status1046*1047* DESCRIPTION: Display ACPI table contents by walking the Info table.1048*1049* Note: This function must remain in sync with DtGetFieldLength.1050*1051******************************************************************************/10521053ACPI_STATUS1054AcpiDmDumpTable (1055UINT32 TableLength,1056UINT32 TableOffset,1057void *Table,1058UINT32 SubtableLength,1059ACPI_DMTABLE_INFO *Info)1060{1061UINT8 *Target;1062UINT32 CurrentOffset;1063UINT32 ByteLength;1064UINT8 Temp8;1065UINT16 Temp16;1066UINT32 Temp32;1067UINT64 Value;1068const AH_TABLE *TableData;1069const char *Name;1070BOOLEAN LastOutputBlankLine = FALSE;1071ACPI_STATUS Status;1072char RepairedName[8];107310741075if (!Info)1076{1077AcpiOsPrintf ("Display not implemented\n");1078return (AE_NOT_IMPLEMENTED);1079}10801081/* Walk entire Info table; Null name terminates */10821083for (; Info->Name; Info++)1084{1085/*1086* Target points to the field within the ACPI Table. CurrentOffset is1087* the offset of the field from the start of the main table.1088*/1089Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);1090CurrentOffset = TableOffset + Info->Offset;10911092/* Check for beyond subtable end or (worse) beyond EOT */10931094if (SubtableLength && (Info->Offset > SubtableLength))1095{1096AcpiOsPrintf (1097"/**** ACPI subtable terminates early (Len %u) - "1098"may be older version (dump table) */\n", SubtableLength);10991100/* Move on to next subtable */11011102return (AE_OK);1103}11041105if (CurrentOffset >= TableLength)1106{1107AcpiOsPrintf (1108"/**** ACPI table terminates "1109"in the middle of a data structure! (dump table)\n"1110"CurrentOffset: %X, TableLength: %X ***/", CurrentOffset, TableLength);1111return (AE_BAD_DATA);1112}11131114/* Generate the byte length for this field */11151116switch (Info->Opcode)1117{1118case ACPI_DMT_UINT8:1119case ACPI_DMT_CHKSUM:1120case ACPI_DMT_SPACEID:1121case ACPI_DMT_ACCWIDTH:1122case ACPI_DMT_CEDT:1123case ACPI_DMT_IVRS:1124case ACPI_DMT_IVRS_DE:1125case ACPI_DMT_GTDT:1126case ACPI_DMT_MADT:1127case ACPI_DMT_MPAM_LOCATOR:1128case ACPI_DMT_PCCT:1129case ACPI_DMT_PMTT:1130case ACPI_DMT_PPTT:1131case ACPI_DMT_RGRT:1132case ACPI_DMT_SDEV:1133case ACPI_DMT_SRAT:1134case ACPI_DMT_AEST:1135case ACPI_DMT_AEST_RES:1136case ACPI_DMT_AEST_XFACE:1137case ACPI_DMT_AEST_XRUPT:1138case ACPI_DMT_ASF:1139case ACPI_DMT_CDAT:1140case ACPI_DMT_HESTNTYP:1141case ACPI_DMT_FADTPM:1142case ACPI_DMT_EINJACT:1143case ACPI_DMT_EINJINST:1144case ACPI_DMT_ERSTACT:1145case ACPI_DMT_ERSTINST:1146case ACPI_DMT_DMAR_SCOPE:1147case ACPI_DMT_VIOT:11481149ByteLength = 1;1150break;11511152case ACPI_DMT_ASPT:1153case ACPI_DMT_UINT16:1154case ACPI_DMT_DMAR:1155case ACPI_DMT_ERDT:1156case ACPI_DMT_HEST:1157case ACPI_DMT_HMAT:1158case ACPI_DMT_NFIT:1159case ACPI_DMT_PHAT:1160case ACPI_DMT_RHCT:11611162ByteLength = 2;1163break;11641165case ACPI_DMT_UINT24:11661167ByteLength = 3;1168break;11691170case ACPI_DMT_UINT32:1171case ACPI_DMT_AEST_CACHE:1172case ACPI_DMT_AEST_GIC:1173case ACPI_DMT_NAME4:1174case ACPI_DMT_SIG:1175case ACPI_DMT_LPIT:1176case ACPI_DMT_TPM2:11771178ByteLength = 4;1179break;11801181case ACPI_DMT_UINT40:11821183ByteLength = 5;1184break;11851186case ACPI_DMT_UINT48:1187case ACPI_DMT_NAME6:11881189ByteLength = 6;1190break;11911192case ACPI_DMT_UINT56:1193case ACPI_DMT_BUF7:11941195ByteLength = 7;1196break;11971198case ACPI_DMT_UINT64:1199case ACPI_DMT_NAME8:12001201ByteLength = 8;1202break;12031204case ACPI_DMT_BUF10:12051206ByteLength = 10;1207break;12081209case ACPI_DMT_BUF11:12101211ByteLength = 11;1212break;12131214case ACPI_DMT_BUF12:12151216ByteLength = 12;1217break;12181219case ACPI_DMT_BUF16:1220case ACPI_DMT_UUID:12211222ByteLength = 16;1223break;12241225case ACPI_DMT_BUF18:12261227ByteLength = 18;1228break;12291230case ACPI_DMT_BUF24:12311232ByteLength = 24;1233break;12341235case ACPI_DMT_BUF26:12361237ByteLength = 26;1238break;12391240case ACPI_DMT_BUF32:12411242ByteLength = 32;1243break;12441245case ACPI_DMT_BUF112:12461247ByteLength = 112;1248break;12491250case ACPI_DMT_BUF128:12511252ByteLength = 128;1253break;12541255case ACPI_DMT_WPBT_UNICODE:12561257ByteLength = SubtableLength;1258CurrentOffset = sizeof (ACPI_TABLE_WPBT);1259break;12601261case ACPI_DMT_UNICODE:1262case ACPI_DMT_BUFFER:1263case ACPI_DMT_RAW_BUFFER:12641265ByteLength = SubtableLength;1266break;12671268case ACPI_DMT_PMTT_VENDOR:1269/*1270* Calculate the length of the vendor data for the PMTT table:1271* Length = (Current Subtable ptr + Subtable length) -1272* Start of the vendor data (Target)1273*/1274ByteLength = ((ACPI_CAST_PTR (char, Table) +1275(ACPI_CAST_PTR (ACPI_PMTT_HEADER, Table)->Length)) -1276ACPI_CAST_PTR (char, Target));1277break;12781279case ACPI_DMT_STRING:12801281ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;1282break;12831284case ACPI_DMT_IVRS_UNTERMINATED_STRING:12851286ByteLength = ((ACPI_CAST_PTR (ACPI_IVRS_DEVICE_HID, Target) -1)->UidLength);1287break;12881289case ACPI_DMT_GAS:12901291if (!LastOutputBlankLine)1292{1293AcpiOsPrintf ("\n");1294LastOutputBlankLine = TRUE;1295}12961297ByteLength = sizeof (ACPI_GENERIC_ADDRESS);1298break;12991300case ACPI_DMT_HESTNTFY:13011302if (!LastOutputBlankLine)1303{1304AcpiOsPrintf ("\n");1305LastOutputBlankLine = TRUE;1306}13071308ByteLength = sizeof (ACPI_HEST_NOTIFY);1309break;13101311case ACPI_DMT_IORTMEM:13121313if (!LastOutputBlankLine)1314{1315LastOutputBlankLine = FALSE;1316}13171318ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);1319break;13201321default:13221323ByteLength = 0;1324break;1325}13261327/* Check if we are beyond a subtable, or (worse) beyond EOT */13281329if (CurrentOffset + ByteLength > TableLength)1330{1331if (SubtableLength)1332{1333AcpiOsPrintf (1334"/**** ACPI subtable terminates early - "1335"may be older version (dump table) */\n");13361337/* Move on to next subtable */13381339return (AE_OK);1340}13411342AcpiOsPrintf (1343"/**** ACPI table terminates "1344"in the middle of a data structure! */\n");1345return (AE_BAD_DATA);1346}13471348if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)1349{1350AcpiOsPrintf ("%s", Info->Name);1351continue;1352}13531354/* Start a new line and decode the opcode */13551356AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);13571358switch (Info->Opcode)1359{1360/* Single-bit Flag fields. Note: Opcode is the bit position */13611362case ACPI_DMT_FLAG0:1363case ACPI_DMT_FLAG1:1364case ACPI_DMT_FLAG2:1365case ACPI_DMT_FLAG3:1366case ACPI_DMT_FLAG4:1367case ACPI_DMT_FLAG5:1368case ACPI_DMT_FLAG6:1369case ACPI_DMT_FLAG7:13701371AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);1372break;13731374/* 2-bit Flag fields */13751376case ACPI_DMT_FLAGS0:13771378AcpiOsPrintf ("%1.1X\n", *Target & 0x03);1379break;13801381case ACPI_DMT_FLAGS1:13821383AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);1384break;13851386case ACPI_DMT_FLAGS2:13871388AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);1389break;13901391case ACPI_DMT_FLAGS8_2:13921393AcpiOsPrintf ("%2.2X\n", (*Target >> 2) & 0xFF);1394break;13951396case ACPI_DMT_FLAGS4:13971398AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);1399break;14001401case ACPI_DMT_FLAGS4_0:14021403AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);1404break;14051406case ACPI_DMT_FLAGS4_4:14071408AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);1409break;14101411case ACPI_DMT_FLAGS4_8:14121413AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);1414break;14151416case ACPI_DMT_FLAGS4_12:14171418AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);1419break;14201421case ACPI_DMT_FLAGS16_16:14221423AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);1424break;14251426/* Integer Data Types */14271428case ACPI_DMT_UINT8:1429case ACPI_DMT_UINT16:1430case ACPI_DMT_UINT24:1431case ACPI_DMT_UINT32:1432case ACPI_DMT_UINT40:1433case ACPI_DMT_UINT48:1434case ACPI_DMT_UINT56:1435case ACPI_DMT_UINT64:1436/*1437* Dump bytes - high byte first, low byte last.1438* Note: All ACPI tables are little-endian.1439*/1440Value = 0;1441for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)1442{1443AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);1444Value |= Target[Temp8 - 1];1445Value <<= 8;1446}14471448if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))1449{1450AcpiOsPrintf (" [Optional field not present]");1451}14521453AcpiOsPrintf ("\n");1454break;14551456case ACPI_DMT_BUF7:1457case ACPI_DMT_BUF10:1458case ACPI_DMT_BUF11:1459case ACPI_DMT_BUF12:1460case ACPI_DMT_BUF16:1461case ACPI_DMT_BUF18:1462case ACPI_DMT_BUF24:1463case ACPI_DMT_BUF26:1464case ACPI_DMT_BUF32:1465case ACPI_DMT_BUF112:1466case ACPI_DMT_BUF128:1467/*1468* Buffer: Size depends on the opcode and was set above.1469* Each hex byte is separated with a space.1470* Multiple lines are separated by line continuation char.1471*/1472for (Temp16 = 0; Temp16 < ByteLength; Temp16++)1473{1474AcpiOsPrintf ("%2.2X", Target[Temp16]);1475if ((UINT32) (Temp16 + 1) < ByteLength)1476{1477if ((Temp16 > 0) && (!((Temp16+1) % 16)))1478{1479AcpiOsPrintf (" \\\n"); /* Line continuation */1480AcpiDmLineHeader (0, 0, NULL);1481}1482else1483{1484AcpiOsPrintf (" ");1485}1486}1487}14881489AcpiOsPrintf ("\n");1490break;14911492case ACPI_DMT_UUID:14931494/* Convert 16-byte UUID buffer to 36-byte formatted UUID string */14951496(void) AcpiUtConvertUuidToString ((char *) Target, AslGbl_MsgBuffer);14971498AcpiOsPrintf ("%s\n", AslGbl_MsgBuffer);1499break;15001501case ACPI_DMT_STRING:15021503AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));1504break;15051506case ACPI_DMT_IVRS_UNTERMINATED_STRING:15071508AcpiOsPrintf ("\"%.*s\"\n", ByteLength, ACPI_CAST_PTR (char, Target));1509break;15101511/* Fixed length ASCII name fields */15121513case ACPI_DMT_SIG:15141515AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);1516AcpiOsPrintf ("\"%.4s\" ", RepairedName);15171518TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));1519if (TableData)1520{1521AcpiOsPrintf (STRING_FORMAT, TableData->Description);1522}1523else1524{1525AcpiOsPrintf ("\n");1526}1527break;15281529case ACPI_DMT_NAME4:15301531AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);1532AcpiOsPrintf ("\"%.4s\"\n", RepairedName);1533break;15341535case ACPI_DMT_NAME6:15361537AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);1538AcpiOsPrintf ("\"%.6s\"\n", RepairedName);1539break;15401541case ACPI_DMT_NAME8:15421543AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);1544AcpiOsPrintf ("\"%.8s\"\n", RepairedName);1545break;15461547/* Special Data Types */15481549case ACPI_DMT_CHKSUM:15501551/* Checksum, display and validate */15521553AcpiOsPrintf ("%2.2X", *Target);1554Temp8 = AcpiUtGenerateChecksum (Table,1555ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,1556ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);15571558if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)1559{1560AcpiOsPrintf (1561" /* Incorrect checksum, should be %2.2X */", Temp8);1562}15631564AcpiOsPrintf ("\n");1565break;15661567case ACPI_DMT_SPACEID:15681569/* Address Space ID */15701571AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));1572break;15731574case ACPI_DMT_ACCWIDTH:15751576/* Encoded Access Width */15771578Temp8 = *Target;1579if (Temp8 > ACPI_GAS_WIDTH_RESERVED)1580{1581Temp8 = ACPI_GAS_WIDTH_RESERVED;1582}15831584AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);1585break;15861587case ACPI_DMT_GAS:15881589/* Generic Address Structure */15901591AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");1592Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,1593sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);1594if (ACPI_FAILURE (Status))1595{1596return (Status);1597}15981599AcpiOsPrintf ("\n");1600LastOutputBlankLine = TRUE;1601break;16021603case ACPI_DMT_AEST:16041605/* AEST subtable types */16061607Temp8 = *Target;1608if (Temp8 > ACPI_AEST_NODE_TYPE_RESERVED)1609{1610Temp8 = ACPI_AEST_NODE_TYPE_RESERVED;1611}16121613AcpiOsPrintf (UINT8_FORMAT, *Target,1614AcpiDmAestSubnames[Temp8]);1615break;16161617case ACPI_DMT_AEST_CACHE:16181619/* AEST cache resource subtable */16201621Temp32 = *Target;1622if (Temp32 > ACPI_AEST_CACHE_RESERVED)1623{1624Temp32 = ACPI_AEST_CACHE_RESERVED;1625}16261627AcpiOsPrintf (UINT32_FORMAT, *Target,1628AcpiDmAestCacheNames[Temp32]);1629break;16301631case ACPI_DMT_AEST_GIC:16321633/* AEST GIC error subtable */16341635Temp32 = *Target;1636if (Temp32 > ACPI_AEST_GIC_RESERVED)1637{1638Temp32 = ACPI_AEST_GIC_RESERVED;1639}16401641AcpiOsPrintf (UINT32_FORMAT, *Target,1642AcpiDmAestGicNames[Temp32]);1643break;16441645case ACPI_DMT_AEST_RES:16461647/* AEST resource type subtable */16481649Temp8 = *Target;1650if (Temp8 > ACPI_AEST_RESOURCE_RESERVED)1651{1652Temp8 = ACPI_AEST_RESOURCE_RESERVED;1653}16541655AcpiOsPrintf (UINT8_FORMAT, *Target,1656AcpiDmAestResourceNames[Temp8]);1657break;16581659case ACPI_DMT_AEST_XFACE:16601661/* AEST interface structure types */16621663Temp8 = *Target;1664if (Temp8 > ACPI_AEST_XFACE_RESERVED)1665{1666Temp8 = ACPI_AEST_XFACE_RESERVED;1667}16681669AcpiOsPrintf (UINT8_FORMAT, *Target,1670AcpiDmAestXfaceNames[Temp8]);1671break;16721673case ACPI_DMT_AEST_XRUPT:16741675/* AEST interrupt structure types */16761677Temp8 = *Target;1678if (Temp8 > ACPI_AEST_XRUPT_RESERVED)1679{1680Temp8 = ACPI_AEST_XRUPT_RESERVED;1681}16821683AcpiOsPrintf (UINT8_FORMAT, *Target,1684AcpiDmAestXruptNames[Temp8]);1685break;16861687case ACPI_DMT_ASPT:1688/* ASPT subtable types */1689Temp16 = ACPI_GET16(Target);1690if (Temp16 > ACPI_ASPT_TYPE_UNKNOWN)1691{1692Temp16 = ACPI_ASPT_TYPE_UNKNOWN;1693}16941695AcpiOsPrintf(UINT16_FORMAT, Temp16, AcpiDmAsptSubnames[Temp16]);1696break;16971698case ACPI_DMT_ASF:16991700/* ASF subtable types */17011702Temp16 = (UINT16) ((*Target) & 0x7F); /* Top bit can be zero or one */1703if (Temp16 > ACPI_ASF_TYPE_RESERVED)1704{1705Temp16 = ACPI_ASF_TYPE_RESERVED;1706}17071708AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);1709break;17101711case ACPI_DMT_CDAT:17121713/* CDAT subtable types */17141715Temp8 = *Target;1716if (Temp8 > ACPI_CDAT_TYPE_RESERVED)1717{1718Temp8 = ACPI_CDAT_TYPE_RESERVED;1719}17201721AcpiOsPrintf (UINT8_FORMAT, *Target,1722AcpiDmCdatSubnames[Temp8]);1723break;17241725case ACPI_DMT_CEDT:17261727/* CEDT subtable types */17281729Temp8 = *Target;1730if (Temp8 > ACPI_CEDT_TYPE_RESERVED)1731{1732Temp8 = ACPI_CEDT_TYPE_RESERVED;1733}17341735AcpiOsPrintf (UINT8_FORMAT, *Target,1736AcpiDmCedtSubnames[Temp8]);1737break;17381739case ACPI_DMT_DMAR:17401741/* DMAR subtable types */17421743Temp16 = ACPI_GET16 (Target);1744if (Temp16 > ACPI_DMAR_TYPE_RESERVED)1745{1746Temp16 = ACPI_DMAR_TYPE_RESERVED;1747}17481749AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1750AcpiDmDmarSubnames[Temp16]);1751break;17521753case ACPI_DMT_DMAR_SCOPE:17541755/* DMAR device scope types */17561757Temp8 = *Target;1758if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)1759{1760Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;1761}17621763AcpiOsPrintf (UINT8_FORMAT, *Target,1764AcpiDmDmarScope[Temp8]);1765break;17661767case ACPI_DMT_EINJACT:17681769/* EINJ Action types */17701771Temp8 = *Target;1772if (Temp8 > ACPI_EINJ_ACTION_RESERVED)1773{1774Temp8 = ACPI_EINJ_ACTION_RESERVED;1775}17761777AcpiOsPrintf (UINT8_FORMAT, *Target,1778AcpiDmEinjActions[Temp8]);1779break;17801781case ACPI_DMT_EINJINST:17821783/* EINJ Instruction types */17841785Temp8 = *Target;1786if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)1787{1788Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;1789}17901791AcpiOsPrintf (UINT8_FORMAT, *Target,1792AcpiDmEinjInstructions[Temp8]);1793break;17941795case ACPI_DMT_ERSTACT:17961797/* ERST Action types */17981799Temp8 = *Target;1800if (Temp8 > ACPI_ERST_ACTION_RESERVED)1801{1802Temp8 = ACPI_ERST_ACTION_RESERVED;1803}18041805AcpiOsPrintf (UINT8_FORMAT, *Target,1806AcpiDmErstActions[Temp8]);1807break;18081809case ACPI_DMT_ERDT:18101811/* ERDT subtable types */18121813Temp16 = *Target;1814if (Temp16 > ACPI_ERDT_TYPE_RESERVED)1815{1816Temp16 = ACPI_ERDT_TYPE_RESERVED;1817}18181819AcpiOsPrintf (UINT8_FORMAT, *Target,1820AcpiDmErdtSubnames[Temp16]);1821break;18221823case ACPI_DMT_ERSTINST:18241825/* ERST Instruction types */18261827Temp8 = *Target;1828if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)1829{1830Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;1831}18321833AcpiOsPrintf (UINT8_FORMAT, *Target,1834AcpiDmErstInstructions[Temp8]);1835break;18361837case ACPI_DMT_GTDT:18381839/* GTDT subtable types */18401841Temp8 = *Target;1842if (Temp8 > ACPI_GTDT_TYPE_RESERVED)1843{1844Temp8 = ACPI_GTDT_TYPE_RESERVED;1845}18461847AcpiOsPrintf (UINT8_FORMAT, *Target,1848AcpiDmGtdtSubnames[Temp8]);1849break;18501851case ACPI_DMT_HEST:18521853/* HEST subtable types */18541855Temp16 = ACPI_GET16 (Target);1856if (Temp16 > ACPI_HEST_TYPE_RESERVED)1857{1858Temp16 = ACPI_HEST_TYPE_RESERVED;1859}18601861AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1862AcpiDmHestSubnames[Temp16]);1863break;18641865case ACPI_DMT_HESTNTFY:18661867AcpiOsPrintf (STRING_FORMAT,1868"Hardware Error Notification Structure");18691870Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,1871sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);1872if (ACPI_FAILURE (Status))1873{1874return (Status);1875}18761877AcpiOsPrintf ("\n");1878LastOutputBlankLine = TRUE;1879break;18801881case ACPI_DMT_HESTNTYP:18821883/* HEST Notify types */18841885Temp8 = *Target;1886if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)1887{1888Temp8 = ACPI_HEST_NOTIFY_RESERVED;1889}18901891AcpiOsPrintf (UINT8_FORMAT, *Target,1892AcpiDmHestNotifySubnames[Temp8]);1893break;18941895case ACPI_DMT_HMAT:18961897/* HMAT subtable types */18981899Temp16 = *Target;1900if (Temp16 > ACPI_HMAT_TYPE_RESERVED)1901{1902Temp16 = ACPI_HMAT_TYPE_RESERVED;1903}19041905AcpiOsPrintf (UINT16_FORMAT, *Target,1906AcpiDmHmatSubnames[Temp16]);1907break;19081909case ACPI_DMT_IORTMEM:19101911AcpiOsPrintf (STRING_FORMAT,1912"IORT Memory Access Properties");19131914Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,1915sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);1916if (ACPI_FAILURE (Status))1917{1918return (Status);1919}19201921LastOutputBlankLine = TRUE;1922break;19231924case ACPI_DMT_MADT:19251926/* MADT subtable types */19271928Temp8 = *Target;1929if ((Temp8 >= ACPI_MADT_TYPE_RESERVED) && (Temp8 < ACPI_MADT_TYPE_OEM_RESERVED))1930{1931Temp8 = ACPI_MADT_TYPE_RESERVED;1932}1933else if (Temp8 >= ACPI_MADT_TYPE_OEM_RESERVED)1934{1935Temp8 = ACPI_MADT_TYPE_RESERVED + 1;1936}1937AcpiOsPrintf (UINT8_FORMAT, *Target,1938AcpiDmMadtSubnames[Temp8]);1939break;19401941case ACPI_DMT_MPAM_LOCATOR:19421943/* MPAM subtable locator types */19441945Temp8 = *Target;1946if (Temp8 > ACPI_MPAM_LOCATION_TYPE_INTERCONNECT)1947{1948Temp8 = ACPI_MPAM_LOCATION_TYPE_INTERCONNECT + 1;1949}19501951AcpiOsPrintf (UINT8_FORMAT, *Target,1952AcpiDmMpamSubnames[Temp8]);1953break;19541955case ACPI_DMT_NFIT:19561957/* NFIT subtable types */19581959Temp16 = ACPI_GET16 (Target);1960if (Temp16 > ACPI_NFIT_TYPE_RESERVED)1961{1962Temp16 = ACPI_NFIT_TYPE_RESERVED;1963}19641965AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1966AcpiDmNfitSubnames[Temp16]);1967break;19681969case ACPI_DMT_PCCT:19701971/* PCCT subtable types */19721973Temp8 = *Target;1974if (Temp8 > ACPI_PCCT_TYPE_RESERVED)1975{1976Temp8 = ACPI_PCCT_TYPE_RESERVED;1977}19781979AcpiOsPrintf (UINT8_FORMAT, *Target,1980AcpiDmPcctSubnames[Temp8]);1981break;19821983case ACPI_DMT_PHAT:19841985/* PHAT subtable types */19861987Temp16 = ACPI_GET16 (Target);1988if (Temp16 > ACPI_PHAT_TYPE_RESERVED)1989{1990Temp16 = ACPI_PHAT_TYPE_RESERVED;1991}19921993AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1994AcpiDmPhatSubnames[Temp16]);1995break;19961997case ACPI_DMT_PMTT:19981999/* PMTT subtable types */20002001Temp8 = *Target;2002if (Temp8 == ACPI_PMTT_TYPE_VENDOR)2003{2004Temp8 = ACPI_PMTT_TYPE_RESERVED + 1;2005}2006else if (Temp8 > ACPI_PMTT_TYPE_RESERVED)2007{2008Temp8 = ACPI_PMTT_TYPE_RESERVED;2009}2010AcpiOsPrintf (UINT8_FORMAT, *Target,2011AcpiDmPmttSubnames[Temp8]);2012break;20132014case ACPI_DMT_PPTT:20152016/* PPTT subtable types */20172018Temp8 = *Target;2019if (Temp8 > ACPI_PPTT_TYPE_RESERVED)2020{2021Temp8 = ACPI_PPTT_TYPE_RESERVED;2022}20232024AcpiOsPrintf (UINT8_FORMAT, *Target,2025AcpiDmPpttSubnames[Temp8]);2026break;20272028case ACPI_DMT_UNICODE:2029case ACPI_DMT_WPBT_UNICODE:20302031if (ByteLength == 0)2032{2033AcpiOsPrintf ("/* Zero-length Data */\n");2034break;2035}20362037AcpiDmDumpUnicode (Table, 0, ByteLength);2038break;20392040case ACPI_DMT_RAW_BUFFER:2041case ACPI_DMT_BUFFER:2042case ACPI_DMT_PMTT_VENDOR:20432044if (ByteLength == 0)2045{2046AcpiOsPrintf ("/* Zero-length Data */\n");2047break;2048}20492050AcpiDmDumpBuffer (Target, 0, ByteLength, CurrentOffset, NULL);2051break;20522053case ACPI_DMT_RGRT:20542055/* RGRT subtable types */20562057Temp8 = *Target;2058if (Temp8 >= ACPI_RGRT_TYPE_RESERVED)2059{2060Temp8 = ACPI_RGRT_TYPE_RESERVED0;2061}20622063AcpiOsPrintf (UINT8_FORMAT, *Target,2064AcpiDmRgrtSubnames[Temp8]);2065break;20662067case ACPI_DMT_RHCT:20682069/* RHCT subtable types */20702071Temp16 = ACPI_GET16 (Target);2072if (Temp16 == ACPI_RHCT_NODE_TYPE_HART_INFO)2073{2074Temp16 = ACPI_RHCT_NODE_TYPE_RESERVED;2075}20762077AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),2078AcpiDmRhctSubnames[Temp16]);2079break;20802081case ACPI_DMT_SDEV:20822083/* SDEV subtable types */20842085Temp8 = *Target;2086if (Temp8 > ACPI_SDEV_TYPE_RESERVED)2087{2088Temp8 = ACPI_SDEV_TYPE_RESERVED;2089}20902091AcpiOsPrintf (UINT8_FORMAT, *Target,2092AcpiDmSdevSubnames[Temp8]);2093break;20942095case ACPI_DMT_SRAT:20962097/* SRAT subtable types */20982099Temp8 = *Target;2100if (Temp8 > ACPI_SRAT_TYPE_RESERVED)2101{2102Temp8 = ACPI_SRAT_TYPE_RESERVED;2103}21042105AcpiOsPrintf (UINT8_FORMAT, *Target,2106AcpiDmSratSubnames[Temp8]);2107break;21082109case ACPI_DMT_TPM2:21102111/* TPM2 Start Method types */21122113Temp8 = *Target;2114if (Temp8 > ACPI_TPM2_RESERVED)2115{2116Temp8 = ACPI_TPM2_RESERVED;2117}21182119AcpiOsPrintf (UINT8_FORMAT, *Target,2120AcpiDmTpm2Subnames[Temp8]);2121break;212221232124case ACPI_DMT_FADTPM:21252126/* FADT Preferred PM Profile names */21272128Temp8 = *Target;2129if (Temp8 > ACPI_FADT_PM_RESERVED)2130{2131Temp8 = ACPI_FADT_PM_RESERVED;2132}21332134AcpiOsPrintf (UINT8_FORMAT, *Target,2135AcpiDmFadtProfiles[Temp8]);2136break;21372138case ACPI_DMT_IVRS:21392140/* IVRS subtable types */21412142Temp8 = *Target;2143switch (Temp8)2144{2145case ACPI_IVRS_TYPE_HARDWARE1:2146case ACPI_IVRS_TYPE_HARDWARE2:21472148Name = AcpiDmIvrsSubnames[0];2149break;21502151case ACPI_IVRS_TYPE_HARDWARE3:21522153Name = AcpiDmIvrsSubnames[1];2154break;21552156case ACPI_IVRS_TYPE_MEMORY1:2157case ACPI_IVRS_TYPE_MEMORY2:2158case ACPI_IVRS_TYPE_MEMORY3:21592160Name = AcpiDmIvrsSubnames[2];2161break;21622163default:21642165Name = AcpiDmIvrsSubnames[3];2166break;2167}21682169AcpiOsPrintf (UINT8_FORMAT, *Target, Name);2170break;21712172case ACPI_DMT_IVRS_DE:21732174/* IVRS device entry types */21752176Temp8 = *Target;2177switch (Temp8)2178{2179case ACPI_IVRS_TYPE_ALL:2180case ACPI_IVRS_TYPE_SELECT:2181case ACPI_IVRS_TYPE_START:2182case ACPI_IVRS_TYPE_END:21832184Name = AcpiDmIvrsDevEntryNames[Temp8];2185break;21862187case ACPI_IVRS_TYPE_ALIAS_SELECT:2188case ACPI_IVRS_TYPE_ALIAS_START:2189case ACPI_IVRS_TYPE_EXT_SELECT:2190case ACPI_IVRS_TYPE_EXT_START:2191case ACPI_IVRS_TYPE_SPECIAL:21922193Name = AcpiDmIvrsDevEntryNames[Temp8 - 61];2194break;21952196case ACPI_IVRS_TYPE_HID:21972198Name = AcpiDmIvrsDevEntryNames[Temp8 - 228];2199break;22002201default:2202Name = AcpiDmIvrsDevEntryNames[0]; /* Unknown/Reserved */2203break;2204}22052206AcpiOsPrintf (UINT8_FORMAT, *Target, Name);2207break;22082209case ACPI_DMT_LPIT:22102211/* LPIT subtable types */22122213Temp32 = ACPI_GET32 (Target);2214if (Temp32 > ACPI_LPIT_TYPE_RESERVED)2215{2216Temp32 = ACPI_LPIT_TYPE_RESERVED;2217}22182219AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),2220AcpiDmLpitSubnames[Temp32]);2221break;22222223case ACPI_DMT_VIOT:22242225/* VIOT subtable types */22262227Temp8 = *Target;2228if (Temp8 > ACPI_VIOT_RESERVED)2229{2230Temp8 = ACPI_VIOT_RESERVED;2231}22322233AcpiOsPrintf (UINT8_FORMAT, *Target,2234AcpiDmViotSubnames[Temp8]);2235break;22362237case ACPI_DMT_EXIT:22382239return (AE_OK);22402241default:22422243ACPI_ERROR ((AE_INFO,2244"**** Invalid table opcode [0x%X] ****\n", Info->Opcode));2245return (AE_SUPPORT);2246}2247}22482249if (TableOffset && !SubtableLength)2250{2251/*2252* If this table is not the main table, the subtable must have a2253* valid length2254*/2255AcpiOsPrintf ("Invalid zero length subtable\n");2256return (AE_BAD_DATA);2257}22582259return (AE_OK);2260}226122622263