Path: blob/main/sys/contrib/dev/acpica/common/dmtable.c
105548 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"Unassigned",302"Unassigned",303"Unassigned",304"Unassigned",305"Unassigned",306"Unassigned",307"EinjV2 Set Error Type(deprecated)",308"EinjV2 Get Error Type",309"Unknown Action"310};311312static const char *AcpiDmEinjInstructions[] =313{314"Read Register",315"Read Register Value",316"Write Register",317"Write Register Value",318"Noop",319"Flush Cacheline",320"Unknown Instruction"321};322323static const char *AcpiDmErdtSubnames[] =324{325"RMDD",326"CACD",327"DACD",328"CMRC",329"MMRC",330"MARC",331"CARC",332"CMRD",333"IBRD",334"IBAD",335"CARD",336"RESERVED"337};338339static const char *AcpiDmErstActions[] =340{341"Begin Write Operation",342"Begin Read Operation",343"Begin Clear Operation",344"End Operation",345"Set Record Offset",346"Execute Operation",347"Check Busy Status",348"Get Command Status",349"Get Record Identifier",350"Set Record Identifier",351"Get Record Count",352"Begin Dummy Write",353"Unused/Unknown Action",354"Get Error Address Range",355"Get Error Address Length",356"Get Error Attributes",357"Execute Timings",358"Unknown Action"359};360361static const char *AcpiDmErstInstructions[] =362{363"Read Register",364"Read Register Value",365"Write Register",366"Write Register Value",367"Noop",368"Load Var1",369"Load Var2",370"Store Var1",371"Add",372"Subtract",373"Add Value",374"Subtract Value",375"Stall",376"Stall While True",377"Skip Next If True",378"GoTo",379"Set Source Address",380"Set Destination Address",381"Move Data",382"Unknown Instruction"383};384385static const char *AcpiDmGtdtSubnames[] =386{387"Generic Timer Block",388"Generic Watchdog Timer",389"Unknown Subtable Type" /* Reserved */390};391392static const char *AcpiDmHestSubnames[] =393{394"IA-32 Machine Check Exception",395"IA-32 Corrected Machine Check",396"IA-32 Non-Maskable Interrupt",397"Unknown Subtable Type", /* 3 - Reserved */398"Unknown Subtable Type", /* 4 - Reserved */399"Unknown Subtable Type", /* 5 - Reserved */400"PCI Express Root Port AER",401"PCI Express AER (AER Endpoint)",402"PCI Express/PCI-X Bridge AER",403"Generic Hardware Error Source",404"Generic Hardware Error Source V2",405"IA-32 Deferred Machine Check",406"Unknown Subtable Type" /* Reserved */407};408409static const char *AcpiDmHestNotifySubnames[] =410{411"Polled",412"External Interrupt",413"Local Interrupt",414"SCI",415"NMI",416"CMCI", /* ACPI 5.0 */417"MCE", /* ACPI 5.0 */418"GPIO", /* ACPI 6.0 */419"SEA", /* ACPI 6.1 */420"SEI", /* ACPI 6.1 */421"GSIV", /* ACPI 6.1 */422"Software Delegated Exception", /* ACPI 6.2 */423"Unknown Notify Type" /* Reserved */424};425426static const char *AcpiDmHmatSubnames[] =427{428"Memory Proximity Domain Attributes",429"System Locality Latency and Bandwidth Information",430"Memory Side Cache Information",431"Unknown Structure Type" /* Reserved */432};433434static const char *AcpiDmMadtSubnames[] =435{436"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */437"I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */438"Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */439"NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */440"Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */441"Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */442"I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */443"Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */444"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */445"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */446"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */447"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */448"Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */449"Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */450"Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */451"Generic Interrupt Translator", /* ACPI_MADT_GENERIC_TRANSLATOR */452"Mutiprocessor Wakeup", /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */453"CPU Core Interrupt Controller", /* ACPI_MADT_TYPE_CORE_PIC */454"Legacy I/O Interrupt Controller", /* ACPI_MADT_TYPE_LIO_PIC */455"HT Interrupt Controller", /* ACPI_MADT_TYPE_HT_PIC */456"Extend I/O Interrupt Controller", /* ACPI_MADT_TYPE_EIO_PIC */457"MSI Interrupt Controller", /* ACPI_MADT_TYPE_MSI_PIC */458"Bridge I/O Interrupt Controller", /* ACPI_MADT_TYPE_BIO_PIC */459"LPC Interrupt Controller", /* ACPI_MADT_TYPE_LPC_PIC */460"RISC-V Interrupt Controller", /* ACPI_MADT_TYPE_RINTC */461"RISC-V Incoming MSI Controller", /* ACPI_MADT_TYPE_IMSIC */462"RISC-V APLIC Controller", /* ACPI_MADT_TYPE_APLIC */463"RISC-V PLIC Controller", /* ACPI_MADT_TYPE_PLIC */464"Generic Interrupt v5 Router", /* ACPI_MADT_TYPE_GICV5_IRS */465"Generic Interrupt v5 Translator Config", /* ACPI_MADT_TYPE_GICV5_ITS */466"Generic Interrupt v5 Translator Entry", /* ACPI_MADT_TYPE_GICV5_ITS_TRANSLATE */467"Unknown Subtable Type", /* Reserved */468"Types 80-FF are used for OEM data" /* Reserved for OEM data */469};470471static const char *AcpiDmMpamSubnames[] =472{473"Processor cache", /* ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE */474"Memory", /* ACPI_MPAM_LOCATION_TYPE_MEMORY */475"SMMU", /* ACPI_MPAM_LOCATION_TYPE_SMMU */476"Memory-side cache", /* ACPI_MPAM_LOCATION_TYPE_MEMORY_CACHE */477"ACPI device", /* ACPI_MPAM_LOCATION_TYPE_ACPI_DEVICE */478"Interconnect", /* ACPI_MPAM_LOCATION_TYPE_INTERCONNECT */479"Unknown" /* ACPI_MPAM_LOCATION_TYPE_UNKNOWN */480};481482static const char *AcpiDmNfitSubnames[] =483{484"System Physical Address Range", /* ACPI_NFIT_TYPE_SYSTEM_ADDRESS */485"Memory Range Map", /* ACPI_NFIT_TYPE_MEMORY_MAP */486"Interleave Info", /* ACPI_NFIT_TYPE_INTERLEAVE */487"SMBIOS Information", /* ACPI_NFIT_TYPE_SMBIOS */488"NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */489"NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */490"Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */491"Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */492"Unknown Subtable Type" /* Reserved */493};494495static const char *AcpiDmPcctSubnames[] =496{497"Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */498"HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */499"HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */500"Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */501"Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */502"HW Registers based Comm Subspace", /* ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE */503"Unknown Subtable Type" /* Reserved */504};505506static const char *AcpiDmPhatSubnames[] =507{508"Firmware Version Data", /* ACPI_PHAT_TYPE_FW_VERSION_DATA */509"Firmware Health Data", /* ACPI_PHAT_TYPE_FW_HEALTH_DATA */510"Unknown Subtable Type" /* Reserved */511};512513static const char *AcpiDmPmttSubnames[] =514{515"Socket", /* ACPI_PMTT_TYPE_SOCKET */516"Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */517"Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */518"Unknown Subtable Type", /* Reserved */519"Vendor Specific" /* ACPI_PMTT_TYPE_VENDOR */520};521522static const char *AcpiDmPpttSubnames[] =523{524"Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */525"Cache Type", /* ACPI_PPTT_TYPE_CACHE */526"ID", /* ACPI_PPTT_TYPE_ID */527"Unknown Subtable Type" /* Reserved */528};529530static const char *AcpiDmRgrtSubnames[] =531{532"Unknown/Reserved Image Type", /* ACPI_RGRT_TYPE_RESERVED0 */533"Type PNG" /* ACPI_RGRT_IMAGE_TYPE_PNG */534};535536static const char *AcpiDmSdevSubnames[] =537{538"Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */539"PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */540"Unknown Subtable Type" /* Reserved */541};542543static const char *AcpiDmSratSubnames[] =544{545"Processor Local APIC/SAPIC Affinity",546"Memory Affinity",547"Processor Local x2APIC Affinity",548"GICC Affinity",549"GIC ITS Affinity", /* Acpi 6.2 */550"Generic Initiator Affinity", /* Acpi 6.3 */551"Generic Port Affinity", /* Acpi 6.4 */552"RINTC Affinity", /* Acpi 6.6 */553"Unknown Subtable Type" /* Reserved */554};555556static const char *AcpiDmTpm2Subnames[] =557{558"Illegal Start Method value",559"Reserved",560"ACPI Start Method",561"Reserved",562"Reserved",563"Reserved",564"Memory Mapped I/O",565"Command Response Buffer",566"Command Response Buffer with ACPI Start Method",567"Reserved",568"Reserved",569"Command Response Buffer with ARM SMC",570"Unknown Subtable Type" /* Reserved */571};572573static const char *AcpiDmIovtSubnames[] =574{575"IOMMUv1",576"Unknown Subtable Type" /* Reserved */577};578579static const char *AcpiDmIovtdevSubnames[] =580{581"A single PCI device",582"Start of range",583"End of range",584"Unknown Subtable Type" /* Reserved */585};586587static const char *AcpiDmIvrsSubnames[] =588{589"Hardware Definition Block (IVHD)",590"Hardware Definition Block - Mixed Format (IVHD)",591"Memory Definition Block (IVMD)",592"Unknown/Reserved Subtable Type" /* Reserved */593};594595static const char *AcpiDmIvrsDevEntryNames[] =596{597"Unknown/Reserved Device Entry Type", /* 0- Reserved */598"Device Entry: Select All Devices", /* 1 */599"Device Entry: Select One Device", /* 2 */600"Device Entry: Start of Range", /* 3 */601"Device Entry: End of Range", /* 4 */602"Device Entry: Alias Select", /* 66 */603"Device Entry: Alias Start of Range", /* 67 */604"Unknown/Reserved Device Entry Type", /* 68- Reserved */605"Unknown/Reserved Device Entry Type", /* 69- Reserved */606"Device Entry: Extended Select", /* 70 */607"Device Entry: Extended Start of Range", /* 71 */608"Device Entry: Special Device", /* 72 */609"Device Entry: ACPI HID Named Device", /* 240 */610"Unknown/Reserved Device Entry Type" /* Reserved */611};612613static const char *AcpiDmLpitSubnames[] =614{615"Native C-state Idle Structure",616"Unknown Subtable Type" /* Reserved */617};618619static const char *AcpiDmViotSubnames[] =620{621"Unknown Subtable Type", /* 0 -Reserved */622"PCI Range",623"MMIO Endpoint",624"VirtIO-PCI IOMMU",625"VirtIO-MMIO IOMMU",626"Unknown Subtable Type" /* Reserved */627};628629#define ACPI_FADT_PM_RESERVED 9630631static const char *AcpiDmFadtProfiles[] =632{633"Unspecified",634"Desktop",635"Mobile",636"Workstation",637"Enterprise Server",638"SOHO Server",639"Appliance PC",640"Performance Server",641"Tablet",642"Unknown Profile Type"643};644645#define ACPI_GAS_WIDTH_RESERVED 5646647static const char *AcpiDmGasAccessWidth[] =648{649"Undefined/Legacy",650"Byte Access:8",651"Word Access:16",652"DWord Access:32",653"QWord Access:64",654"Unknown Width Encoding"655};656657static const char *AcpiDmRhctSubnames[] =658{659"RISC-V ISA string structure", /* ACPI_RHCT_ISA_STRING */660"RISC-V CMO node structure", /* ACPI_RHCT_CMO_NODE */661"RISC-V MMU node structure", /* ACPI_RHCT_MMU_NODE */662"RISC-V Hart Info structure", /* ACPI_RHCT_HART_INFO */663};664665666/*******************************************************************************667*668* ACPI Table Data, indexed by signature.669*670* Each entry contains: Signature, Table Info, Handler, DtHandler,671* Template, Description672*673* Simple tables have only a TableInfo structure, complex tables have a674* handler. This table must be NULL terminated. RSDP and FACS are675* special-cased elsewhere.676*677* Note: Any tables added here should be duplicated within678* AcpiGbl_SupportedTables in the file common/ahtable.c679*680******************************************************************************/681682const ACPI_DMTABLE_DATA AcpiDmTableData[] =683{684{ACPI_SIG_AEST, NULL, AcpiDmDumpAest, DtCompileAest, TemplateAest},685{ACPI_SIG_AGDI, AcpiDmTableInfoAgdi, NULL, NULL, TemplateAgdi},686{ACPI_SIG_APMT, NULL, AcpiDmDumpApmt, DtCompileApmt, TemplateApmt},687{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf},688{ACPI_SIG_ASPT, NULL, AcpiDmDumpAspt, DtCompileAspt, TemplateAspt},689{ACPI_SIG_BDAT, AcpiDmTableInfoBdat, NULL, NULL, TemplateBdat},690{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},691{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},692{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},693{ACPI_SIG_CCEL, AcpiDmTableInfoCcel, NULL, NULL, TemplateCcel},694{ACPI_SIG_CDAT, NULL, AcpiDmDumpCdat, NULL, TemplateCdat},695{ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt},696{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},697{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},698{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2},699{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp},700{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar},701{ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm},702{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt},703{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj},704{ACPI_SIG_ERDT, NULL, AcpiDmDumpErdt, DtCompileErdt, TemplateErdt},705{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst},706{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt},707{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt},708{ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt},709{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest},710{ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat},711{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet},712{ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort},713{ACPI_SIG_IOVT, AcpiDmTableInfoIovt, AcpiDmDumpIovt, DtCompileIovt, TemplateIovt},714{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs},715{ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit},716{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt},717{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg},718{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi},719{ACPI_SIG_MPAM, NULL, AcpiDmDumpMpam, DtCompileMpam, TemplateMpam},720{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst},721{ACPI_SIG_MRRM, NULL, AcpiDmDumpMrrm, DtCompileMrrm, TemplateMrrm},722{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct},723{ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm},724{ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit},725{ACPI_SIG_NHLT, NULL, NULL, NULL, NULL},726{ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct},727{ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt},728{ACPI_SIG_PHAT, NULL, AcpiDmDumpPhat, DtCompilePhat, TemplatePhat},729{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt},730{ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt},731{ACPI_SIG_PRMT, NULL, AcpiDmDumpPrmt, DtCompilePrmt, TemplatePrmt},732{ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf},733{ACPI_SIG_RAS2, AcpiDmTableInfoRas2, AcpiDmDumpRas2, DtCompileRas2, TemplateRas2},734{ACPI_SIG_RGRT, NULL, AcpiDmDumpRgrt, DtCompileRgrt, TemplateRgrt},735{ACPI_SIG_RHCT, NULL, AcpiDmDumpRhct, DtCompileRhct, TemplateRhct},736{ACPI_SIG_RIMT, NULL, AcpiDmDumpRimt, DtCompileRimt, TemplateRimt},737{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},738{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},739{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},740{ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei},741{ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev},742{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic},743{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit},744{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr},745{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi},746{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat},747{ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao},748{ACPI_SIG_SVKL, AcpiDmTableInfoSvkl, AcpiDmDumpSvkl, DtCompileSvkl, TemplateSvkl},749{ACPI_SIG_SWFT, AcpiDmTableInfoSwft, AcpiDmDumpSwft, DtCompileSwft, TemplateSwft},750{ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa},751{ACPI_SIG_TDEL, AcpiDmTableInfoTdel, NULL, NULL, TemplateTdel},752{ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2},753{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi},754{ACPI_SIG_VIOT, AcpiDmTableInfoViot, AcpiDmDumpViot, DtCompileViot, TemplateViot},755{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet},756{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat},757{ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt},758{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt},759{ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt},760{ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt},761{ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv},762{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt},763{NULL, NULL, NULL, NULL, NULL}764};765766767/*******************************************************************************768*769* FUNCTION: AcpiDmGetTableData770*771* PARAMETERS: Signature - ACPI signature (4 chars) to match772*773* RETURN: Pointer to a valid ACPI_DMTABLE_DATA. Null if no match found.774*775* DESCRIPTION: Find a match in the global table of supported ACPI tables776*777******************************************************************************/778779const ACPI_DMTABLE_DATA *780AcpiDmGetTableData (781char *Signature)782{783const ACPI_DMTABLE_DATA *Info;784785786for (Info = AcpiDmTableData; Info->Signature; Info++)787{788if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature))789{790return (Info);791}792}793794return (NULL);795}796797798/*******************************************************************************799*800* FUNCTION: AcpiDmDumpDataTable801*802* PARAMETERS: Table - An ACPI table803*804* RETURN: None.805*806* DESCRIPTION: Format the contents of an ACPI data table (any table other807* than an SSDT or DSDT that does not contain executable AML code)808*809******************************************************************************/810811void812AcpiDmDumpDataTable (813ACPI_TABLE_HEADER *Table)814{815ACPI_STATUS Status;816const ACPI_DMTABLE_DATA *TableData;817UINT32 Length;818819820/* Ignore tables that contain AML */821822if (AcpiUtIsAmlTable (Table))823{824if (AslGbl_VerboseTemplates)825{826/* Dump the raw table data */827828Length = Table->Length;829830AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",831ACPI_RAW_TABLE_DATA_HEADER, Length, Length);832AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),833Length, DB_BYTE_DISPLAY, 0);834AcpiOsPrintf (" */\n");835}836return;837}838839/*840* Handle tables that don't use the common ACPI table header structure.841* Currently, these are the FACS, RSDP, S3PT and CDAT.842*/843if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))844{845Length = Table->Length;846Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);847if (ACPI_FAILURE (Status))848{849return;850}851}852else if (ACPI_VALIDATE_RSDP_SIG (ACPI_CAST_PTR (ACPI_TABLE_RSDP,853Table)->Signature))854{855Length = AcpiDmDumpRsdp (Table);856}857else if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT))858{859Length = AcpiDmDumpS3pt (Table);860}861else if (!AcpiUtValidNameseg (Table->Signature))862{863/*864* For CDAT we are assuming that there should be at least one non-ASCII865* byte in the (normally) 4-character Signature field (at least the866* high-order byte should be zero).867*/868if (AcpiGbl_CDAT)869{870/*871* Invalid signature and <-ds CDAT> was specified on the command line.872* Therefore, we have a CDAT table.873*/874AcpiDmDumpCdat (Table);875}876else877{878fprintf (stderr, "Table has an invalid signature\n");879}880881return;882}883else884{885/*886* All other tables must use the common ACPI table header, dump it now887*/888Length = Table->Length;889Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);890if (ACPI_FAILURE (Status))891{892return;893}894AcpiOsPrintf ("\n");895896/* Match signature and dispatch appropriately */897898TableData = AcpiDmGetTableData (Table->Signature);899if (!TableData)900{901if (!strncmp (Table->Signature, "OEM", 3))902{903AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",904Table->Signature);905}906else907{908AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",909Table->Signature);910911fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",912Table->Signature);913914if (!AcpiGbl_ForceAmlDisassembly)915{916fprintf (stderr, "decoding ACPI table header only\n");917}918else919{920fprintf (stderr, "assuming table contains valid AML code\n");921}922}923}924else if (TableData->TableHandler)925{926/* Complex table, has a handler */927928TableData->TableHandler (Table);929}930else if (TableData->TableInfo)931{932/* Simple table, just walk the info table */933934Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);935if (ACPI_FAILURE (Status))936{937return;938}939}940}941942if (!AslGbl_DoTemplates || AslGbl_VerboseTemplates)943{944/* Dump the raw table data */945946AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",947ACPI_RAW_TABLE_DATA_HEADER, Length, Length);948AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),949Length, DB_BYTE_DISPLAY, 0);950}951}952953954/*******************************************************************************955*956* FUNCTION: AcpiDmLineHeader957*958* PARAMETERS: Offset - Current byte offset, from table start959* ByteLength - Length of the field in bytes, 0 for flags960* Name - Name of this field961*962* RETURN: None963*964* DESCRIPTION: Utility routines for formatting output lines. Displays the965* current table offset in hex and decimal, the field length,966* and the field name.967*968******************************************************************************/969970void971AcpiDmLineHeader (972UINT32 Offset,973UINT32 ByteLength,974char *Name)975{976977/* Allow a null name for fields that span multiple lines (large buffers) */978979if (!Name)980{981Name = "";982}983984if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */985{986if (ByteLength)987{988AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);989}990else991{992if (*Name)993{994AcpiOsPrintf ("%41s : ", Name);995}996else997{998AcpiOsPrintf ("%41s ", Name);999}1000}1001}1002else /* Normal disassembler or verbose template */1003{1004if (ByteLength)1005{1006AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %27s : ",1007Offset, Offset, ByteLength, Name);1008}1009else1010{1011if (*Name)1012{1013AcpiOsPrintf ("%44s : ", Name);1014}1015else1016{1017AcpiOsPrintf ("%44s ", Name);1018}1019}1020}1021}10221023void1024AcpiDmLineHeader2 (1025UINT32 Offset,1026UINT32 ByteLength,1027char *Name,1028UINT32 Value)1029{10301031if (AslGbl_DoTemplates && !AslGbl_VerboseTemplates) /* Terse template */1032{1033if (ByteLength)1034{1035AcpiOsPrintf ("[%.4d] %30s %3d : ",1036ByteLength, Name, Value);1037}1038else1039{1040AcpiOsPrintf ("%36s % 3d : ",1041Name, Value);1042}1043}1044else /* Normal disassembler or verbose template */1045{1046if (ByteLength)1047{1048AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %24s %3d : ",1049Offset, Offset, ByteLength, Name, Value);1050}1051else1052{1053AcpiOsPrintf ("[%3.3Xh %4.4u ] %24s %3d : ",1054Offset, Offset, Name, Value);1055}1056}1057}105810591060/*******************************************************************************1061*1062* FUNCTION: AcpiDmDumpTable1063*1064* PARAMETERS: TableLength - Length of the entire ACPI table1065* TableOffset - Starting offset within the table for this1066* sub-descriptor (0 if main table)1067* Table - The ACPI table1068* SubtableLength - Length of this sub-descriptor1069* Info - Info table for this ACPI table1070*1071* RETURN: Status1072*1073* DESCRIPTION: Display ACPI table contents by walking the Info table.1074*1075* Note: This function must remain in sync with DtGetFieldLength.1076*1077******************************************************************************/10781079ACPI_STATUS1080AcpiDmDumpTable (1081UINT32 TableLength,1082UINT32 TableOffset,1083void *Table,1084UINT32 SubtableLength,1085ACPI_DMTABLE_INFO *Info)1086{1087UINT8 *Target;1088UINT32 CurrentOffset;1089UINT32 ByteLength;1090UINT8 Temp8;1091UINT16 Temp16;1092UINT32 Temp32;1093UINT64 Value;1094const AH_TABLE *TableData;1095const char *Name;1096BOOLEAN LastOutputBlankLine = FALSE;1097ACPI_STATUS Status;1098char RepairedName[8];109911001101if (!Info)1102{1103AcpiOsPrintf ("Display not implemented\n");1104return (AE_NOT_IMPLEMENTED);1105}11061107/* Walk entire Info table; Null name terminates */11081109for (; Info->Name; Info++)1110{1111/*1112* Target points to the field within the ACPI Table. CurrentOffset is1113* the offset of the field from the start of the main table.1114*/1115Target = ACPI_ADD_PTR (UINT8, Table, Info->Offset);1116CurrentOffset = TableOffset + Info->Offset;11171118/* Check for beyond subtable end or (worse) beyond EOT */11191120if (SubtableLength && (Info->Offset > SubtableLength))1121{1122AcpiOsPrintf (1123"/**** ACPI subtable terminates early (Len %u) - "1124"may be older version (dump table) */\n", SubtableLength);11251126/* Move on to next subtable */11271128return (AE_OK);1129}11301131if (CurrentOffset >= TableLength)1132{1133AcpiOsPrintf (1134"/**** ACPI table terminates "1135"in the middle of a data structure! (dump table)\n"1136"CurrentOffset: %X, TableLength: %X ***/", CurrentOffset, TableLength);1137return (AE_BAD_DATA);1138}11391140/* Generate the byte length for this field */11411142switch (Info->Opcode)1143{1144case ACPI_DMT_UINT8:1145case ACPI_DMT_CHKSUM:1146case ACPI_DMT_SPACEID:1147case ACPI_DMT_ACCWIDTH:1148case ACPI_DMT_CEDT:1149case ACPI_DMT_IVRS:1150case ACPI_DMT_IVRS_DE:1151case ACPI_DMT_GTDT:1152case ACPI_DMT_MADT:1153case ACPI_DMT_MPAM_LOCATOR:1154case ACPI_DMT_PCCT:1155case ACPI_DMT_PMTT:1156case ACPI_DMT_PPTT:1157case ACPI_DMT_RGRT:1158case ACPI_DMT_SDEV:1159case ACPI_DMT_SRAT:1160case ACPI_DMT_AEST:1161case ACPI_DMT_AEST_RES:1162case ACPI_DMT_AEST_XFACE:1163case ACPI_DMT_AEST_XRUPT:1164case ACPI_DMT_ASF:1165case ACPI_DMT_CDAT:1166case ACPI_DMT_HESTNTYP:1167case ACPI_DMT_FADTPM:1168case ACPI_DMT_EINJACT:1169case ACPI_DMT_EINJINST:1170case ACPI_DMT_ERSTACT:1171case ACPI_DMT_ERSTINST:1172case ACPI_DMT_DMAR_SCOPE:1173case ACPI_DMT_IOVTDEV:1174case ACPI_DMT_VIOT:11751176ByteLength = 1;1177break;11781179case ACPI_DMT_ASPT:1180case ACPI_DMT_UINT16:1181case ACPI_DMT_DMAR:1182case ACPI_DMT_ERDT:1183case ACPI_DMT_HEST:1184case ACPI_DMT_HMAT:1185case ACPI_DMT_IOVT:1186case ACPI_DMT_NFIT:1187case ACPI_DMT_PHAT:1188case ACPI_DMT_RHCT:11891190ByteLength = 2;1191break;11921193case ACPI_DMT_UINT24:11941195ByteLength = 3;1196break;11971198case ACPI_DMT_UINT32:1199case ACPI_DMT_AEST_CACHE:1200case ACPI_DMT_AEST_GIC:1201case ACPI_DMT_NAME4:1202case ACPI_DMT_SIG:1203case ACPI_DMT_LPIT:1204case ACPI_DMT_TPM2:12051206ByteLength = 4;1207break;12081209case ACPI_DMT_UINT40:12101211ByteLength = 5;1212break;12131214case ACPI_DMT_UINT48:1215case ACPI_DMT_NAME6:12161217ByteLength = 6;1218break;12191220case ACPI_DMT_UINT56:1221case ACPI_DMT_BUF7:12221223ByteLength = 7;1224break;12251226case ACPI_DMT_UINT64:1227case ACPI_DMT_NAME8:12281229ByteLength = 8;1230break;12311232case ACPI_DMT_BUF10:12331234ByteLength = 10;1235break;12361237case ACPI_DMT_BUF11:12381239ByteLength = 11;1240break;12411242case ACPI_DMT_BUF12:12431244ByteLength = 12;1245break;12461247case ACPI_DMT_BUF16:1248case ACPI_DMT_UUID:12491250ByteLength = 16;1251break;12521253case ACPI_DMT_BUF18:12541255ByteLength = 18;1256break;12571258case ACPI_DMT_BUF24:12591260ByteLength = 24;1261break;12621263case ACPI_DMT_BUF26:12641265ByteLength = 26;1266break;12671268case ACPI_DMT_BUF32:12691270ByteLength = 32;1271break;12721273case ACPI_DMT_BUF112:12741275ByteLength = 112;1276break;12771278case ACPI_DMT_BUF128:12791280ByteLength = 128;1281break;12821283case ACPI_DMT_WPBT_UNICODE:12841285ByteLength = SubtableLength;1286CurrentOffset = sizeof (ACPI_TABLE_WPBT);1287break;12881289case ACPI_DMT_UNICODE:1290case ACPI_DMT_BUFFER:1291case ACPI_DMT_RAW_BUFFER:12921293ByteLength = SubtableLength;1294break;12951296case ACPI_DMT_PMTT_VENDOR:1297/*1298* Calculate the length of the vendor data for the PMTT table:1299* Length = (Current Subtable ptr + Subtable length) -1300* Start of the vendor data (Target)1301*/1302ByteLength = ((ACPI_CAST_PTR (char, Table) +1303(ACPI_CAST_PTR (ACPI_PMTT_HEADER, Table)->Length)) -1304ACPI_CAST_PTR (char, Target));1305break;13061307case ACPI_DMT_STRING:13081309ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1;1310break;13111312case ACPI_DMT_IVRS_UNTERMINATED_STRING:13131314ByteLength = ((ACPI_CAST_PTR (ACPI_IVRS_DEVICE_HID, Target) -1)->UidLength);1315break;13161317case ACPI_DMT_GAS:13181319if (!LastOutputBlankLine)1320{1321AcpiOsPrintf ("\n");1322LastOutputBlankLine = TRUE;1323}13241325ByteLength = sizeof (ACPI_GENERIC_ADDRESS);1326break;13271328case ACPI_DMT_HESTNTFY:13291330if (!LastOutputBlankLine)1331{1332AcpiOsPrintf ("\n");1333LastOutputBlankLine = TRUE;1334}13351336ByteLength = sizeof (ACPI_HEST_NOTIFY);1337break;13381339case ACPI_DMT_IORTMEM:13401341if (!LastOutputBlankLine)1342{1343LastOutputBlankLine = FALSE;1344}13451346ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);1347break;13481349default:13501351ByteLength = 0;1352break;1353}13541355/* Check if we are beyond a subtable, or (worse) beyond EOT */13561357if (CurrentOffset + ByteLength > TableLength)1358{1359if (SubtableLength)1360{1361AcpiOsPrintf (1362"/**** ACPI subtable terminates early - "1363"may be older version (dump table) */\n");13641365/* Move on to next subtable */13661367return (AE_OK);1368}13691370AcpiOsPrintf (1371"/**** ACPI table terminates "1372"in the middle of a data structure! */\n");1373return (AE_BAD_DATA);1374}13751376if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)1377{1378AcpiOsPrintf ("%s", Info->Name);1379continue;1380}13811382/* Start a new line and decode the opcode */13831384AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);13851386switch (Info->Opcode)1387{1388/* Single-bit Flag fields. Note: Opcode is the bit position */13891390case ACPI_DMT_FLAG0:1391case ACPI_DMT_FLAG1:1392case ACPI_DMT_FLAG2:1393case ACPI_DMT_FLAG3:1394case ACPI_DMT_FLAG4:1395case ACPI_DMT_FLAG5:1396case ACPI_DMT_FLAG6:1397case ACPI_DMT_FLAG7:13981399AcpiOsPrintf ("%1.1X\n", (*Target >> Info->Opcode) & 0x01);1400break;14011402/* 2-bit Flag fields */14031404case ACPI_DMT_FLAGS0:14051406AcpiOsPrintf ("%1.1X\n", *Target & 0x03);1407break;14081409case ACPI_DMT_FLAGS1:14101411AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);1412break;14131414case ACPI_DMT_FLAGS2:14151416AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);1417break;14181419case ACPI_DMT_FLAGS8_2:14201421AcpiOsPrintf ("%2.2X\n", (*Target >> 2) & 0xFF);1422break;14231424case ACPI_DMT_FLAGS4:14251426AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);1427break;14281429case ACPI_DMT_FLAGS4_0:14301431AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);1432break;14331434case ACPI_DMT_FLAGS4_4:14351436AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);1437break;14381439case ACPI_DMT_FLAGS4_8:14401441AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);1442break;14431444case ACPI_DMT_FLAGS4_12:14451446AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);1447break;14481449case ACPI_DMT_FLAGS16_16:14501451AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);1452break;14531454/* Integer Data Types */14551456case ACPI_DMT_UINT8:1457case ACPI_DMT_UINT16:1458case ACPI_DMT_UINT24:1459case ACPI_DMT_UINT32:1460case ACPI_DMT_UINT40:1461case ACPI_DMT_UINT48:1462case ACPI_DMT_UINT56:1463case ACPI_DMT_UINT64:1464/*1465* Dump bytes - high byte first, low byte last.1466* Note: All ACPI tables are little-endian.1467*/1468Value = 0;1469for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)1470{1471AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);1472Value |= Target[Temp8 - 1];1473Value <<= 8;1474}14751476if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))1477{1478AcpiOsPrintf (" [Optional field not present]");1479}14801481AcpiOsPrintf ("\n");1482break;14831484case ACPI_DMT_BUF7:1485case ACPI_DMT_BUF10:1486case ACPI_DMT_BUF11:1487case ACPI_DMT_BUF12:1488case ACPI_DMT_BUF16:1489case ACPI_DMT_BUF18:1490case ACPI_DMT_BUF24:1491case ACPI_DMT_BUF26:1492case ACPI_DMT_BUF32:1493case ACPI_DMT_BUF112:1494case ACPI_DMT_BUF128:1495/*1496* Buffer: Size depends on the opcode and was set above.1497* Each hex byte is separated with a space.1498* Multiple lines are separated by line continuation char.1499*/1500for (Temp16 = 0; Temp16 < ByteLength; Temp16++)1501{1502AcpiOsPrintf ("%2.2X", Target[Temp16]);1503if ((UINT32) (Temp16 + 1) < ByteLength)1504{1505if ((Temp16 > 0) && (!((Temp16+1) % 16)))1506{1507AcpiOsPrintf (" \\\n"); /* Line continuation */1508AcpiDmLineHeader (0, 0, NULL);1509}1510else1511{1512AcpiOsPrintf (" ");1513}1514}1515}15161517AcpiOsPrintf ("\n");1518break;15191520case ACPI_DMT_UUID:15211522/* Convert 16-byte UUID buffer to 36-byte formatted UUID string */15231524(void) AcpiUtConvertUuidToString ((char *) Target, AslGbl_MsgBuffer);15251526AcpiOsPrintf ("%s\n", AslGbl_MsgBuffer);1527break;15281529case ACPI_DMT_STRING:15301531AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));1532break;15331534case ACPI_DMT_IVRS_UNTERMINATED_STRING:15351536AcpiOsPrintf ("\"%.*s\"\n", ByteLength, ACPI_CAST_PTR (char, Target));1537break;15381539/* Fixed length ASCII name fields */15401541case ACPI_DMT_SIG:15421543AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);1544AcpiOsPrintf ("\"%.4s\" ", RepairedName);15451546TableData = AcpiAhGetTableInfo (ACPI_CAST_PTR (char, Target));1547if (TableData)1548{1549AcpiOsPrintf (STRING_FORMAT, TableData->Description);1550}1551else1552{1553AcpiOsPrintf ("\n");1554}1555break;15561557case ACPI_DMT_NAME4:15581559AcpiUtCheckAndRepairAscii (Target, RepairedName, 4);1560AcpiOsPrintf ("\"%.4s\"\n", RepairedName);1561break;15621563case ACPI_DMT_NAME6:15641565AcpiUtCheckAndRepairAscii (Target, RepairedName, 6);1566AcpiOsPrintf ("\"%.6s\"\n", RepairedName);1567break;15681569case ACPI_DMT_NAME8:15701571AcpiUtCheckAndRepairAscii (Target, RepairedName, 8);1572AcpiOsPrintf ("\"%.8s\"\n", RepairedName);1573break;15741575/* Special Data Types */15761577case ACPI_DMT_CHKSUM:15781579/* Checksum, display and validate */15801581AcpiOsPrintf ("%2.2X", *Target);1582Temp8 = AcpiUtGenerateChecksum (Table,1583ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,1584ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);15851586if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)1587{1588AcpiOsPrintf (1589" /* Incorrect checksum, should be %2.2X */", Temp8);1590}15911592AcpiOsPrintf ("\n");1593break;15941595case ACPI_DMT_SPACEID:15961597/* Address Space ID */15981599AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiUtGetRegionName (*Target));1600break;16011602case ACPI_DMT_ACCWIDTH:16031604/* Encoded Access Width */16051606Temp8 = *Target;1607if (Temp8 > ACPI_GAS_WIDTH_RESERVED)1608{1609Temp8 = ACPI_GAS_WIDTH_RESERVED;1610}16111612AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);1613break;16141615case ACPI_DMT_GAS:16161617/* Generic Address Structure */16181619AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");1620Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,1621sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);1622if (ACPI_FAILURE (Status))1623{1624return (Status);1625}16261627AcpiOsPrintf ("\n");1628LastOutputBlankLine = TRUE;1629break;16301631case ACPI_DMT_AEST:16321633/* AEST subtable types */16341635Temp8 = *Target;1636if (Temp8 > ACPI_AEST_NODE_TYPE_RESERVED)1637{1638Temp8 = ACPI_AEST_NODE_TYPE_RESERVED;1639}16401641AcpiOsPrintf (UINT8_FORMAT, *Target,1642AcpiDmAestSubnames[Temp8]);1643break;16441645case ACPI_DMT_AEST_CACHE:16461647/* AEST cache resource subtable */16481649Temp32 = *Target;1650if (Temp32 > ACPI_AEST_CACHE_RESERVED)1651{1652Temp32 = ACPI_AEST_CACHE_RESERVED;1653}16541655AcpiOsPrintf (UINT32_FORMAT, *Target,1656AcpiDmAestCacheNames[Temp32]);1657break;16581659case ACPI_DMT_AEST_GIC:16601661/* AEST GIC error subtable */16621663Temp32 = *Target;1664if (Temp32 > ACPI_AEST_GIC_RESERVED)1665{1666Temp32 = ACPI_AEST_GIC_RESERVED;1667}16681669AcpiOsPrintf (UINT32_FORMAT, *Target,1670AcpiDmAestGicNames[Temp32]);1671break;16721673case ACPI_DMT_AEST_RES:16741675/* AEST resource type subtable */16761677Temp8 = *Target;1678if (Temp8 > ACPI_AEST_RESOURCE_RESERVED)1679{1680Temp8 = ACPI_AEST_RESOURCE_RESERVED;1681}16821683AcpiOsPrintf (UINT8_FORMAT, *Target,1684AcpiDmAestResourceNames[Temp8]);1685break;16861687case ACPI_DMT_AEST_XFACE:16881689/* AEST interface structure types */16901691Temp8 = *Target;1692if (Temp8 > ACPI_AEST_XFACE_RESERVED)1693{1694Temp8 = ACPI_AEST_XFACE_RESERVED;1695}16961697AcpiOsPrintf (UINT8_FORMAT, *Target,1698AcpiDmAestXfaceNames[Temp8]);1699break;17001701case ACPI_DMT_AEST_XRUPT:17021703/* AEST interrupt structure types */17041705Temp8 = *Target;1706if (Temp8 > ACPI_AEST_XRUPT_RESERVED)1707{1708Temp8 = ACPI_AEST_XRUPT_RESERVED;1709}17101711AcpiOsPrintf (UINT8_FORMAT, *Target,1712AcpiDmAestXruptNames[Temp8]);1713break;17141715case ACPI_DMT_ASPT:1716/* ASPT subtable types */1717Temp16 = ACPI_GET16(Target);1718if (Temp16 > ACPI_ASPT_TYPE_UNKNOWN)1719{1720Temp16 = ACPI_ASPT_TYPE_UNKNOWN;1721}17221723AcpiOsPrintf(UINT16_FORMAT, Temp16, AcpiDmAsptSubnames[Temp16]);1724break;17251726case ACPI_DMT_ASF:17271728/* ASF subtable types */17291730Temp16 = (UINT16) ((*Target) & 0x7F); /* Top bit can be zero or one */1731if (Temp16 > ACPI_ASF_TYPE_RESERVED)1732{1733Temp16 = ACPI_ASF_TYPE_RESERVED;1734}17351736AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);1737break;17381739case ACPI_DMT_CDAT:17401741/* CDAT subtable types */17421743Temp8 = *Target;1744if (Temp8 > ACPI_CDAT_TYPE_RESERVED)1745{1746Temp8 = ACPI_CDAT_TYPE_RESERVED;1747}17481749AcpiOsPrintf (UINT8_FORMAT, *Target,1750AcpiDmCdatSubnames[Temp8]);1751break;17521753case ACPI_DMT_CEDT:17541755/* CEDT subtable types */17561757Temp8 = *Target;1758if (Temp8 > ACPI_CEDT_TYPE_RESERVED)1759{1760Temp8 = ACPI_CEDT_TYPE_RESERVED;1761}17621763AcpiOsPrintf (UINT8_FORMAT, *Target,1764AcpiDmCedtSubnames[Temp8]);1765break;17661767case ACPI_DMT_DMAR:17681769/* DMAR subtable types */17701771Temp16 = ACPI_GET16 (Target);1772if (Temp16 > ACPI_DMAR_TYPE_RESERVED)1773{1774Temp16 = ACPI_DMAR_TYPE_RESERVED;1775}17761777AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1778AcpiDmDmarSubnames[Temp16]);1779break;17801781case ACPI_DMT_DMAR_SCOPE:17821783/* DMAR device scope types */17841785Temp8 = *Target;1786if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)1787{1788Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;1789}17901791AcpiOsPrintf (UINT8_FORMAT, *Target,1792AcpiDmDmarScope[Temp8]);1793break;17941795case ACPI_DMT_EINJACT:17961797/* EINJ Action types */17981799Temp8 = *Target;1800if (Temp8 > ACPI_EINJ_ACTION_RESERVED)1801{1802Temp8 = ACPI_EINJ_ACTION_RESERVED;1803}18041805AcpiOsPrintf (UINT8_FORMAT, *Target,1806AcpiDmEinjActions[Temp8]);1807break;18081809case ACPI_DMT_EINJINST:18101811/* EINJ Instruction types */18121813Temp8 = *Target;1814if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)1815{1816Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;1817}18181819AcpiOsPrintf (UINT8_FORMAT, *Target,1820AcpiDmEinjInstructions[Temp8]);1821break;18221823case ACPI_DMT_ERSTACT:18241825/* ERST Action types */18261827Temp8 = *Target;1828if (Temp8 > ACPI_ERST_ACTION_RESERVED)1829{1830Temp8 = ACPI_ERST_ACTION_RESERVED;1831}18321833AcpiOsPrintf (UINT8_FORMAT, *Target,1834AcpiDmErstActions[Temp8]);1835break;18361837case ACPI_DMT_ERDT:18381839/* ERDT subtable types */18401841Temp16 = *Target;1842if (Temp16 > ACPI_ERDT_TYPE_RESERVED)1843{1844Temp16 = ACPI_ERDT_TYPE_RESERVED;1845}18461847AcpiOsPrintf (UINT8_FORMAT, *Target,1848AcpiDmErdtSubnames[Temp16]);1849break;18501851case ACPI_DMT_ERSTINST:18521853/* ERST Instruction types */18541855Temp8 = *Target;1856if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)1857{1858Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;1859}18601861AcpiOsPrintf (UINT8_FORMAT, *Target,1862AcpiDmErstInstructions[Temp8]);1863break;18641865case ACPI_DMT_GTDT:18661867/* GTDT subtable types */18681869Temp8 = *Target;1870if (Temp8 > ACPI_GTDT_TYPE_RESERVED)1871{1872Temp8 = ACPI_GTDT_TYPE_RESERVED;1873}18741875AcpiOsPrintf (UINT8_FORMAT, *Target,1876AcpiDmGtdtSubnames[Temp8]);1877break;18781879case ACPI_DMT_HEST:18801881/* HEST subtable types */18821883Temp16 = ACPI_GET16 (Target);1884if (Temp16 > ACPI_HEST_TYPE_RESERVED)1885{1886Temp16 = ACPI_HEST_TYPE_RESERVED;1887}18881889AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1890AcpiDmHestSubnames[Temp16]);1891break;18921893case ACPI_DMT_HESTNTFY:18941895AcpiOsPrintf (STRING_FORMAT,1896"Hardware Error Notification Structure");18971898Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,1899sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);1900if (ACPI_FAILURE (Status))1901{1902return (Status);1903}19041905AcpiOsPrintf ("\n");1906LastOutputBlankLine = TRUE;1907break;19081909case ACPI_DMT_HESTNTYP:19101911/* HEST Notify types */19121913Temp8 = *Target;1914if (Temp8 > ACPI_HEST_NOTIFY_RESERVED)1915{1916Temp8 = ACPI_HEST_NOTIFY_RESERVED;1917}19181919AcpiOsPrintf (UINT8_FORMAT, *Target,1920AcpiDmHestNotifySubnames[Temp8]);1921break;19221923case ACPI_DMT_HMAT:19241925/* HMAT subtable types */19261927Temp16 = *Target;1928if (Temp16 > ACPI_HMAT_TYPE_RESERVED)1929{1930Temp16 = ACPI_HMAT_TYPE_RESERVED;1931}19321933AcpiOsPrintf (UINT16_FORMAT, *Target,1934AcpiDmHmatSubnames[Temp16]);1935break;19361937case ACPI_DMT_IORTMEM:19381939AcpiOsPrintf (STRING_FORMAT,1940"IORT Memory Access Properties");19411942Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,1943sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);1944if (ACPI_FAILURE (Status))1945{1946return (Status);1947}19481949LastOutputBlankLine = TRUE;1950break;19511952case ACPI_DMT_MADT:19531954/* MADT subtable types */19551956Temp8 = *Target;1957if ((Temp8 >= ACPI_MADT_TYPE_RESERVED) && (Temp8 < ACPI_MADT_TYPE_OEM_RESERVED))1958{1959Temp8 = ACPI_MADT_TYPE_RESERVED;1960}1961else if (Temp8 >= ACPI_MADT_TYPE_OEM_RESERVED)1962{1963Temp8 = ACPI_MADT_TYPE_RESERVED + 1;1964}1965AcpiOsPrintf (UINT8_FORMAT, *Target,1966AcpiDmMadtSubnames[Temp8]);1967break;19681969case ACPI_DMT_MPAM_LOCATOR:19701971/* MPAM subtable locator types */19721973Temp8 = *Target;1974if (Temp8 > ACPI_MPAM_LOCATION_TYPE_INTERCONNECT)1975{1976Temp8 = ACPI_MPAM_LOCATION_TYPE_INTERCONNECT + 1;1977}19781979AcpiOsPrintf (UINT8_FORMAT, *Target,1980AcpiDmMpamSubnames[Temp8]);1981break;19821983case ACPI_DMT_NFIT:19841985/* NFIT subtable types */19861987Temp16 = ACPI_GET16 (Target);1988if (Temp16 > ACPI_NFIT_TYPE_RESERVED)1989{1990Temp16 = ACPI_NFIT_TYPE_RESERVED;1991}19921993AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),1994AcpiDmNfitSubnames[Temp16]);1995break;19961997case ACPI_DMT_PCCT:19981999/* PCCT subtable types */20002001Temp8 = *Target;2002if (Temp8 > ACPI_PCCT_TYPE_RESERVED)2003{2004Temp8 = ACPI_PCCT_TYPE_RESERVED;2005}20062007AcpiOsPrintf (UINT8_FORMAT, *Target,2008AcpiDmPcctSubnames[Temp8]);2009break;20102011case ACPI_DMT_PHAT:20122013/* PHAT subtable types */20142015Temp16 = ACPI_GET16 (Target);2016if (Temp16 > ACPI_PHAT_TYPE_RESERVED)2017{2018Temp16 = ACPI_PHAT_TYPE_RESERVED;2019}20202021AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),2022AcpiDmPhatSubnames[Temp16]);2023break;20242025case ACPI_DMT_PMTT:20262027/* PMTT subtable types */20282029Temp8 = *Target;2030if (Temp8 == ACPI_PMTT_TYPE_VENDOR)2031{2032Temp8 = ACPI_PMTT_TYPE_RESERVED + 1;2033}2034else if (Temp8 > ACPI_PMTT_TYPE_RESERVED)2035{2036Temp8 = ACPI_PMTT_TYPE_RESERVED;2037}2038AcpiOsPrintf (UINT8_FORMAT, *Target,2039AcpiDmPmttSubnames[Temp8]);2040break;20412042case ACPI_DMT_PPTT:20432044/* PPTT subtable types */20452046Temp8 = *Target;2047if (Temp8 > ACPI_PPTT_TYPE_RESERVED)2048{2049Temp8 = ACPI_PPTT_TYPE_RESERVED;2050}20512052AcpiOsPrintf (UINT8_FORMAT, *Target,2053AcpiDmPpttSubnames[Temp8]);2054break;20552056case ACPI_DMT_UNICODE:2057case ACPI_DMT_WPBT_UNICODE:20582059if (ByteLength == 0)2060{2061AcpiOsPrintf ("/* Zero-length Data */\n");2062break;2063}20642065AcpiDmDumpUnicode (Table, 0, ByteLength);2066break;20672068case ACPI_DMT_RAW_BUFFER:2069case ACPI_DMT_BUFFER:2070case ACPI_DMT_PMTT_VENDOR:20712072if (ByteLength == 0)2073{2074AcpiOsPrintf ("/* Zero-length Data */\n");2075break;2076}20772078AcpiDmDumpBuffer (Target, 0, ByteLength, CurrentOffset, NULL);2079break;20802081case ACPI_DMT_RGRT:20822083/* RGRT subtable types */20842085Temp8 = *Target;2086if (Temp8 >= ACPI_RGRT_TYPE_RESERVED)2087{2088Temp8 = ACPI_RGRT_TYPE_RESERVED0;2089}20902091AcpiOsPrintf (UINT8_FORMAT, *Target,2092AcpiDmRgrtSubnames[Temp8]);2093break;20942095case ACPI_DMT_RHCT:20962097/* RHCT subtable types */20982099Temp16 = ACPI_GET16 (Target);2100if (Temp16 == ACPI_RHCT_NODE_TYPE_HART_INFO)2101{2102Temp16 = ACPI_RHCT_NODE_TYPE_RESERVED;2103}21042105AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),2106AcpiDmRhctSubnames[Temp16]);2107break;21082109case ACPI_DMT_SDEV:21102111/* SDEV subtable types */21122113Temp8 = *Target;2114if (Temp8 > ACPI_SDEV_TYPE_RESERVED)2115{2116Temp8 = ACPI_SDEV_TYPE_RESERVED;2117}21182119AcpiOsPrintf (UINT8_FORMAT, *Target,2120AcpiDmSdevSubnames[Temp8]);2121break;21222123case ACPI_DMT_SRAT:21242125/* SRAT subtable types */21262127Temp8 = *Target;2128if (Temp8 > ACPI_SRAT_TYPE_RESERVED)2129{2130Temp8 = ACPI_SRAT_TYPE_RESERVED;2131}21322133AcpiOsPrintf (UINT8_FORMAT, *Target,2134AcpiDmSratSubnames[Temp8]);2135break;21362137case ACPI_DMT_TPM2:21382139/* TPM2 Start Method types */21402141Temp8 = *Target;2142if (Temp8 > ACPI_TPM2_RESERVED)2143{2144Temp8 = ACPI_TPM2_RESERVED;2145}21462147AcpiOsPrintf (UINT8_FORMAT, *Target,2148AcpiDmTpm2Subnames[Temp8]);2149break;215021512152case ACPI_DMT_FADTPM:21532154/* FADT Preferred PM Profile names */21552156Temp8 = *Target;2157if (Temp8 > ACPI_FADT_PM_RESERVED)2158{2159Temp8 = ACPI_FADT_PM_RESERVED;2160}21612162AcpiOsPrintf (UINT8_FORMAT, *Target,2163AcpiDmFadtProfiles[Temp8]);2164break;21652166case ACPI_DMT_IOVT:21672168/* IOVT subtable types */21692170Temp16 = ACPI_GET16(Target);2171if (Temp16 > ACPI_IOVT_IOMMU_RESERVED)2172{2173Temp16 = ACPI_IOVT_IOMMU_RESERVED;2174}21752176AcpiOsPrintf(UINT16_FORMAT, Temp16, AcpiDmIovtSubnames[Temp16]);2177break;21782179case ACPI_DMT_IOVTDEV:21802181/* IOVT subtable types */21822183Temp8 = *Target;2184if (Temp8 > ACPI_IOVT_DEVICE_ENTRY_RESERVED)2185{2186Temp8 = ACPI_IOVT_DEVICE_ENTRY_RESERVED;2187}21882189AcpiOsPrintf (UINT8_FORMAT, *Target,2190AcpiDmIovtdevSubnames[Temp8]);2191break;21922193case ACPI_DMT_IVRS:21942195/* IVRS subtable types */21962197Temp8 = *Target;2198switch (Temp8)2199{2200case ACPI_IVRS_TYPE_HARDWARE1:2201case ACPI_IVRS_TYPE_HARDWARE2:22022203Name = AcpiDmIvrsSubnames[0];2204break;22052206case ACPI_IVRS_TYPE_HARDWARE3:22072208Name = AcpiDmIvrsSubnames[1];2209break;22102211case ACPI_IVRS_TYPE_MEMORY1:2212case ACPI_IVRS_TYPE_MEMORY2:2213case ACPI_IVRS_TYPE_MEMORY3:22142215Name = AcpiDmIvrsSubnames[2];2216break;22172218default:22192220Name = AcpiDmIvrsSubnames[3];2221break;2222}22232224AcpiOsPrintf (UINT8_FORMAT, *Target, Name);2225break;22262227case ACPI_DMT_IVRS_DE:22282229/* IVRS device entry types */22302231Temp8 = *Target;2232switch (Temp8)2233{2234case ACPI_IVRS_TYPE_ALL:2235case ACPI_IVRS_TYPE_SELECT:2236case ACPI_IVRS_TYPE_START:2237case ACPI_IVRS_TYPE_END:22382239Name = AcpiDmIvrsDevEntryNames[Temp8];2240break;22412242case ACPI_IVRS_TYPE_ALIAS_SELECT:2243case ACPI_IVRS_TYPE_ALIAS_START:2244case ACPI_IVRS_TYPE_EXT_SELECT:2245case ACPI_IVRS_TYPE_EXT_START:2246case ACPI_IVRS_TYPE_SPECIAL:22472248Name = AcpiDmIvrsDevEntryNames[Temp8 - 61];2249break;22502251case ACPI_IVRS_TYPE_HID:22522253Name = AcpiDmIvrsDevEntryNames[Temp8 - 228];2254break;22552256default:2257Name = AcpiDmIvrsDevEntryNames[0]; /* Unknown/Reserved */2258break;2259}22602261AcpiOsPrintf (UINT8_FORMAT, *Target, Name);2262break;22632264case ACPI_DMT_LPIT:22652266/* LPIT subtable types */22672268Temp32 = ACPI_GET32 (Target);2269if (Temp32 > ACPI_LPIT_TYPE_RESERVED)2270{2271Temp32 = ACPI_LPIT_TYPE_RESERVED;2272}22732274AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),2275AcpiDmLpitSubnames[Temp32]);2276break;22772278case ACPI_DMT_VIOT:22792280/* VIOT subtable types */22812282Temp8 = *Target;2283if (Temp8 > ACPI_VIOT_RESERVED)2284{2285Temp8 = ACPI_VIOT_RESERVED;2286}22872288AcpiOsPrintf (UINT8_FORMAT, *Target,2289AcpiDmViotSubnames[Temp8]);2290break;22912292case ACPI_DMT_EXIT:22932294return (AE_OK);22952296default:22972298ACPI_ERROR ((AE_INFO,2299"**** Invalid table opcode [0x%X] ****\n", Info->Opcode));2300return (AE_SUPPORT);2301}2302}23032304if (TableOffset && !SubtableLength)2305{2306/*2307* If this table is not the main table, the subtable must have a2308* valid length2309*/2310AcpiOsPrintf ("Invalid zero length subtable\n");2311return (AE_BAD_DATA);2312}23132314return (AE_OK);2315}231623172318