Path: blob/main/sys/contrib/dev/acpica/common/dmtbdump3.c
48378 views
/******************************************************************************1*2* Module Name: dmtbdump3 - Dump ACPI data 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>155156/* This module used for application-level code only */157158#define _COMPONENT ACPI_CA_DISASSEMBLER159ACPI_MODULE_NAME ("dmtbdump3")160161162/*******************************************************************************163*164* FUNCTION: AcpiDmDumpSlic165*166* PARAMETERS: Table - A SLIC table167*168* RETURN: None169*170* DESCRIPTION: Format the contents of a SLIC171*172******************************************************************************/173174void175AcpiDmDumpSlic (176ACPI_TABLE_HEADER *Table)177{178179(void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER),180(void *) ((UINT8 *)Table + sizeof (*Table)),181Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);182}183184185/*******************************************************************************186*187* FUNCTION: AcpiDmDumpSlit188*189* PARAMETERS: Table - An SLIT190*191* RETURN: None192*193* DESCRIPTION: Format the contents of a SLIT194*195******************************************************************************/196197void198AcpiDmDumpSlit (199ACPI_TABLE_HEADER *Table)200{201ACPI_STATUS Status;202UINT32 Offset;203UINT8 *Row;204UINT32 Localities;205UINT32 i;206UINT32 j;207208209/* Main table */210211Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);212if (ACPI_FAILURE (Status))213{214return;215}216217/* Display the Locality NxN Matrix */218219Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;220Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);221Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;222223for (i = 0; i < Localities; i++)224{225/* Display one row of the matrix */226227AcpiDmLineHeader2 (Offset, Localities, "Locality", i);228for (j = 0; j < Localities; j++)229{230/* Check for beyond EOT */231232if (Offset >= Table->Length)233{234AcpiOsPrintf (235"\n**** Not enough room in table for all localities\n");236return;237}238239AcpiOsPrintf ("%2.2X", Row[j]);240Offset++;241242/* Display up to 16 bytes per output row */243244if ((j+1) < Localities)245{246AcpiOsPrintf (" ");247248if (j && (((j+1) % 16) == 0))249{250AcpiOsPrintf ("\\\n"); /* With line continuation char */251AcpiDmLineHeader (Offset, 0, NULL);252}253}254}255256/* Point to next row */257258AcpiOsPrintf ("\n");259Row += Localities;260}261}262263264/*******************************************************************************265*266* FUNCTION: AcpiDmDumpSrat267*268* PARAMETERS: Table - A SRAT table269*270* RETURN: None271*272* DESCRIPTION: Format the contents of a SRAT273*274******************************************************************************/275276void277AcpiDmDumpSrat (278ACPI_TABLE_HEADER *Table)279{280ACPI_STATUS Status;281UINT32 Offset = sizeof (ACPI_TABLE_SRAT);282ACPI_SUBTABLE_HEADER *Subtable;283ACPI_DMTABLE_INFO *InfoTable;284285286/* Main table */287288Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);289if (ACPI_FAILURE (Status))290{291return;292}293294/* Subtables */295296Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);297while (Offset < Table->Length)298{299/* Common subtable header */300301AcpiOsPrintf ("\n");302Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,303Subtable->Length, AcpiDmTableInfoSratHdr);304if (ACPI_FAILURE (Status))305{306return;307}308309switch (Subtable->Type)310{311case ACPI_SRAT_TYPE_CPU_AFFINITY:312313InfoTable = AcpiDmTableInfoSrat0;314break;315316case ACPI_SRAT_TYPE_MEMORY_AFFINITY:317318InfoTable = AcpiDmTableInfoSrat1;319break;320321case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:322323InfoTable = AcpiDmTableInfoSrat2;324break;325326case ACPI_SRAT_TYPE_GICC_AFFINITY:327328InfoTable = AcpiDmTableInfoSrat3;329break;330331case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:332333InfoTable = AcpiDmTableInfoSrat4;334break;335336case ACPI_SRAT_TYPE_GENERIC_AFFINITY:337338InfoTable = AcpiDmTableInfoSrat5;339break;340341case ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY:342343InfoTable = AcpiDmTableInfoSrat6;344break;345346case ACPI_SRAT_TYPE_RINTC_AFFINITY:347348InfoTable = AcpiDmTableInfoSrat7;349break;350351default:352AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",353Subtable->Type);354355/* Attempt to continue */356357if (!Subtable->Length)358{359AcpiOsPrintf ("Invalid zero length subtable\n");360return;361}362goto NextSubtable;363}364365AcpiOsPrintf ("\n");366Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,367Subtable->Length, InfoTable);368if (ACPI_FAILURE (Status))369{370return;371}372373NextSubtable:374/* Point to next subtable */375376Offset += Subtable->Length;377Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable,378Subtable->Length);379}380}381382383/*******************************************************************************384*385* FUNCTION: AcpiDmDumpStao386*387* PARAMETERS: Table - A STAO table388*389* RETURN: None390*391* DESCRIPTION: Format the contents of a STAO. This is a variable-length392* table that contains an open-ended number of ASCII strings393* at the end of the table.394*395******************************************************************************/396397void398AcpiDmDumpStao (399ACPI_TABLE_HEADER *Table)400{401ACPI_STATUS Status;402char *Namepath;403UINT32 Length = Table->Length;404UINT32 StringLength;405UINT32 Offset = sizeof (ACPI_TABLE_STAO);406407408/* Main table */409410Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);411if (ACPI_FAILURE (Status))412{413return;414}415416/* The rest of the table consists of Namepath strings */417418while (Offset < Table->Length)419{420Namepath = ACPI_ADD_PTR (char, Table, Offset);421StringLength = strlen (Namepath) + 1;422423AcpiDmLineHeader (Offset, StringLength, "Namepath");424AcpiOsPrintf ("\"%s\"\n", Namepath);425426/* Point to next namepath */427428Offset += StringLength;429}430}431432433/*******************************************************************************434*435* FUNCTION: AcpiDmDumpSvkl436*437* PARAMETERS: Table - A SVKL table438*439* RETURN: None440*441* DESCRIPTION: Format the contents of a SVKL. This is a variable-length442* table that contains an open-ended number of key subtables at443* the end of the header.444*445* NOTES: SVKL is essentially a flat table, with a small main table and446* a variable number of a single type of subtable.447*448******************************************************************************/449450void451AcpiDmDumpSvkl (452ACPI_TABLE_HEADER *Table)453{454ACPI_STATUS Status;455UINT32 Length = Table->Length;456UINT32 Offset = sizeof (ACPI_TABLE_SVKL);457ACPI_SVKL_KEY *Subtable;458459460/* Main table */461462Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSvkl);463if (ACPI_FAILURE (Status))464{465return;466}467468/* The rest of the table consists of subtables (single type) */469470Subtable = ACPI_ADD_PTR (ACPI_SVKL_KEY, Table, Offset);471while (Offset < Table->Length)472{473/* Dump the subtable */474475AcpiOsPrintf ("\n");476Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,477sizeof (ACPI_SVKL_KEY), AcpiDmTableInfoSvkl0);478if (ACPI_FAILURE (Status))479{480return;481}482483/* Point to next subtable */484485Offset += sizeof (ACPI_SVKL_KEY);486Subtable = ACPI_ADD_PTR (ACPI_SVKL_KEY, Subtable,487sizeof (ACPI_SVKL_KEY));488}489}490491492/*******************************************************************************493*494* FUNCTION: AcpiDmDumpTcpa495*496* PARAMETERS: Table - A TCPA table497*498* RETURN: None499*500* DESCRIPTION: Format the contents of a TCPA.501*502* NOTE: There are two versions of the table with the same signature:503* the client version and the server version. The common504* PlatformClass field is used to differentiate the two types of505* tables.506*507******************************************************************************/508509void510AcpiDmDumpTcpa (511ACPI_TABLE_HEADER *Table)512{513UINT32 Offset = sizeof (ACPI_TABLE_TCPA_HDR);514ACPI_TABLE_TCPA_HDR *CommonHeader = ACPI_CAST_PTR (515ACPI_TABLE_TCPA_HDR, Table);516ACPI_TABLE_TCPA_HDR *Subtable = ACPI_ADD_PTR (517ACPI_TABLE_TCPA_HDR, Table, Offset);518ACPI_STATUS Status;519520521/* Main table */522523Status = AcpiDmDumpTable (Table->Length, 0, Table,5240, AcpiDmTableInfoTcpaHdr);525if (ACPI_FAILURE (Status))526{527return;528}529530/*531* Examine the PlatformClass field to determine the table type.532* Either a client or server table. Only one.533*/534switch (CommonHeader->PlatformClass)535{536case ACPI_TCPA_CLIENT_TABLE:537538Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,539Table->Length - Offset, AcpiDmTableInfoTcpaClient);540break;541542case ACPI_TCPA_SERVER_TABLE:543544Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,545Table->Length - Offset, AcpiDmTableInfoTcpaServer);546break;547548default:549550AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",551CommonHeader->PlatformClass);552Status = AE_ERROR;553break;554}555556if (ACPI_FAILURE (Status))557{558AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");559}560}561562563/*******************************************************************************564*565* FUNCTION: AcpiDmDumpTpm2566*567* PARAMETERS: Table - A TPM2 table568*569* RETURN: None570*571* DESCRIPTION: Format the contents of a TPM2.572*573******************************************************************************/574575static void576AcpiDmDumpTpm2Rev3 (577ACPI_TABLE_HEADER *Table)578{579UINT32 Offset = sizeof (ACPI_TABLE_TPM23);580ACPI_TABLE_TPM23 *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table);581ACPI_TPM23_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset);582ACPI_STATUS Status;583584585/* Main table */586587Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23);588if (ACPI_FAILURE (Status))589{590return;591}592593/* Optional subtable if start method is ACPI start method */594595switch (CommonHeader->StartMethod)596{597case ACPI_TPM23_ACPI_START_METHOD:598599(void) AcpiDmDumpTable (Table->Length, Offset, Subtable,600Table->Length - Offset, AcpiDmTableInfoTpm23a);601break;602603default:604break;605}606}607608609/*******************************************************************************610*611* FUNCTION: AcpiDmDumpTpm2612*613* PARAMETERS: Table - A TPM2 table614*615* RETURN: None616*617* DESCRIPTION: Format the contents of a TPM2.618*619******************************************************************************/620621void622AcpiDmDumpTpm2 (623ACPI_TABLE_HEADER *Table)624{625UINT32 Offset = sizeof (ACPI_TABLE_TPM2);626ACPI_TABLE_TPM2 *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM2, Table);627ACPI_TPM2_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM2_TRAILER, Table, Offset);628ACPI_TPM2_ARM_SMC *ArmSubtable;629ACPI_STATUS Status;630631632if (Table->Revision == 3)633{634AcpiDmDumpTpm2Rev3(Table);635return;636}637638/* Main table */639640Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2);641642if (ACPI_FAILURE (Status))643{644return;645}646647AcpiOsPrintf ("\n");648Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,649Table->Length - Offset, AcpiDmTableInfoTpm2a);650if (ACPI_FAILURE (Status))651{652return;653}654655switch (CommonHeader->StartMethod)656{657case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:658659ArmSubtable = ACPI_ADD_PTR (ACPI_TPM2_ARM_SMC, Subtable,660sizeof (ACPI_TPM2_TRAILER));661Offset += sizeof (ACPI_TPM2_TRAILER);662663AcpiOsPrintf ("\n");664(void) AcpiDmDumpTable (Table->Length, Offset, ArmSubtable,665Table->Length - Offset, AcpiDmTableInfoTpm211);666break;667668default:669break;670}671}672673674/*******************************************************************************675*676* FUNCTION: AcpiDmDumpViot677*678* PARAMETERS: Table - A VIOT table679*680* RETURN: None681*682* DESCRIPTION: Format the contents of a VIOT683*684******************************************************************************/685686void687AcpiDmDumpViot (688ACPI_TABLE_HEADER *Table)689{690ACPI_STATUS Status;691ACPI_TABLE_VIOT *Viot;692ACPI_VIOT_HEADER *ViotHeader;693UINT16 Length;694UINT32 Offset;695ACPI_DMTABLE_INFO *InfoTable;696697/* Main table */698699Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoViot);700if (ACPI_FAILURE (Status))701{702return;703}704705Viot = ACPI_CAST_PTR (ACPI_TABLE_VIOT, Table);706707Offset = Viot->NodeOffset;708while (Offset < Table->Length)709{710/* Common subtable header */711ViotHeader = ACPI_ADD_PTR (ACPI_VIOT_HEADER, Table, Offset);712AcpiOsPrintf ("\n");713714Length = sizeof (ACPI_VIOT_HEADER);715Status = AcpiDmDumpTable (Table->Length, Offset, ViotHeader, Length,716AcpiDmTableInfoViotHeader);717if (ACPI_FAILURE (Status))718{719return;720}721722Length = ViotHeader->Length;723switch (ViotHeader->Type)724{725case ACPI_VIOT_NODE_PCI_RANGE:726727InfoTable = AcpiDmTableInfoViot1;728break;729730case ACPI_VIOT_NODE_MMIO:731732InfoTable = AcpiDmTableInfoViot2;733break;734735case ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI:736737InfoTable = AcpiDmTableInfoViot3;738break;739740case ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO:741742InfoTable = AcpiDmTableInfoViot4;743break;744745default:746747AcpiOsPrintf ("\n*** Unknown VIOT node type 0x%X\n",748ViotHeader->Type);749750/* Attempt to continue */751752if (!Length)753{754AcpiOsPrintf ("Invalid zero length VIOT node\n");755return;756}757goto NextSubtable;758}759760AcpiOsPrintf ("\n");761Status = AcpiDmDumpTable (Table->Length, Offset, ViotHeader, Length,762InfoTable);763if (ACPI_FAILURE (Status))764{765return;766}767768NextSubtable:769Offset += Length;770}771}772773774/*******************************************************************************775*776* FUNCTION: AcpiDmDumpWdat777*778* PARAMETERS: Table - A WDAT table779*780* RETURN: None781*782* DESCRIPTION: Format the contents of a WDAT783*784******************************************************************************/785786void787AcpiDmDumpWdat (788ACPI_TABLE_HEADER *Table)789{790ACPI_STATUS Status;791UINT32 Offset = sizeof (ACPI_TABLE_WDAT);792ACPI_WDAT_ENTRY *Subtable;793794795/* Main table */796797Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);798if (ACPI_FAILURE (Status))799{800return;801}802803/* Subtables */804805Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);806while (Offset < Table->Length)807{808/* Common subtable header */809810AcpiOsPrintf ("\n");811Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,812sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);813if (ACPI_FAILURE (Status))814{815return;816}817818/* Point to next subtable */819820Offset += sizeof (ACPI_WDAT_ENTRY);821Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Subtable,822sizeof (ACPI_WDAT_ENTRY));823}824}825826827/*******************************************************************************828*829* FUNCTION: AcpiDmDumpWpbt830*831* PARAMETERS: Table - A WPBT table832*833* RETURN: None834*835* DESCRIPTION: Format the contents of a WPBT. This table type consists836* of an open-ended arguments buffer at the end of the table.837*838******************************************************************************/839840void841AcpiDmDumpWpbt (842ACPI_TABLE_HEADER *Table)843{844ACPI_STATUS Status;845ACPI_TABLE_WPBT *Subtable;846UINT16 ArgumentsLength;847848849/* Dump the main table */850851Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWpbt);852if (ACPI_FAILURE (Status))853{854return;855}856857/* Extract the arguments buffer length from the main table */858859Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);860ArgumentsLength = Subtable->ArgumentsLength;861862/* Dump the arguments buffer if present */863864if (ArgumentsLength)865{866(void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,867AcpiDmTableInfoWpbt0);868}869}870871872