Home | History | Annotate | Line # | Download | only in common
dmtbdump3.c revision 1.1.1.10.6.1
      1           1.1  christos /******************************************************************************
      2           1.1  christos  *
      3           1.1  christos  * Module Name: dmtbdump3 - Dump ACPI data tables that contain no AML code
      4           1.1  christos  *
      5           1.1  christos  *****************************************************************************/
      6           1.1  christos 
      7  1.1.1.10.6.1  perseant /******************************************************************************
      8  1.1.1.10.6.1  perseant  *
      9  1.1.1.10.6.1  perseant  * 1. Copyright Notice
     10  1.1.1.10.6.1  perseant  *
     11  1.1.1.10.6.1  perseant  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
     12           1.1  christos  * All rights reserved.
     13           1.1  christos  *
     14  1.1.1.10.6.1  perseant  * 2. License
     15  1.1.1.10.6.1  perseant  *
     16  1.1.1.10.6.1  perseant  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.1.1.10.6.1  perseant  * rights. You may have additional license terms from the party that provided
     18  1.1.1.10.6.1  perseant  * you this software, covering your right to use that party's intellectual
     19  1.1.1.10.6.1  perseant  * property rights.
     20  1.1.1.10.6.1  perseant  *
     21  1.1.1.10.6.1  perseant  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.1.1.10.6.1  perseant  * copy of the source code appearing in this file ("Covered Code") an
     23  1.1.1.10.6.1  perseant  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.1.1.10.6.1  perseant  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.1.1.10.6.1  perseant  * make derivatives, distribute, use and display any portion of the Covered
     26  1.1.1.10.6.1  perseant  * Code in any form, with the right to sublicense such rights; and
     27  1.1.1.10.6.1  perseant  *
     28  1.1.1.10.6.1  perseant  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.1.1.10.6.1  perseant  * license (with the right to sublicense), under only those claims of Intel
     30  1.1.1.10.6.1  perseant  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.1.1.10.6.1  perseant  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.1.1.10.6.1  perseant  * solely to the minimum extent necessary to exercise the above copyright
     33  1.1.1.10.6.1  perseant  * license, and in no event shall the patent license extend to any additions
     34  1.1.1.10.6.1  perseant  * to or modifications of the Original Intel Code. No other license or right
     35  1.1.1.10.6.1  perseant  * is granted directly or by implication, estoppel or otherwise;
     36  1.1.1.10.6.1  perseant  *
     37  1.1.1.10.6.1  perseant  * The above copyright and patent license is granted only if the following
     38  1.1.1.10.6.1  perseant  * conditions are met:
     39  1.1.1.10.6.1  perseant  *
     40  1.1.1.10.6.1  perseant  * 3. Conditions
     41  1.1.1.10.6.1  perseant  *
     42  1.1.1.10.6.1  perseant  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.1.1.10.6.1  perseant  * Redistribution of source code of any substantial portion of the Covered
     44  1.1.1.10.6.1  perseant  * Code or modification with rights to further distribute source must include
     45  1.1.1.10.6.1  perseant  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.1.1.10.6.1  perseant  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.1.1.10.6.1  perseant  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.1.1.10.6.1  perseant  * contain a file documenting the changes Licensee made to create that Covered
     49  1.1.1.10.6.1  perseant  * Code and the date of any change. Licensee must include in that file the
     50  1.1.1.10.6.1  perseant  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.1.1.10.6.1  perseant  * must include a prominent statement that the modification is derived,
     52  1.1.1.10.6.1  perseant  * directly or indirectly, from Original Intel Code.
     53  1.1.1.10.6.1  perseant  *
     54  1.1.1.10.6.1  perseant  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.1.1.10.6.1  perseant  * Redistribution of source code of any substantial portion of the Covered
     56  1.1.1.10.6.1  perseant  * Code or modification without rights to further distribute source must
     57  1.1.1.10.6.1  perseant  * include the following Disclaimer and Export Compliance provision in the
     58  1.1.1.10.6.1  perseant  * documentation and/or other materials provided with distribution. In
     59  1.1.1.10.6.1  perseant  * addition, Licensee may not authorize further sublicense of source of any
     60  1.1.1.10.6.1  perseant  * portion of the Covered Code, and must include terms to the effect that the
     61  1.1.1.10.6.1  perseant  * license from Licensee to its licensee is limited to the intellectual
     62  1.1.1.10.6.1  perseant  * property embodied in the software Licensee provides to its licensee, and
     63  1.1.1.10.6.1  perseant  * not to intellectual property embodied in modifications its licensee may
     64  1.1.1.10.6.1  perseant  * make.
     65  1.1.1.10.6.1  perseant  *
     66  1.1.1.10.6.1  perseant  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.1.1.10.6.1  perseant  * substantial portion of the Covered Code or modification must reproduce the
     68  1.1.1.10.6.1  perseant  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.1.1.10.6.1  perseant  * provision in the documentation and/or other materials provided with the
     70  1.1.1.10.6.1  perseant  * distribution.
     71  1.1.1.10.6.1  perseant  *
     72  1.1.1.10.6.1  perseant  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.1.1.10.6.1  perseant  * Intel Code.
     74  1.1.1.10.6.1  perseant  *
     75  1.1.1.10.6.1  perseant  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.1.1.10.6.1  perseant  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.1.1.10.6.1  perseant  * other dealings in products derived from or relating to the Covered Code
     78  1.1.1.10.6.1  perseant  * without prior written authorization from Intel.
     79  1.1.1.10.6.1  perseant  *
     80  1.1.1.10.6.1  perseant  * 4. Disclaimer and Export Compliance
     81  1.1.1.10.6.1  perseant  *
     82  1.1.1.10.6.1  perseant  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.1.1.10.6.1  perseant  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.1.1.10.6.1  perseant  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.1.1.10.6.1  perseant  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.1.1.10.6.1  perseant  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.1.1.10.6.1  perseant  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.1.1.10.6.1  perseant  * PARTICULAR PURPOSE.
     89  1.1.1.10.6.1  perseant  *
     90  1.1.1.10.6.1  perseant  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.1.1.10.6.1  perseant  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.1.1.10.6.1  perseant  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.1.1.10.6.1  perseant  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.1.1.10.6.1  perseant  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.1.1.10.6.1  perseant  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.1.1.10.6.1  perseant  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.1.1.10.6.1  perseant  * LIMITED REMEDY.
     98  1.1.1.10.6.1  perseant  *
     99  1.1.1.10.6.1  perseant  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.1.1.10.6.1  perseant  * software or system incorporating such software without first obtaining any
    101  1.1.1.10.6.1  perseant  * required license or other approval from the U. S. Department of Commerce or
    102  1.1.1.10.6.1  perseant  * any other agency or department of the United States Government. In the
    103  1.1.1.10.6.1  perseant  * event Licensee exports any such software from the United States or
    104  1.1.1.10.6.1  perseant  * re-exports any such software from a foreign destination, Licensee shall
    105  1.1.1.10.6.1  perseant  * ensure that the distribution and export/re-export of the software is in
    106  1.1.1.10.6.1  perseant  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.1.1.10.6.1  perseant  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.1.1.10.6.1  perseant  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.1.1.10.6.1  perseant  * software, or service, directly or indirectly, to any country for which the
    110  1.1.1.10.6.1  perseant  * United States government or any agency thereof requires an export license,
    111  1.1.1.10.6.1  perseant  * other governmental approval, or letter of assurance, without first obtaining
    112  1.1.1.10.6.1  perseant  * such license, approval or letter.
    113  1.1.1.10.6.1  perseant  *
    114  1.1.1.10.6.1  perseant  *****************************************************************************
    115  1.1.1.10.6.1  perseant  *
    116  1.1.1.10.6.1  perseant  * Alternatively, you may choose to be licensed under the terms of the
    117  1.1.1.10.6.1  perseant  * following license:
    118  1.1.1.10.6.1  perseant  *
    119           1.1  christos  * Redistribution and use in source and binary forms, with or without
    120           1.1  christos  * modification, are permitted provided that the following conditions
    121           1.1  christos  * are met:
    122           1.1  christos  * 1. Redistributions of source code must retain the above copyright
    123           1.1  christos  *    notice, this list of conditions, and the following disclaimer,
    124           1.1  christos  *    without modification.
    125           1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126           1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
    127           1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
    128           1.1  christos  *    including a substantially similar Disclaimer requirement for further
    129           1.1  christos  *    binary redistribution.
    130           1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
    131           1.1  christos  *    of any contributors may be used to endorse or promote products derived
    132           1.1  christos  *    from this software without specific prior written permission.
    133           1.1  christos  *
    134           1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135           1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136       1.1.1.6  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137           1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.1.1.10.6.1  perseant  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.1.1.10.6.1  perseant  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.1.1.10.6.1  perseant  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.1.1.10.6.1  perseant  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.1.1.10.6.1  perseant  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.1.1.10.6.1  perseant  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.1.1.10.6.1  perseant  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.1.1.10.6.1  perseant  *
    146  1.1.1.10.6.1  perseant  * Alternatively, you may choose to be licensed under the terms of the
    147  1.1.1.10.6.1  perseant  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.1.1.10.6.1  perseant  * Software Foundation.
    149  1.1.1.10.6.1  perseant  *
    150  1.1.1.10.6.1  perseant  *****************************************************************************/
    151           1.1  christos 
    152           1.1  christos #include "acpi.h"
    153           1.1  christos #include "accommon.h"
    154           1.1  christos #include "acdisasm.h"
    155           1.1  christos #include "actables.h"
    156           1.1  christos 
    157           1.1  christos /* This module used for application-level code only */
    158           1.1  christos 
    159           1.1  christos #define _COMPONENT          ACPI_CA_DISASSEMBLER
    160           1.1  christos         ACPI_MODULE_NAME    ("dmtbdump3")
    161           1.1  christos 
    162           1.1  christos 
    163           1.1  christos /*******************************************************************************
    164           1.1  christos  *
    165           1.1  christos  * FUNCTION:    AcpiDmDumpSlic
    166           1.1  christos  *
    167           1.1  christos  * PARAMETERS:  Table               - A SLIC table
    168           1.1  christos  *
    169           1.1  christos  * RETURN:      None
    170           1.1  christos  *
    171           1.1  christos  * DESCRIPTION: Format the contents of a SLIC
    172           1.1  christos  *
    173           1.1  christos  ******************************************************************************/
    174           1.1  christos 
    175           1.1  christos void
    176           1.1  christos AcpiDmDumpSlic (
    177           1.1  christos     ACPI_TABLE_HEADER       *Table)
    178           1.1  christos {
    179           1.1  christos 
    180  1.1.1.10.6.1  perseant     (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER),
    181  1.1.1.10.6.1  perseant         (void *) ((UINT8 *)Table + sizeof (*Table)),
    182           1.1  christos         Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
    183           1.1  christos }
    184           1.1  christos 
    185           1.1  christos 
    186           1.1  christos /*******************************************************************************
    187           1.1  christos  *
    188           1.1  christos  * FUNCTION:    AcpiDmDumpSlit
    189           1.1  christos  *
    190           1.1  christos  * PARAMETERS:  Table               - An SLIT
    191           1.1  christos  *
    192           1.1  christos  * RETURN:      None
    193           1.1  christos  *
    194           1.1  christos  * DESCRIPTION: Format the contents of a SLIT
    195           1.1  christos  *
    196           1.1  christos  ******************************************************************************/
    197           1.1  christos 
    198           1.1  christos void
    199           1.1  christos AcpiDmDumpSlit (
    200           1.1  christos     ACPI_TABLE_HEADER       *Table)
    201           1.1  christos {
    202           1.1  christos     ACPI_STATUS             Status;
    203           1.1  christos     UINT32                  Offset;
    204           1.1  christos     UINT8                   *Row;
    205           1.1  christos     UINT32                  Localities;
    206           1.1  christos     UINT32                  i;
    207           1.1  christos     UINT32                  j;
    208           1.1  christos 
    209           1.1  christos 
    210           1.1  christos     /* Main table */
    211           1.1  christos 
    212           1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
    213           1.1  christos     if (ACPI_FAILURE (Status))
    214           1.1  christos     {
    215           1.1  christos         return;
    216           1.1  christos     }
    217           1.1  christos 
    218           1.1  christos     /* Display the Locality NxN Matrix */
    219           1.1  christos 
    220           1.1  christos     Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
    221           1.1  christos     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
    222           1.1  christos     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
    223           1.1  christos 
    224           1.1  christos     for (i = 0; i < Localities; i++)
    225           1.1  christos     {
    226           1.1  christos         /* Display one row of the matrix */
    227           1.1  christos 
    228           1.1  christos         AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
    229           1.1  christos         for  (j = 0; j < Localities; j++)
    230           1.1  christos         {
    231           1.1  christos             /* Check for beyond EOT */
    232           1.1  christos 
    233           1.1  christos             if (Offset >= Table->Length)
    234           1.1  christos             {
    235           1.1  christos                 AcpiOsPrintf (
    236           1.1  christos                     "\n**** Not enough room in table for all localities\n");
    237           1.1  christos                 return;
    238           1.1  christos             }
    239           1.1  christos 
    240           1.1  christos             AcpiOsPrintf ("%2.2X", Row[j]);
    241           1.1  christos             Offset++;
    242           1.1  christos 
    243           1.1  christos             /* Display up to 16 bytes per output row */
    244           1.1  christos 
    245           1.1  christos             if ((j+1) < Localities)
    246           1.1  christos             {
    247           1.1  christos                 AcpiOsPrintf (" ");
    248           1.1  christos 
    249           1.1  christos                 if (j && (((j+1) % 16) == 0))
    250           1.1  christos                 {
    251           1.1  christos                     AcpiOsPrintf ("\\\n"); /* With line continuation char */
    252           1.1  christos                     AcpiDmLineHeader (Offset, 0, NULL);
    253           1.1  christos                 }
    254           1.1  christos             }
    255           1.1  christos         }
    256           1.1  christos 
    257           1.1  christos         /* Point to next row */
    258           1.1  christos 
    259           1.1  christos         AcpiOsPrintf ("\n");
    260           1.1  christos         Row += Localities;
    261           1.1  christos     }
    262           1.1  christos }
    263           1.1  christos 
    264           1.1  christos 
    265           1.1  christos /*******************************************************************************
    266           1.1  christos  *
    267           1.1  christos  * FUNCTION:    AcpiDmDumpSrat
    268           1.1  christos  *
    269           1.1  christos  * PARAMETERS:  Table               - A SRAT table
    270           1.1  christos  *
    271           1.1  christos  * RETURN:      None
    272           1.1  christos  *
    273           1.1  christos  * DESCRIPTION: Format the contents of a SRAT
    274           1.1  christos  *
    275           1.1  christos  ******************************************************************************/
    276           1.1  christos 
    277           1.1  christos void
    278           1.1  christos AcpiDmDumpSrat (
    279           1.1  christos     ACPI_TABLE_HEADER       *Table)
    280           1.1  christos {
    281           1.1  christos     ACPI_STATUS             Status;
    282           1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
    283           1.1  christos     ACPI_SUBTABLE_HEADER    *Subtable;
    284           1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
    285           1.1  christos 
    286           1.1  christos 
    287           1.1  christos     /* Main table */
    288           1.1  christos 
    289           1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
    290           1.1  christos     if (ACPI_FAILURE (Status))
    291           1.1  christos     {
    292           1.1  christos         return;
    293           1.1  christos     }
    294           1.1  christos 
    295           1.1  christos     /* Subtables */
    296           1.1  christos 
    297           1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
    298           1.1  christos     while (Offset < Table->Length)
    299           1.1  christos     {
    300           1.1  christos         /* Common subtable header */
    301           1.1  christos 
    302           1.1  christos         AcpiOsPrintf ("\n");
    303           1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    304           1.1  christos             Subtable->Length, AcpiDmTableInfoSratHdr);
    305           1.1  christos         if (ACPI_FAILURE (Status))
    306           1.1  christos         {
    307           1.1  christos             return;
    308           1.1  christos         }
    309           1.1  christos 
    310           1.1  christos         switch (Subtable->Type)
    311           1.1  christos         {
    312           1.1  christos         case ACPI_SRAT_TYPE_CPU_AFFINITY:
    313           1.1  christos 
    314           1.1  christos             InfoTable = AcpiDmTableInfoSrat0;
    315           1.1  christos             break;
    316           1.1  christos 
    317           1.1  christos         case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
    318           1.1  christos 
    319           1.1  christos             InfoTable = AcpiDmTableInfoSrat1;
    320           1.1  christos             break;
    321           1.1  christos 
    322           1.1  christos         case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
    323           1.1  christos 
    324           1.1  christos             InfoTable = AcpiDmTableInfoSrat2;
    325           1.1  christos             break;
    326           1.1  christos 
    327           1.1  christos         case ACPI_SRAT_TYPE_GICC_AFFINITY:
    328           1.1  christos 
    329           1.1  christos             InfoTable = AcpiDmTableInfoSrat3;
    330           1.1  christos             break;
    331           1.1  christos 
    332           1.1  christos         case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:
    333           1.1  christos 
    334           1.1  christos             InfoTable = AcpiDmTableInfoSrat4;
    335           1.1  christos             break;
    336           1.1  christos 
    337       1.1.1.3  christos         case ACPI_SRAT_TYPE_GENERIC_AFFINITY:
    338       1.1.1.3  christos 
    339       1.1.1.3  christos             InfoTable = AcpiDmTableInfoSrat5;
    340       1.1.1.3  christos             break;
    341       1.1.1.3  christos 
    342       1.1.1.8  christos         case ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY:
    343       1.1.1.8  christos 
    344       1.1.1.8  christos             InfoTable = AcpiDmTableInfoSrat6;
    345       1.1.1.8  christos             break;
    346       1.1.1.8  christos 
    347  1.1.1.10.6.1  perseant         case ACPI_SRAT_TYPE_RINTC_AFFINITY:
    348  1.1.1.10.6.1  perseant 
    349  1.1.1.10.6.1  perseant             InfoTable = AcpiDmTableInfoSrat7;
    350  1.1.1.10.6.1  perseant             break;
    351  1.1.1.10.6.1  perseant 
    352           1.1  christos         default:
    353           1.1  christos             AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",
    354           1.1  christos                 Subtable->Type);
    355           1.1  christos 
    356           1.1  christos             /* Attempt to continue */
    357           1.1  christos 
    358           1.1  christos             if (!Subtable->Length)
    359           1.1  christos             {
    360           1.1  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
    361           1.1  christos                 return;
    362           1.1  christos             }
    363           1.1  christos             goto NextSubtable;
    364           1.1  christos         }
    365           1.1  christos 
    366           1.1  christos         AcpiOsPrintf ("\n");
    367           1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    368           1.1  christos             Subtable->Length, InfoTable);
    369           1.1  christos         if (ACPI_FAILURE (Status))
    370           1.1  christos         {
    371           1.1  christos             return;
    372           1.1  christos         }
    373           1.1  christos 
    374           1.1  christos NextSubtable:
    375           1.1  christos         /* Point to next subtable */
    376           1.1  christos 
    377           1.1  christos         Offset += Subtable->Length;
    378           1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable,
    379           1.1  christos             Subtable->Length);
    380           1.1  christos     }
    381           1.1  christos }
    382           1.1  christos 
    383           1.1  christos 
    384           1.1  christos /*******************************************************************************
    385           1.1  christos  *
    386           1.1  christos  * FUNCTION:    AcpiDmDumpStao
    387           1.1  christos  *
    388           1.1  christos  * PARAMETERS:  Table               - A STAO table
    389           1.1  christos  *
    390           1.1  christos  * RETURN:      None
    391           1.1  christos  *
    392           1.1  christos  * DESCRIPTION: Format the contents of a STAO. This is a variable-length
    393           1.1  christos  *              table that contains an open-ended number of ASCII strings
    394           1.1  christos  *              at the end of the table.
    395           1.1  christos  *
    396           1.1  christos  ******************************************************************************/
    397           1.1  christos 
    398           1.1  christos void
    399           1.1  christos AcpiDmDumpStao (
    400           1.1  christos     ACPI_TABLE_HEADER       *Table)
    401           1.1  christos {
    402           1.1  christos     ACPI_STATUS             Status;
    403           1.1  christos     char                    *Namepath;
    404           1.1  christos     UINT32                  Length = Table->Length;
    405           1.1  christos     UINT32                  StringLength;
    406           1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_STAO);
    407           1.1  christos 
    408           1.1  christos 
    409           1.1  christos     /* Main table */
    410           1.1  christos 
    411           1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);
    412           1.1  christos     if (ACPI_FAILURE (Status))
    413           1.1  christos     {
    414           1.1  christos         return;
    415           1.1  christos     }
    416           1.1  christos 
    417           1.1  christos     /* The rest of the table consists of Namepath strings */
    418           1.1  christos 
    419           1.1  christos     while (Offset < Table->Length)
    420           1.1  christos     {
    421           1.1  christos         Namepath = ACPI_ADD_PTR (char, Table, Offset);
    422           1.1  christos         StringLength = strlen (Namepath) + 1;
    423           1.1  christos 
    424       1.1.1.4  christos         AcpiDmLineHeader (Offset, StringLength, "Namepath");
    425           1.1  christos         AcpiOsPrintf ("\"%s\"\n", Namepath);
    426           1.1  christos 
    427           1.1  christos         /* Point to next namepath */
    428           1.1  christos 
    429           1.1  christos         Offset += StringLength;
    430           1.1  christos     }
    431           1.1  christos }
    432           1.1  christos 
    433           1.1  christos 
    434           1.1  christos /*******************************************************************************
    435           1.1  christos  *
    436       1.1.1.7  christos  * FUNCTION:    AcpiDmDumpSvkl
    437       1.1.1.7  christos  *
    438       1.1.1.7  christos  * PARAMETERS:  Table               - A SVKL table
    439       1.1.1.7  christos  *
    440       1.1.1.7  christos  * RETURN:      None
    441       1.1.1.7  christos  *
    442       1.1.1.7  christos  * DESCRIPTION: Format the contents of a SVKL. This is a variable-length
    443       1.1.1.7  christos  *              table that contains an open-ended number of key subtables at
    444       1.1.1.7  christos  *              the end of the header.
    445       1.1.1.7  christos  *
    446       1.1.1.7  christos  * NOTES: SVKL is essentially a flat table, with a small main table and
    447       1.1.1.7  christos  *          a variable number of a single type of subtable.
    448       1.1.1.7  christos  *
    449       1.1.1.7  christos  ******************************************************************************/
    450       1.1.1.7  christos 
    451       1.1.1.7  christos void
    452       1.1.1.7  christos AcpiDmDumpSvkl (
    453       1.1.1.7  christos     ACPI_TABLE_HEADER       *Table)
    454       1.1.1.7  christos {
    455       1.1.1.7  christos     ACPI_STATUS             Status;
    456       1.1.1.7  christos     UINT32                  Length = Table->Length;
    457       1.1.1.7  christos     UINT32                  Offset = sizeof (ACPI_TABLE_SVKL);
    458       1.1.1.7  christos     ACPI_SVKL_KEY           *Subtable;
    459       1.1.1.7  christos 
    460       1.1.1.7  christos 
    461       1.1.1.7  christos     /* Main table */
    462       1.1.1.7  christos 
    463       1.1.1.7  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSvkl);
    464       1.1.1.7  christos     if (ACPI_FAILURE (Status))
    465       1.1.1.7  christos     {
    466       1.1.1.7  christos         return;
    467       1.1.1.7  christos     }
    468       1.1.1.7  christos 
    469       1.1.1.7  christos     /* The rest of the table consists of subtables (single type) */
    470       1.1.1.7  christos 
    471       1.1.1.7  christos     Subtable = ACPI_ADD_PTR (ACPI_SVKL_KEY, Table, Offset);
    472       1.1.1.7  christos     while (Offset < Table->Length)
    473       1.1.1.7  christos     {
    474       1.1.1.7  christos         /* Dump the subtable */
    475       1.1.1.7  christos 
    476       1.1.1.7  christos         AcpiOsPrintf ("\n");
    477       1.1.1.7  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    478       1.1.1.7  christos             sizeof (ACPI_SVKL_KEY), AcpiDmTableInfoSvkl0);
    479       1.1.1.7  christos         if (ACPI_FAILURE (Status))
    480       1.1.1.7  christos         {
    481       1.1.1.7  christos             return;
    482       1.1.1.7  christos         }
    483       1.1.1.7  christos 
    484       1.1.1.7  christos         /* Point to next subtable */
    485       1.1.1.7  christos 
    486       1.1.1.7  christos         Offset += sizeof (ACPI_SVKL_KEY);
    487       1.1.1.7  christos         Subtable = ACPI_ADD_PTR (ACPI_SVKL_KEY, Subtable,
    488       1.1.1.7  christos             sizeof (ACPI_SVKL_KEY));
    489       1.1.1.7  christos     }
    490       1.1.1.7  christos }
    491       1.1.1.7  christos 
    492       1.1.1.7  christos 
    493       1.1.1.7  christos /*******************************************************************************
    494       1.1.1.7  christos  *
    495           1.1  christos  * FUNCTION:    AcpiDmDumpTcpa
    496           1.1  christos  *
    497           1.1  christos  * PARAMETERS:  Table               - A TCPA table
    498           1.1  christos  *
    499           1.1  christos  * RETURN:      None
    500           1.1  christos  *
    501           1.1  christos  * DESCRIPTION: Format the contents of a TCPA.
    502           1.1  christos  *
    503           1.1  christos  * NOTE:        There are two versions of the table with the same signature:
    504           1.1  christos  *              the client version and the server version. The common
    505           1.1  christos  *              PlatformClass field is used to differentiate the two types of
    506           1.1  christos  *              tables.
    507           1.1  christos  *
    508           1.1  christos  ******************************************************************************/
    509           1.1  christos 
    510           1.1  christos void
    511           1.1  christos AcpiDmDumpTcpa (
    512           1.1  christos     ACPI_TABLE_HEADER       *Table)
    513           1.1  christos {
    514           1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TCPA_HDR);
    515           1.1  christos     ACPI_TABLE_TCPA_HDR     *CommonHeader = ACPI_CAST_PTR (
    516           1.1  christos                                 ACPI_TABLE_TCPA_HDR, Table);
    517           1.1  christos     ACPI_TABLE_TCPA_HDR     *Subtable = ACPI_ADD_PTR (
    518           1.1  christos                                 ACPI_TABLE_TCPA_HDR, Table, Offset);
    519           1.1  christos     ACPI_STATUS             Status;
    520           1.1  christos 
    521           1.1  christos 
    522           1.1  christos     /* Main table */
    523           1.1  christos 
    524           1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table,
    525           1.1  christos         0, AcpiDmTableInfoTcpaHdr);
    526           1.1  christos     if (ACPI_FAILURE (Status))
    527           1.1  christos     {
    528           1.1  christos         return;
    529           1.1  christos     }
    530           1.1  christos 
    531           1.1  christos     /*
    532           1.1  christos      * Examine the PlatformClass field to determine the table type.
    533           1.1  christos      * Either a client or server table. Only one.
    534           1.1  christos      */
    535           1.1  christos     switch (CommonHeader->PlatformClass)
    536           1.1  christos     {
    537           1.1  christos     case ACPI_TCPA_CLIENT_TABLE:
    538           1.1  christos 
    539           1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    540           1.1  christos             Table->Length - Offset, AcpiDmTableInfoTcpaClient);
    541           1.1  christos         break;
    542           1.1  christos 
    543           1.1  christos     case ACPI_TCPA_SERVER_TABLE:
    544           1.1  christos 
    545           1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    546           1.1  christos             Table->Length - Offset, AcpiDmTableInfoTcpaServer);
    547           1.1  christos         break;
    548           1.1  christos 
    549           1.1  christos     default:
    550           1.1  christos 
    551           1.1  christos         AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
    552           1.1  christos             CommonHeader->PlatformClass);
    553           1.1  christos         Status = AE_ERROR;
    554           1.1  christos         break;
    555           1.1  christos     }
    556           1.1  christos 
    557           1.1  christos     if (ACPI_FAILURE (Status))
    558           1.1  christos     {
    559           1.1  christos         AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");
    560           1.1  christos     }
    561           1.1  christos }
    562           1.1  christos 
    563           1.1  christos 
    564           1.1  christos /*******************************************************************************
    565           1.1  christos  *
    566           1.1  christos  * FUNCTION:    AcpiDmDumpTpm2
    567           1.1  christos  *
    568           1.1  christos  * PARAMETERS:  Table               - A TPM2 table
    569           1.1  christos  *
    570           1.1  christos  * RETURN:      None
    571           1.1  christos  *
    572           1.1  christos  * DESCRIPTION: Format the contents of a TPM2.
    573           1.1  christos  *
    574           1.1  christos  ******************************************************************************/
    575       1.1.1.7  christos 
    576       1.1.1.2  christos static void
    577       1.1.1.2  christos AcpiDmDumpTpm2Rev3 (
    578       1.1.1.2  christos     ACPI_TABLE_HEADER       *Table)
    579       1.1.1.2  christos {
    580       1.1.1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TPM23);
    581       1.1.1.2  christos     ACPI_TABLE_TPM23        *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table);
    582       1.1.1.2  christos     ACPI_TPM23_TRAILER      *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset);
    583       1.1.1.2  christos     ACPI_STATUS             Status;
    584       1.1.1.2  christos 
    585       1.1.1.2  christos 
    586       1.1.1.2  christos     /* Main table */
    587       1.1.1.2  christos 
    588       1.1.1.2  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23);
    589       1.1.1.2  christos     if (ACPI_FAILURE (Status))
    590       1.1.1.2  christos     {
    591       1.1.1.2  christos         return;
    592       1.1.1.2  christos     }
    593       1.1.1.2  christos 
    594       1.1.1.2  christos     /* Optional subtable if start method is ACPI start method */
    595       1.1.1.2  christos 
    596       1.1.1.2  christos     switch (CommonHeader->StartMethod)
    597       1.1.1.2  christos     {
    598       1.1.1.2  christos     case ACPI_TPM23_ACPI_START_METHOD:
    599       1.1.1.2  christos 
    600       1.1.1.4  christos         (void) AcpiDmDumpTable (Table->Length, Offset, Subtable,
    601       1.1.1.2  christos             Table->Length - Offset, AcpiDmTableInfoTpm23a);
    602       1.1.1.2  christos         break;
    603       1.1.1.2  christos 
    604       1.1.1.2  christos     default:
    605       1.1.1.2  christos         break;
    606       1.1.1.2  christos     }
    607       1.1.1.2  christos }
    608       1.1.1.2  christos 
    609       1.1.1.2  christos 
    610       1.1.1.2  christos /*******************************************************************************
    611       1.1.1.2  christos  *
    612       1.1.1.2  christos  * FUNCTION:    AcpiDmDumpTpm2
    613       1.1.1.2  christos  *
    614       1.1.1.2  christos  * PARAMETERS:  Table               - A TPM2 table
    615       1.1.1.2  christos  *
    616       1.1.1.2  christos  * RETURN:      None
    617       1.1.1.2  christos  *
    618       1.1.1.2  christos  * DESCRIPTION: Format the contents of a TPM2.
    619       1.1.1.2  christos  *
    620       1.1.1.2  christos  ******************************************************************************/
    621           1.1  christos 
    622           1.1  christos void
    623           1.1  christos AcpiDmDumpTpm2 (
    624           1.1  christos     ACPI_TABLE_HEADER       *Table)
    625           1.1  christos {
    626           1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TPM2);
    627           1.1  christos     ACPI_TABLE_TPM2         *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM2, Table);
    628           1.1  christos     ACPI_TPM2_TRAILER       *Subtable = ACPI_ADD_PTR (ACPI_TPM2_TRAILER, Table, Offset);
    629           1.1  christos     ACPI_TPM2_ARM_SMC       *ArmSubtable;
    630           1.1  christos     ACPI_STATUS             Status;
    631           1.1  christos 
    632           1.1  christos 
    633       1.1.1.2  christos     if (Table->Revision == 3)
    634       1.1.1.2  christos     {
    635       1.1.1.2  christos         AcpiDmDumpTpm2Rev3(Table);
    636       1.1.1.2  christos         return;
    637       1.1.1.2  christos     }
    638       1.1.1.2  christos 
    639           1.1  christos     /* Main table */
    640           1.1  christos 
    641           1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2);
    642       1.1.1.2  christos 
    643           1.1  christos     if (ACPI_FAILURE (Status))
    644           1.1  christos     {
    645           1.1  christos         return;
    646           1.1  christos     }
    647           1.1  christos 
    648           1.1  christos     AcpiOsPrintf ("\n");
    649           1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    650           1.1  christos         Table->Length - Offset, AcpiDmTableInfoTpm2a);
    651           1.1  christos     if (ACPI_FAILURE (Status))
    652           1.1  christos     {
    653           1.1  christos         return;
    654           1.1  christos     }
    655           1.1  christos 
    656           1.1  christos     switch (CommonHeader->StartMethod)
    657           1.1  christos     {
    658           1.1  christos     case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
    659           1.1  christos 
    660           1.1  christos         ArmSubtable = ACPI_ADD_PTR (ACPI_TPM2_ARM_SMC, Subtable,
    661           1.1  christos             sizeof (ACPI_TPM2_TRAILER));
    662           1.1  christos         Offset += sizeof (ACPI_TPM2_TRAILER);
    663           1.1  christos 
    664           1.1  christos         AcpiOsPrintf ("\n");
    665       1.1.1.4  christos         (void) AcpiDmDumpTable (Table->Length, Offset, ArmSubtable,
    666           1.1  christos             Table->Length - Offset, AcpiDmTableInfoTpm211);
    667           1.1  christos         break;
    668           1.1  christos 
    669           1.1  christos     default:
    670           1.1  christos         break;
    671           1.1  christos     }
    672           1.1  christos }
    673           1.1  christos 
    674           1.1  christos 
    675           1.1  christos /*******************************************************************************
    676           1.1  christos  *
    677       1.1.1.6  christos  * FUNCTION:    AcpiDmDumpViot
    678           1.1  christos  *
    679       1.1.1.6  christos  * PARAMETERS:  Table               - A VIOT table
    680           1.1  christos  *
    681           1.1  christos  * RETURN:      None
    682           1.1  christos  *
    683       1.1.1.6  christos  * DESCRIPTION: Format the contents of a VIOT
    684           1.1  christos  *
    685           1.1  christos  ******************************************************************************/
    686           1.1  christos 
    687           1.1  christos void
    688       1.1.1.6  christos AcpiDmDumpViot (
    689           1.1  christos     ACPI_TABLE_HEADER       *Table)
    690           1.1  christos {
    691           1.1  christos     ACPI_STATUS             Status;
    692       1.1.1.6  christos     ACPI_TABLE_VIOT         *Viot;
    693       1.1.1.6  christos     ACPI_VIOT_HEADER        *ViotHeader;
    694       1.1.1.6  christos     UINT16                  Length;
    695       1.1.1.8  christos     UINT32                  Offset;
    696       1.1.1.6  christos     ACPI_DMTABLE_INFO       *InfoTable;
    697           1.1  christos 
    698           1.1  christos     /* Main table */
    699           1.1  christos 
    700       1.1.1.6  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoViot);
    701           1.1  christos     if (ACPI_FAILURE (Status))
    702           1.1  christos     {
    703           1.1  christos         return;
    704           1.1  christos     }
    705           1.1  christos 
    706       1.1.1.6  christos     Viot = ACPI_CAST_PTR (ACPI_TABLE_VIOT, Table);
    707           1.1  christos 
    708       1.1.1.6  christos     Offset = Viot->NodeOffset;
    709           1.1  christos     while (Offset < Table->Length)
    710           1.1  christos     {
    711           1.1  christos         /* Common subtable header */
    712       1.1.1.6  christos         ViotHeader = ACPI_ADD_PTR (ACPI_VIOT_HEADER, Table, Offset);
    713           1.1  christos         AcpiOsPrintf ("\n");
    714       1.1.1.6  christos 
    715       1.1.1.6  christos         Length = sizeof (ACPI_VIOT_HEADER);
    716       1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, ViotHeader, Length,
    717       1.1.1.6  christos             AcpiDmTableInfoViotHeader);
    718           1.1  christos         if (ACPI_FAILURE (Status))
    719           1.1  christos         {
    720           1.1  christos             return;
    721           1.1  christos         }
    722           1.1  christos 
    723       1.1.1.6  christos         Length = ViotHeader->Length;
    724       1.1.1.6  christos         switch (ViotHeader->Type)
    725       1.1.1.6  christos         {
    726       1.1.1.6  christos         case ACPI_VIOT_NODE_PCI_RANGE:
    727       1.1.1.6  christos 
    728       1.1.1.6  christos             InfoTable = AcpiDmTableInfoViot1;
    729       1.1.1.6  christos             break;
    730       1.1.1.6  christos 
    731       1.1.1.6  christos         case ACPI_VIOT_NODE_MMIO:
    732       1.1.1.6  christos 
    733       1.1.1.6  christos             InfoTable = AcpiDmTableInfoViot2;
    734       1.1.1.6  christos             break;
    735       1.1.1.6  christos 
    736       1.1.1.6  christos         case ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI:
    737       1.1.1.6  christos 
    738       1.1.1.6  christos             InfoTable = AcpiDmTableInfoViot3;
    739       1.1.1.6  christos             break;
    740       1.1.1.6  christos 
    741       1.1.1.6  christos         case ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO:
    742       1.1.1.6  christos 
    743       1.1.1.6  christos             InfoTable = AcpiDmTableInfoViot4;
    744       1.1.1.6  christos             break;
    745           1.1  christos 
    746       1.1.1.6  christos         default:
    747       1.1.1.6  christos 
    748       1.1.1.6  christos             AcpiOsPrintf ("\n*** Unknown VIOT node type 0x%X\n",
    749       1.1.1.6  christos                 ViotHeader->Type);
    750       1.1.1.6  christos 
    751       1.1.1.6  christos             /* Attempt to continue */
    752       1.1.1.6  christos 
    753       1.1.1.6  christos             if (!Length)
    754       1.1.1.6  christos             {
    755       1.1.1.6  christos                 AcpiOsPrintf ("Invalid zero length VIOT node\n");
    756       1.1.1.6  christos                 return;
    757       1.1.1.6  christos             }
    758       1.1.1.6  christos             goto NextSubtable;
    759       1.1.1.6  christos         }
    760       1.1.1.6  christos 
    761       1.1.1.6  christos         AcpiOsPrintf ("\n");
    762       1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, ViotHeader, Length,
    763       1.1.1.6  christos             InfoTable);
    764       1.1.1.6  christos         if (ACPI_FAILURE (Status))
    765       1.1.1.6  christos         {
    766       1.1.1.6  christos             return;
    767       1.1.1.6  christos         }
    768       1.1.1.6  christos 
    769       1.1.1.6  christos NextSubtable:
    770       1.1.1.6  christos         Offset += Length;
    771           1.1  christos     }
    772           1.1  christos }
    773           1.1  christos 
    774           1.1  christos 
    775           1.1  christos /*******************************************************************************
    776           1.1  christos  *
    777           1.1  christos  * FUNCTION:    AcpiDmDumpWdat
    778           1.1  christos  *
    779           1.1  christos  * PARAMETERS:  Table               - A WDAT table
    780           1.1  christos  *
    781           1.1  christos  * RETURN:      None
    782           1.1  christos  *
    783           1.1  christos  * DESCRIPTION: Format the contents of a WDAT
    784           1.1  christos  *
    785           1.1  christos  ******************************************************************************/
    786           1.1  christos 
    787           1.1  christos void
    788           1.1  christos AcpiDmDumpWdat (
    789           1.1  christos     ACPI_TABLE_HEADER       *Table)
    790           1.1  christos {
    791           1.1  christos     ACPI_STATUS             Status;
    792           1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_WDAT);
    793           1.1  christos     ACPI_WDAT_ENTRY         *Subtable;
    794           1.1  christos 
    795           1.1  christos 
    796           1.1  christos     /* Main table */
    797           1.1  christos 
    798           1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
    799           1.1  christos     if (ACPI_FAILURE (Status))
    800           1.1  christos     {
    801           1.1  christos         return;
    802           1.1  christos     }
    803           1.1  christos 
    804           1.1  christos     /* Subtables */
    805           1.1  christos 
    806           1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
    807           1.1  christos     while (Offset < Table->Length)
    808           1.1  christos     {
    809           1.1  christos         /* Common subtable header */
    810           1.1  christos 
    811           1.1  christos         AcpiOsPrintf ("\n");
    812           1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    813           1.1  christos             sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
    814           1.1  christos         if (ACPI_FAILURE (Status))
    815           1.1  christos         {
    816           1.1  christos             return;
    817           1.1  christos         }
    818           1.1  christos 
    819           1.1  christos         /* Point to next subtable */
    820           1.1  christos 
    821           1.1  christos         Offset += sizeof (ACPI_WDAT_ENTRY);
    822           1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Subtable,
    823           1.1  christos             sizeof (ACPI_WDAT_ENTRY));
    824           1.1  christos     }
    825           1.1  christos }
    826           1.1  christos 
    827           1.1  christos 
    828           1.1  christos /*******************************************************************************
    829           1.1  christos  *
    830           1.1  christos  * FUNCTION:    AcpiDmDumpWpbt
    831           1.1  christos  *
    832           1.1  christos  * PARAMETERS:  Table               - A WPBT table
    833           1.1  christos  *
    834           1.1  christos  * RETURN:      None
    835           1.1  christos  *
    836           1.1  christos  * DESCRIPTION: Format the contents of a WPBT. This table type consists
    837           1.1  christos  *              of an open-ended arguments buffer at the end of the table.
    838           1.1  christos  *
    839           1.1  christos  ******************************************************************************/
    840           1.1  christos 
    841           1.1  christos void
    842           1.1  christos AcpiDmDumpWpbt (
    843           1.1  christos     ACPI_TABLE_HEADER       *Table)
    844           1.1  christos {
    845           1.1  christos     ACPI_STATUS             Status;
    846           1.1  christos     ACPI_TABLE_WPBT         *Subtable;
    847           1.1  christos     UINT16                  ArgumentsLength;
    848           1.1  christos 
    849           1.1  christos 
    850           1.1  christos     /* Dump the main table */
    851           1.1  christos 
    852       1.1.1.8  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWpbt);
    853           1.1  christos     if (ACPI_FAILURE (Status))
    854           1.1  christos     {
    855           1.1  christos         return;
    856           1.1  christos     }
    857           1.1  christos 
    858           1.1  christos     /* Extract the arguments buffer length from the main table */
    859           1.1  christos 
    860           1.1  christos     Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
    861           1.1  christos     ArgumentsLength = Subtable->ArgumentsLength;
    862           1.1  christos 
    863       1.1.1.8  christos     /* Dump the arguments buffer if present */
    864           1.1  christos 
    865       1.1.1.8  christos     if (ArgumentsLength)
    866       1.1.1.8  christos     {
    867       1.1.1.8  christos         (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
    868       1.1.1.8  christos             AcpiDmTableInfoWpbt0);
    869       1.1.1.8  christos     }
    870           1.1  christos }
    871