Home | History | Annotate | Line # | Download | only in common
dmtbdump3.c revision 1.1.1.2
      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  christos /*
      8      1.1  christos  * Copyright (C) 2000 - 2018, Intel Corp.
      9      1.1  christos  * All rights reserved.
     10      1.1  christos  *
     11      1.1  christos  * Redistribution and use in source and binary forms, with or without
     12      1.1  christos  * modification, are permitted provided that the following conditions
     13      1.1  christos  * are met:
     14      1.1  christos  * 1. Redistributions of source code must retain the above copyright
     15      1.1  christos  *    notice, this list of conditions, and the following disclaimer,
     16      1.1  christos  *    without modification.
     17      1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18      1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     19      1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     20      1.1  christos  *    including a substantially similar Disclaimer requirement for further
     21      1.1  christos  *    binary redistribution.
     22      1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     23      1.1  christos  *    of any contributors may be used to endorse or promote products derived
     24      1.1  christos  *    from this software without specific prior written permission.
     25      1.1  christos  *
     26      1.1  christos  * Alternatively, this software may be distributed under the terms of the
     27      1.1  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     28      1.1  christos  * Software Foundation.
     29      1.1  christos  *
     30      1.1  christos  * NO WARRANTY
     31      1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32      1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33      1.1  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34      1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35      1.1  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36      1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37      1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38      1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39      1.1  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40      1.1  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41      1.1  christos  * POSSIBILITY OF SUCH DAMAGES.
     42      1.1  christos  */
     43      1.1  christos 
     44      1.1  christos #include "acpi.h"
     45      1.1  christos #include "accommon.h"
     46      1.1  christos #include "acdisasm.h"
     47      1.1  christos #include "actables.h"
     48      1.1  christos 
     49      1.1  christos /* This module used for application-level code only */
     50      1.1  christos 
     51      1.1  christos #define _COMPONENT          ACPI_CA_DISASSEMBLER
     52      1.1  christos         ACPI_MODULE_NAME    ("dmtbdump3")
     53      1.1  christos 
     54      1.1  christos 
     55      1.1  christos /*******************************************************************************
     56      1.1  christos  *
     57      1.1  christos  * FUNCTION:    AcpiDmDumpSlic
     58      1.1  christos  *
     59      1.1  christos  * PARAMETERS:  Table               - A SLIC table
     60      1.1  christos  *
     61      1.1  christos  * RETURN:      None
     62      1.1  christos  *
     63      1.1  christos  * DESCRIPTION: Format the contents of a SLIC
     64      1.1  christos  *
     65      1.1  christos  ******************************************************************************/
     66      1.1  christos 
     67      1.1  christos void
     68      1.1  christos AcpiDmDumpSlic (
     69      1.1  christos     ACPI_TABLE_HEADER       *Table)
     70      1.1  christos {
     71      1.1  christos 
     72      1.1  christos     (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
     73      1.1  christos         Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
     74      1.1  christos }
     75      1.1  christos 
     76      1.1  christos 
     77      1.1  christos /*******************************************************************************
     78      1.1  christos  *
     79      1.1  christos  * FUNCTION:    AcpiDmDumpSlit
     80      1.1  christos  *
     81      1.1  christos  * PARAMETERS:  Table               - An SLIT
     82      1.1  christos  *
     83      1.1  christos  * RETURN:      None
     84      1.1  christos  *
     85      1.1  christos  * DESCRIPTION: Format the contents of a SLIT
     86      1.1  christos  *
     87      1.1  christos  ******************************************************************************/
     88      1.1  christos 
     89      1.1  christos void
     90      1.1  christos AcpiDmDumpSlit (
     91      1.1  christos     ACPI_TABLE_HEADER       *Table)
     92      1.1  christos {
     93      1.1  christos     ACPI_STATUS             Status;
     94      1.1  christos     UINT32                  Offset;
     95      1.1  christos     UINT8                   *Row;
     96      1.1  christos     UINT32                  Localities;
     97      1.1  christos     UINT32                  i;
     98      1.1  christos     UINT32                  j;
     99      1.1  christos 
    100      1.1  christos 
    101      1.1  christos     /* Main table */
    102      1.1  christos 
    103      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
    104      1.1  christos     if (ACPI_FAILURE (Status))
    105      1.1  christos     {
    106      1.1  christos         return;
    107      1.1  christos     }
    108      1.1  christos 
    109      1.1  christos     /* Display the Locality NxN Matrix */
    110      1.1  christos 
    111      1.1  christos     Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
    112      1.1  christos     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
    113      1.1  christos     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
    114      1.1  christos 
    115      1.1  christos     for (i = 0; i < Localities; i++)
    116      1.1  christos     {
    117      1.1  christos         /* Display one row of the matrix */
    118      1.1  christos 
    119      1.1  christos         AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
    120      1.1  christos         for  (j = 0; j < Localities; j++)
    121      1.1  christos         {
    122      1.1  christos             /* Check for beyond EOT */
    123      1.1  christos 
    124      1.1  christos             if (Offset >= Table->Length)
    125      1.1  christos             {
    126      1.1  christos                 AcpiOsPrintf (
    127      1.1  christos                     "\n**** Not enough room in table for all localities\n");
    128      1.1  christos                 return;
    129      1.1  christos             }
    130      1.1  christos 
    131      1.1  christos             AcpiOsPrintf ("%2.2X", Row[j]);
    132      1.1  christos             Offset++;
    133      1.1  christos 
    134      1.1  christos             /* Display up to 16 bytes per output row */
    135      1.1  christos 
    136      1.1  christos             if ((j+1) < Localities)
    137      1.1  christos             {
    138      1.1  christos                 AcpiOsPrintf (" ");
    139      1.1  christos 
    140      1.1  christos                 if (j && (((j+1) % 16) == 0))
    141      1.1  christos                 {
    142      1.1  christos                     AcpiOsPrintf ("\\\n"); /* With line continuation char */
    143      1.1  christos                     AcpiDmLineHeader (Offset, 0, NULL);
    144      1.1  christos                 }
    145      1.1  christos             }
    146      1.1  christos         }
    147      1.1  christos 
    148      1.1  christos         /* Point to next row */
    149      1.1  christos 
    150      1.1  christos         AcpiOsPrintf ("\n");
    151      1.1  christos         Row += Localities;
    152      1.1  christos     }
    153      1.1  christos }
    154      1.1  christos 
    155      1.1  christos 
    156      1.1  christos /*******************************************************************************
    157      1.1  christos  *
    158      1.1  christos  * FUNCTION:    AcpiDmDumpSrat
    159      1.1  christos  *
    160      1.1  christos  * PARAMETERS:  Table               - A SRAT table
    161      1.1  christos  *
    162      1.1  christos  * RETURN:      None
    163      1.1  christos  *
    164      1.1  christos  * DESCRIPTION: Format the contents of a SRAT
    165      1.1  christos  *
    166      1.1  christos  ******************************************************************************/
    167      1.1  christos 
    168      1.1  christos void
    169      1.1  christos AcpiDmDumpSrat (
    170      1.1  christos     ACPI_TABLE_HEADER       *Table)
    171      1.1  christos {
    172      1.1  christos     ACPI_STATUS             Status;
    173      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
    174      1.1  christos     ACPI_SUBTABLE_HEADER    *Subtable;
    175      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
    176      1.1  christos 
    177      1.1  christos 
    178      1.1  christos     /* Main table */
    179      1.1  christos 
    180      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
    181      1.1  christos     if (ACPI_FAILURE (Status))
    182      1.1  christos     {
    183      1.1  christos         return;
    184      1.1  christos     }
    185      1.1  christos 
    186      1.1  christos     /* Subtables */
    187      1.1  christos 
    188      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
    189      1.1  christos     while (Offset < Table->Length)
    190      1.1  christos     {
    191      1.1  christos         /* Common subtable header */
    192      1.1  christos 
    193      1.1  christos         AcpiOsPrintf ("\n");
    194      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    195      1.1  christos             Subtable->Length, AcpiDmTableInfoSratHdr);
    196      1.1  christos         if (ACPI_FAILURE (Status))
    197      1.1  christos         {
    198      1.1  christos             return;
    199      1.1  christos         }
    200      1.1  christos 
    201      1.1  christos         switch (Subtable->Type)
    202      1.1  christos         {
    203      1.1  christos         case ACPI_SRAT_TYPE_CPU_AFFINITY:
    204      1.1  christos 
    205      1.1  christos             InfoTable = AcpiDmTableInfoSrat0;
    206      1.1  christos             break;
    207      1.1  christos 
    208      1.1  christos         case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
    209      1.1  christos 
    210      1.1  christos             InfoTable = AcpiDmTableInfoSrat1;
    211      1.1  christos             break;
    212      1.1  christos 
    213      1.1  christos         case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
    214      1.1  christos 
    215      1.1  christos             InfoTable = AcpiDmTableInfoSrat2;
    216      1.1  christos             break;
    217      1.1  christos 
    218      1.1  christos         case ACPI_SRAT_TYPE_GICC_AFFINITY:
    219      1.1  christos 
    220      1.1  christos             InfoTable = AcpiDmTableInfoSrat3;
    221      1.1  christos             break;
    222      1.1  christos 
    223      1.1  christos         case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:
    224      1.1  christos 
    225      1.1  christos             InfoTable = AcpiDmTableInfoSrat4;
    226      1.1  christos             break;
    227      1.1  christos 
    228      1.1  christos         default:
    229      1.1  christos             AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",
    230      1.1  christos                 Subtable->Type);
    231      1.1  christos 
    232      1.1  christos             /* Attempt to continue */
    233      1.1  christos 
    234      1.1  christos             if (!Subtable->Length)
    235      1.1  christos             {
    236      1.1  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
    237      1.1  christos                 return;
    238      1.1  christos             }
    239      1.1  christos             goto NextSubtable;
    240      1.1  christos         }
    241      1.1  christos 
    242      1.1  christos         AcpiOsPrintf ("\n");
    243      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    244      1.1  christos             Subtable->Length, InfoTable);
    245      1.1  christos         if (ACPI_FAILURE (Status))
    246      1.1  christos         {
    247      1.1  christos             return;
    248      1.1  christos         }
    249      1.1  christos 
    250      1.1  christos NextSubtable:
    251      1.1  christos         /* Point to next subtable */
    252      1.1  christos 
    253      1.1  christos         Offset += Subtable->Length;
    254      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable,
    255      1.1  christos             Subtable->Length);
    256      1.1  christos     }
    257      1.1  christos }
    258      1.1  christos 
    259      1.1  christos 
    260      1.1  christos /*******************************************************************************
    261      1.1  christos  *
    262      1.1  christos  * FUNCTION:    AcpiDmDumpStao
    263      1.1  christos  *
    264      1.1  christos  * PARAMETERS:  Table               - A STAO table
    265      1.1  christos  *
    266      1.1  christos  * RETURN:      None
    267      1.1  christos  *
    268      1.1  christos  * DESCRIPTION: Format the contents of a STAO. This is a variable-length
    269      1.1  christos  *              table that contains an open-ended number of ASCII strings
    270      1.1  christos  *              at the end of the table.
    271      1.1  christos  *
    272      1.1  christos  ******************************************************************************/
    273      1.1  christos 
    274      1.1  christos void
    275      1.1  christos AcpiDmDumpStao (
    276      1.1  christos     ACPI_TABLE_HEADER       *Table)
    277      1.1  christos {
    278      1.1  christos     ACPI_STATUS             Status;
    279      1.1  christos     char                    *Namepath;
    280      1.1  christos     UINT32                  Length = Table->Length;
    281      1.1  christos     UINT32                  StringLength;
    282      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_STAO);
    283      1.1  christos 
    284      1.1  christos 
    285      1.1  christos     /* Main table */
    286      1.1  christos 
    287      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);
    288      1.1  christos     if (ACPI_FAILURE (Status))
    289      1.1  christos     {
    290      1.1  christos         return;
    291      1.1  christos     }
    292      1.1  christos 
    293      1.1  christos     /* The rest of the table consists of Namepath strings */
    294      1.1  christos 
    295      1.1  christos     while (Offset < Table->Length)
    296      1.1  christos     {
    297      1.1  christos         Namepath = ACPI_ADD_PTR (char, Table, Offset);
    298      1.1  christos         StringLength = strlen (Namepath) + 1;
    299      1.1  christos 
    300      1.1  christos         AcpiDmLineHeader (Offset, StringLength, "Namestring");
    301      1.1  christos         AcpiOsPrintf ("\"%s\"\n", Namepath);
    302      1.1  christos 
    303      1.1  christos         /* Point to next namepath */
    304      1.1  christos 
    305      1.1  christos         Offset += StringLength;
    306      1.1  christos     }
    307      1.1  christos }
    308      1.1  christos 
    309      1.1  christos 
    310      1.1  christos /*******************************************************************************
    311      1.1  christos  *
    312      1.1  christos  * FUNCTION:    AcpiDmDumpTcpa
    313      1.1  christos  *
    314      1.1  christos  * PARAMETERS:  Table               - A TCPA table
    315      1.1  christos  *
    316      1.1  christos  * RETURN:      None
    317      1.1  christos  *
    318      1.1  christos  * DESCRIPTION: Format the contents of a TCPA.
    319      1.1  christos  *
    320      1.1  christos  * NOTE:        There are two versions of the table with the same signature:
    321      1.1  christos  *              the client version and the server version. The common
    322      1.1  christos  *              PlatformClass field is used to differentiate the two types of
    323      1.1  christos  *              tables.
    324      1.1  christos  *
    325      1.1  christos  ******************************************************************************/
    326      1.1  christos 
    327      1.1  christos void
    328      1.1  christos AcpiDmDumpTcpa (
    329      1.1  christos     ACPI_TABLE_HEADER       *Table)
    330      1.1  christos {
    331      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TCPA_HDR);
    332      1.1  christos     ACPI_TABLE_TCPA_HDR     *CommonHeader = ACPI_CAST_PTR (
    333      1.1  christos                                 ACPI_TABLE_TCPA_HDR, Table);
    334      1.1  christos     ACPI_TABLE_TCPA_HDR     *Subtable = ACPI_ADD_PTR (
    335      1.1  christos                                 ACPI_TABLE_TCPA_HDR, Table, Offset);
    336      1.1  christos     ACPI_STATUS             Status;
    337      1.1  christos 
    338      1.1  christos 
    339      1.1  christos     /* Main table */
    340      1.1  christos 
    341      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table,
    342      1.1  christos         0, AcpiDmTableInfoTcpaHdr);
    343      1.1  christos     if (ACPI_FAILURE (Status))
    344      1.1  christos     {
    345      1.1  christos         return;
    346      1.1  christos     }
    347      1.1  christos 
    348      1.1  christos     /*
    349      1.1  christos      * Examine the PlatformClass field to determine the table type.
    350      1.1  christos      * Either a client or server table. Only one.
    351      1.1  christos      */
    352      1.1  christos     switch (CommonHeader->PlatformClass)
    353      1.1  christos     {
    354      1.1  christos     case ACPI_TCPA_CLIENT_TABLE:
    355      1.1  christos 
    356      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    357      1.1  christos             Table->Length - Offset, AcpiDmTableInfoTcpaClient);
    358      1.1  christos         break;
    359      1.1  christos 
    360      1.1  christos     case ACPI_TCPA_SERVER_TABLE:
    361      1.1  christos 
    362      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    363      1.1  christos             Table->Length - Offset, AcpiDmTableInfoTcpaServer);
    364      1.1  christos         break;
    365      1.1  christos 
    366      1.1  christos     default:
    367      1.1  christos 
    368      1.1  christos         AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
    369      1.1  christos             CommonHeader->PlatformClass);
    370      1.1  christos         Status = AE_ERROR;
    371      1.1  christos         break;
    372      1.1  christos     }
    373      1.1  christos 
    374      1.1  christos     if (ACPI_FAILURE (Status))
    375      1.1  christos     {
    376      1.1  christos         AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");
    377      1.1  christos     }
    378      1.1  christos }
    379      1.1  christos 
    380      1.1  christos 
    381      1.1  christos /*******************************************************************************
    382      1.1  christos  *
    383      1.1  christos  * FUNCTION:    AcpiDmDumpTpm2
    384      1.1  christos  *
    385      1.1  christos  * PARAMETERS:  Table               - A TPM2 table
    386      1.1  christos  *
    387      1.1  christos  * RETURN:      None
    388      1.1  christos  *
    389      1.1  christos  * DESCRIPTION: Format the contents of a TPM2.
    390      1.1  christos  *
    391      1.1  christos  ******************************************************************************/
    392  1.1.1.2  christos static void
    393  1.1.1.2  christos AcpiDmDumpTpm2Rev3 (
    394  1.1.1.2  christos     ACPI_TABLE_HEADER       *Table)
    395  1.1.1.2  christos {
    396  1.1.1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TPM23);
    397  1.1.1.2  christos     ACPI_TABLE_TPM23        *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table);
    398  1.1.1.2  christos     ACPI_TPM23_TRAILER      *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset);
    399  1.1.1.2  christos     ACPI_STATUS             Status;
    400  1.1.1.2  christos 
    401  1.1.1.2  christos 
    402  1.1.1.2  christos     /* Main table */
    403  1.1.1.2  christos 
    404  1.1.1.2  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23);
    405  1.1.1.2  christos     if (ACPI_FAILURE (Status))
    406  1.1.1.2  christos     {
    407  1.1.1.2  christos         return;
    408  1.1.1.2  christos     }
    409  1.1.1.2  christos 
    410  1.1.1.2  christos     /* Optional subtable if start method is ACPI start method */
    411  1.1.1.2  christos 
    412  1.1.1.2  christos     switch (CommonHeader->StartMethod)
    413  1.1.1.2  christos     {
    414  1.1.1.2  christos     case ACPI_TPM23_ACPI_START_METHOD:
    415  1.1.1.2  christos 
    416  1.1.1.2  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    417  1.1.1.2  christos             Table->Length - Offset, AcpiDmTableInfoTpm23a);
    418  1.1.1.2  christos         break;
    419  1.1.1.2  christos 
    420  1.1.1.2  christos     default:
    421  1.1.1.2  christos         break;
    422  1.1.1.2  christos     }
    423  1.1.1.2  christos }
    424  1.1.1.2  christos 
    425  1.1.1.2  christos 
    426  1.1.1.2  christos /*******************************************************************************
    427  1.1.1.2  christos  *
    428  1.1.1.2  christos  * FUNCTION:    AcpiDmDumpTpm2
    429  1.1.1.2  christos  *
    430  1.1.1.2  christos  * PARAMETERS:  Table               - A TPM2 table
    431  1.1.1.2  christos  *
    432  1.1.1.2  christos  * RETURN:      None
    433  1.1.1.2  christos  *
    434  1.1.1.2  christos  * DESCRIPTION: Format the contents of a TPM2.
    435  1.1.1.2  christos  *
    436  1.1.1.2  christos  ******************************************************************************/
    437      1.1  christos 
    438      1.1  christos void
    439      1.1  christos AcpiDmDumpTpm2 (
    440      1.1  christos     ACPI_TABLE_HEADER       *Table)
    441      1.1  christos {
    442      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TPM2);
    443      1.1  christos     ACPI_TABLE_TPM2         *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM2, Table);
    444      1.1  christos     ACPI_TPM2_TRAILER       *Subtable = ACPI_ADD_PTR (ACPI_TPM2_TRAILER, Table, Offset);
    445      1.1  christos     ACPI_TPM2_ARM_SMC       *ArmSubtable;
    446      1.1  christos     ACPI_STATUS             Status;
    447      1.1  christos 
    448      1.1  christos 
    449  1.1.1.2  christos     if (Table->Revision == 3)
    450  1.1.1.2  christos     {
    451  1.1.1.2  christos         AcpiDmDumpTpm2Rev3(Table);
    452  1.1.1.2  christos         return;
    453  1.1.1.2  christos     }
    454  1.1.1.2  christos 
    455      1.1  christos     /* Main table */
    456      1.1  christos 
    457      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2);
    458  1.1.1.2  christos 
    459      1.1  christos     if (ACPI_FAILURE (Status))
    460      1.1  christos     {
    461      1.1  christos         return;
    462      1.1  christos     }
    463      1.1  christos 
    464      1.1  christos     AcpiOsPrintf ("\n");
    465      1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    466      1.1  christos         Table->Length - Offset, AcpiDmTableInfoTpm2a);
    467      1.1  christos     if (ACPI_FAILURE (Status))
    468      1.1  christos     {
    469      1.1  christos         return;
    470      1.1  christos     }
    471      1.1  christos 
    472      1.1  christos     switch (CommonHeader->StartMethod)
    473      1.1  christos     {
    474      1.1  christos     case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
    475      1.1  christos 
    476      1.1  christos         ArmSubtable = ACPI_ADD_PTR (ACPI_TPM2_ARM_SMC, Subtable,
    477      1.1  christos             sizeof (ACPI_TPM2_TRAILER));
    478      1.1  christos         Offset += sizeof (ACPI_TPM2_TRAILER);
    479      1.1  christos 
    480      1.1  christos         AcpiOsPrintf ("\n");
    481      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, ArmSubtable,
    482      1.1  christos             Table->Length - Offset, AcpiDmTableInfoTpm211);
    483      1.1  christos         break;
    484      1.1  christos 
    485      1.1  christos     default:
    486      1.1  christos         break;
    487      1.1  christos     }
    488      1.1  christos }
    489      1.1  christos 
    490      1.1  christos 
    491      1.1  christos /*******************************************************************************
    492      1.1  christos  *
    493      1.1  christos  * FUNCTION:    AcpiDmDumpVrtc
    494      1.1  christos  *
    495      1.1  christos  * PARAMETERS:  Table               - A VRTC table
    496      1.1  christos  *
    497      1.1  christos  * RETURN:      None
    498      1.1  christos  *
    499      1.1  christos  * DESCRIPTION: Format the contents of a VRTC
    500      1.1  christos  *
    501      1.1  christos  ******************************************************************************/
    502      1.1  christos 
    503      1.1  christos void
    504      1.1  christos AcpiDmDumpVrtc (
    505      1.1  christos     ACPI_TABLE_HEADER       *Table)
    506      1.1  christos {
    507      1.1  christos     ACPI_STATUS             Status;
    508      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_VRTC);
    509      1.1  christos     ACPI_VRTC_ENTRY         *Subtable;
    510      1.1  christos 
    511      1.1  christos 
    512      1.1  christos     /* Main table */
    513      1.1  christos 
    514      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
    515      1.1  christos     if (ACPI_FAILURE (Status))
    516      1.1  christos     {
    517      1.1  christos         return;
    518      1.1  christos     }
    519      1.1  christos 
    520      1.1  christos     /* Subtables */
    521      1.1  christos 
    522      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
    523      1.1  christos     while (Offset < Table->Length)
    524      1.1  christos     {
    525      1.1  christos         /* Common subtable header */
    526      1.1  christos 
    527      1.1  christos         AcpiOsPrintf ("\n");
    528      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    529      1.1  christos             sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
    530      1.1  christos         if (ACPI_FAILURE (Status))
    531      1.1  christos         {
    532      1.1  christos             return;
    533      1.1  christos         }
    534      1.1  christos 
    535      1.1  christos         /* Point to next subtable */
    536      1.1  christos 
    537      1.1  christos         Offset += sizeof (ACPI_VRTC_ENTRY);
    538      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Subtable,
    539      1.1  christos             sizeof (ACPI_VRTC_ENTRY));
    540      1.1  christos     }
    541      1.1  christos }
    542      1.1  christos 
    543      1.1  christos 
    544      1.1  christos /*******************************************************************************
    545      1.1  christos  *
    546      1.1  christos  * FUNCTION:    AcpiDmDumpWdat
    547      1.1  christos  *
    548      1.1  christos  * PARAMETERS:  Table               - A WDAT table
    549      1.1  christos  *
    550      1.1  christos  * RETURN:      None
    551      1.1  christos  *
    552      1.1  christos  * DESCRIPTION: Format the contents of a WDAT
    553      1.1  christos  *
    554      1.1  christos  ******************************************************************************/
    555      1.1  christos 
    556      1.1  christos void
    557      1.1  christos AcpiDmDumpWdat (
    558      1.1  christos     ACPI_TABLE_HEADER       *Table)
    559      1.1  christos {
    560      1.1  christos     ACPI_STATUS             Status;
    561      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_WDAT);
    562      1.1  christos     ACPI_WDAT_ENTRY         *Subtable;
    563      1.1  christos 
    564      1.1  christos 
    565      1.1  christos     /* Main table */
    566      1.1  christos 
    567      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
    568      1.1  christos     if (ACPI_FAILURE (Status))
    569      1.1  christos     {
    570      1.1  christos         return;
    571      1.1  christos     }
    572      1.1  christos 
    573      1.1  christos     /* Subtables */
    574      1.1  christos 
    575      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
    576      1.1  christos     while (Offset < Table->Length)
    577      1.1  christos     {
    578      1.1  christos         /* Common subtable header */
    579      1.1  christos 
    580      1.1  christos         AcpiOsPrintf ("\n");
    581      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    582      1.1  christos             sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
    583      1.1  christos         if (ACPI_FAILURE (Status))
    584      1.1  christos         {
    585      1.1  christos             return;
    586      1.1  christos         }
    587      1.1  christos 
    588      1.1  christos         /* Point to next subtable */
    589      1.1  christos 
    590      1.1  christos         Offset += sizeof (ACPI_WDAT_ENTRY);
    591      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Subtable,
    592      1.1  christos             sizeof (ACPI_WDAT_ENTRY));
    593      1.1  christos     }
    594      1.1  christos }
    595      1.1  christos 
    596      1.1  christos 
    597      1.1  christos /*******************************************************************************
    598      1.1  christos  *
    599      1.1  christos  * FUNCTION:    AcpiDmDumpWpbt
    600      1.1  christos  *
    601      1.1  christos  * PARAMETERS:  Table               - A WPBT table
    602      1.1  christos  *
    603      1.1  christos  * RETURN:      None
    604      1.1  christos  *
    605      1.1  christos  * DESCRIPTION: Format the contents of a WPBT. This table type consists
    606      1.1  christos  *              of an open-ended arguments buffer at the end of the table.
    607      1.1  christos  *
    608      1.1  christos  ******************************************************************************/
    609      1.1  christos 
    610      1.1  christos void
    611      1.1  christos AcpiDmDumpWpbt (
    612      1.1  christos     ACPI_TABLE_HEADER       *Table)
    613      1.1  christos {
    614      1.1  christos     ACPI_STATUS             Status;
    615      1.1  christos     ACPI_TABLE_WPBT         *Subtable;
    616      1.1  christos     UINT32                  Length = Table->Length;
    617      1.1  christos     UINT16                  ArgumentsLength;
    618      1.1  christos 
    619      1.1  christos 
    620      1.1  christos     /* Dump the main table */
    621      1.1  christos 
    622      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt);
    623      1.1  christos     if (ACPI_FAILURE (Status))
    624      1.1  christos     {
    625      1.1  christos         return;
    626      1.1  christos     }
    627      1.1  christos 
    628      1.1  christos     /* Extract the arguments buffer length from the main table */
    629      1.1  christos 
    630      1.1  christos     Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
    631      1.1  christos     ArgumentsLength = Subtable->ArgumentsLength;
    632      1.1  christos 
    633      1.1  christos     /* Dump the arguments buffer */
    634      1.1  christos 
    635      1.1  christos     (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
    636      1.1  christos         AcpiDmTableInfoWpbt0);
    637      1.1  christos }
    638